[Libvir] PATCH: Fix qemu-dm path in capabilities info

The current Xen capabilities XML data chooses between /usr/lib/xen/bin/qemu-dm and /usr/lib64/xen/bin/qemu-dm based on whether the guest arch is 64 bit. This is incorrect because the path is actually determined based on the host OS. Only x86_64 uses /usr/lib64, all other arches just use /usr/lib - even on ia64. So this patch changes the logic so that /usr/lib64 is only used if we see an x86_64 guest present - this implies host is x86_64 and that all guests whether 32 or 64bit shoudl use /usr/lib64 Dan. diff -r 38f2abccef9b src/xen_internal.c --- a/src/xen_internal.c Sun Jan 20 11:28:37 2008 -0500 +++ b/src/xen_internal.c Sun Jan 20 12:36:23 2008 -0500 @@ -2186,6 +2186,7 @@ xenHypervisorMakeCapabilitiesXML(virConn int ia64_be; } guest_archs[32]; int nr_guest_archs = 0; + int lib64 = 0; virBufferPtr xml; char *xml_str; @@ -2261,6 +2262,7 @@ xenHypervisorMakeCapabilitiesXML(virConn else if (strncmp (&token[subs[2].rm_so], "x86_64", 6) == 0) { model = "x86_64"; bits = 64; + lib64 = 1; } else if (strncmp (&token[subs[2].rm_so], "ia64", 4) == 0) { model = "ia64"; @@ -2376,7 +2378,7 @@ xenHypervisorMakeCapabilitiesXML(virConn <machine>pc</machine>\n\ <machine>isapc</machine>\n\ <loader>/usr/lib/xen/boot/hvmloader</loader>\n", - guest_archs[i].bits == 64 ? "64" : ""); + lib64 ? "64" : ""); if (r == -1) goto vir_buffer_failed; } r = virBufferAdd (xml, -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Daniel P. Berrange wrote:
The current Xen capabilities XML data chooses between /usr/lib/xen/bin/qemu-dm and /usr/lib64/xen/bin/qemu-dm based on whether the guest arch is 64 bit. This is incorrect because the path is actually determined based on the host OS. Only x86_64 uses /usr/lib64, all other arches just use /usr/lib - even on ia64. So this patch changes the logic so that /usr/lib64 is only used if we see an x86_64 guest present - this implies host is x86_64 and that all guests whether 32 or 64bit shoudl use /usr/lib64
Actually Debian uses /usr/lib too on all architectures (in fact I'm not sure which other Linux systems use /usr/lib64 - it's very peculiar to Red Hat). However Debian symlinks /usr/lib64 -> /usr/lib, presumably for compatibility with whoever thought using /usr/lib64 was a good idea in the first place. Unix managed to transition from 16 to 32 bits without adding '*32' everywhere, I'm not sure why this time is different ... Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Mon, Jan 21, 2008 at 11:55:45AM +0000, Richard W.M. Jones wrote:
Daniel P. Berrange wrote:
The current Xen capabilities XML data chooses between /usr/lib/xen/bin/qemu-dm and /usr/lib64/xen/bin/qemu-dm based on whether the guest arch is 64 bit. This is incorrect because the path is actually determined based on the host OS. Only x86_64 uses /usr/lib64, all other arches just use /usr/lib - even on ia64. So this patch changes the logic so that /usr/lib64 is only used if we see an x86_64 guest present - this implies host is x86_64 and that all guests whether 32 or 64bit shoudl use /usr/lib64
Actually Debian uses /usr/lib too on all architectures (in fact I'm not sure which other Linux systems use /usr/lib64 - it's very peculiar to Red Hat).
However Debian symlinks /usr/lib64 -> /usr/lib, presumably for compatibility with whoever thought using /usr/lib64 was a good idea in the first place. Unix managed to transition from 16 to 32 bits without adding '*32' everywhere, I'm not sure why this time is different ...
Yeah I realized this would break debian over night too. I need to make a configure.ac check for the correct install location. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
participants (2)
-
Daniel P. Berrange
-
Richard W.M. Jones