From 40e035463193e676e875261d9d85cb7885fc8efc Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 17 Jun 2016 17:17:49 -0400 Subject: [PATCH] guest: Fix multiple address.type=pci auto allocate requests And test it for aarch64, which is the only place it's really interesting at the moment --- .../compare/virt-install-aarch64-kvm-gic.xml | 13 +++++++++++-- tests/clitest.py | 2 +- virtinst/guest.py | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml b/tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml index 189373dbc..5bf414493 100644 --- a/tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml +++ b/tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml @@ -19,10 +19,19 @@ restart /usr/bin/qemu-system-aarch64 - - + + + + + + +
+ + + +
diff --git a/tests/clitest.py b/tests/clitest.py index 2625142cb..b63a92a7c 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -714,7 +714,7 @@ c.add_compare("--arch aarch64 --machine virt --boot kernel=/f19-arm.kernel,initr c.add_compare("--arch aarch64 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machdefault") c.add_compare("--arch aarch64 --cdrom %(EXISTIMG2)s --boot loader=CODE.fd,nvram_template=VARS.fd --disk %(EXISTIMG1)s --cpu none --events on_crash=preserve,on_reboot=destroy,on_poweroff=restart", "aarch64-cdrom") c.add_compare("--connect %(URI-KVM-AARCH64)s --disk %(EXISTIMG1)s --import --os-variant fedora21", "aarch64-kvm-import") -c.add_compare("--connect %(URI-KVM-AARCH64)s --disk none --os-variant fedora22 --features gic_version=host", "aarch64-kvm-gic") +c.add_compare("--connect %(URI-KVM-AARCH64)s --disk size=1 --os-variant fedora22 --features gic_version=host --network network=default,address.type=pci --controller type=scsi,model=virtio-scsi,address.type=pci", "aarch64-kvm-gic") # ppc64 tests c.add_compare("--arch ppc64 --machine pseries --boot network --disk %(EXISTIMG1)s --disk device=cdrom --os-variant fedora20 --network none", "ppc64-pseries-f20") diff --git a/virtinst/guest.py b/virtinst/guest.py index 8e7aef7e4..6a42536e0 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -914,6 +914,8 @@ class Guest(XMLBuilder): for d in self.get_all_devices(): if d.address.type != d.address.ADDRESS_TYPE_PCI: continue + if None in [d.address.domain, d.address.bus, d.address.slot]: + continue addr = d.address addrstr = "%d%d%d" % (d.address.domain,