Christoph Egger
2009-Jun-19 14:33 UTC
[Xen-devel] [PATCH] tools: don''t require hardcoded path in guest config file
Hi! Attached patch allows xen tools to no longer require the hardcoded path''s to hvmloader, qemu-dm and stubdom-dm in the guest config files. This improves usability since the user no longer needs to know where hvmloader and qemu-dm have been installed and is a step in making guest migrations possible where hvmloader, qemu-dm and stubdom-dm have different install directories. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2009-Jun-19 15:16 UTC
Re: [Xen-devel] [PATCH] tools: don''t require hardcoded path in guest config file
Christoph Egger writes ("[Xen-devel] [PATCH] tools: don''t require
hardcoded path in guest config file"):> Attached patch allows xen tools to no longer require the hardcoded
path''s to
> hvmloader, qemu-dm and stubdom-dm in the guest config files.
In general I think this is a great idea.
I just have some detailed quibbles.
> + if not
os.path.exists(self[''platform''][''device_model'']):
> +
self[''platform''][''device_model''] = \
> +
auxbin.pathTo(self[''platform''][''device_model''])
I think it would be better just to look for a slash in the specified
value, and always prepend the path. Otherwise you end up checking for
the file in xend''s cwd which is pretty strange behaviour.
Treating all /-less values as paths in the expected installation
directory is more sensible.
> + # XXX basename works around a bug somewhere in the
guest
> + # config file parser which prepends cwd to the kernel
> + # w/o checking if the result is valid if no absolute
> + # path is specified
Surely it would be better to fix the guest config file parser!
> + if
os.path.basename(self[''PV_kernel'']) ==
''hvmloader'':
That workaround is a pretty hideous hack.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Christoph Egger
2009-Jun-19 15:32 UTC
Re: [Xen-devel] [PATCH] tools: don''t require hardcoded path in guest config file
On Friday 19 June 2009 17:16:42 Ian Jackson wrote:> Christoph Egger writes ("[Xen-devel] [PATCH] tools: don''t require hardcodedpath in guest config file"):> > Attached patch allows xen tools to no longer require the hardcoded path''s > > to hvmloader, qemu-dm and stubdom-dm in the guest config files. > > In general I think this is a great idea. > I just have some detailed quibbles. > > > + if not os.path.exists(self[''platform''][''device_model'']): > > + self[''platform''][''device_model''] = \ > > + auxbin.pathTo(self[''platform''][''device_model'']) > > I think it would be better just to look for a slash in the specified > value, and always prepend the path. Otherwise you end up checking for > the file in xend''s cwd which is pretty strange behaviour. > > Treating all /-less values as paths in the expected installation > directory is more sensible.Ok.> > + # XXX basename works around a bug somewhere in theguest> > + # config file parser which prepends cwd to the kernel > > + # w/o checking if the result is valid if no absolute > > + # path is specified > > Surely it would be better to fix the guest config file parser!Right. But I didn''t find the exact place where the cwd is actually prepended. It would be great, if you can help out here.> > + if os.path.basename(self[''PV_kernel''])== ''hvmloader'':> > That workaround is a pretty hideous hack.Yes, it is. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger
2009-Jun-22 13:01 UTC
Re: [Xen-devel] [PATCH] tools: don''t require hardcoded path in guest config file
On Friday 19 June 2009 17:16:42 Ian Jackson wrote:> Christoph Egger writes ("[Xen-devel] [PATCH] tools: don''t require hardcodedpath in guest config file"):> > Attached patch allows xen tools to no longer require the hardcoded path''s > > to hvmloader, qemu-dm and stubdom-dm in the guest config files. > > In general I think this is a great idea. > I just have some detailed quibbles.Attached is a new version. Fixes your quibbles below. I hope you like it.> > + if not os.path.exists(self[''platform''][''device_model'']): > > + self[''platform''][''device_model''] = \ > > + auxbin.pathTo(self[''platform''][''device_model'']) > > I think it would be better just to look for a slash in the specified > value, and always prepend the path. Otherwise you end up checking for > the file in xend''s cwd which is pretty strange behaviour. > > Treating all /-less values as paths in the expected installation > directory is more sensible. > > > + # XXX basename works around a bug somewhere in theguest> > + # config file parser which prepends cwd to the kernel > > + # w/o checking if the result is valid if no absolute > > + # path is specified > > Surely it would be better to fix the guest config file parser!Done.> > + if os.path.basename(self[''PV_kernel''])== ''hvmloader'':> > That workaround is a pretty hideous hack.Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel