On Wed, May 06, 2015 at 06:59:46PM -0400, Cole Robinson wrote:
My commit 747761a79 (v1.2.15 only) dropped this bit of logic when
filling
in a default arch in the XML:
- /* First try to find one matching host arch */
- for (i = 0; i < caps->nguests; i++) {
- if (caps->guests[i]->ostype == ostype) {
- for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
- if (caps->guests[i]->arch.domains[j]->type == domain
&&
- caps->guests[i]->arch.id == caps->host.arch)
- return caps->guests[i]->arch.id;
- }
- }
- }
That attempt to match host.arch is important, otherwise we end up
defaulting to i686 on x86_64 host for KVM, which is not intended.
Duplicate it in the centralized CapsLookup function.
This isn't really anything todo with KVM - it is a more general
requirement. If no architecture is given in the XML, we must
always default to the host architecture, whether using QEMU TCG
or KVM.
It looks like your code handles this fine, but the test case you
added is only checking kvm, so might be nice to also validate
the QEMU case too.
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|