[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] pygrub: Add option to list grub entries

Charles Arnold writes ("[Xen-devel]  [PATCH] pygrub: Add option to list grub 
> pygrub: Add option to list grub entries
> The argument to "--entry" allows 2 syntaxes, either directly the entry number
> in menu.lst, or the whole string behind the "title" key word. This poses the
> following issue:
> >From Dom0 there is no way to guess the number and, or the complete title
> string because this string contains the kernel version, which will change
> with a kernel update.
> This patch adds [-l|--list-entries] as an argument to pygrub.

> +    if list_entries:
> +        for i in range(len(g.cf.images)):
> +            img = g.cf.images[i]
> +            print "title: %s" % img.title
> +            print "  root: %s" % img.root
> +            print "  kernel: %s" % img.kernel[1]
> +            print "  args: %s" % img.args
> +            print "  initrd: %s" % img.initrd[1]

Is it possible for any of these to contain newlines ?  I don't think
so but I'm not entirely sure.  If it is then they need to be quoted
somehow or the caller may be unable to unambigously parse the output.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.