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
This commit is contained in:
Cole Robinson 2016-06-17 17:17:49 -04:00
parent 118bf85cba
commit 40e0354631
3 changed files with 14 additions and 3 deletions

View File

@ -19,10 +19,19 @@
<on_crash>restart</on_crash> <on_crash>restart</on_crash>
<devices> <devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator> <emulator>/usr/bin/qemu-system-aarch64</emulator>
<interface type="bridge"> <disk type="file" device="disk">
<source bridge="eth0"/> <driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/foobar.qcow2"/>
<target dev="sda" bus="scsi"/>
</disk>
<controller type="scsi" index="0" model="virtio-scsi">
<address type="pci"/>
</controller>
<interface type="network">
<source network="default"/>
<mac address="00:11:22:33:44:55"/> <mac address="00:11:22:33:44:55"/>
<model type="virtio"/> <model type="virtio"/>
<address type="pci"/>
</interface> </interface>
<console type="pty"/> <console type="pty"/>
<channel type="unix"> <channel type="unix">

View File

@ -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 --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("--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 %(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 # 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") c.add_compare("--arch ppc64 --machine pseries --boot network --disk %(EXISTIMG1)s --disk device=cdrom --os-variant fedora20 --network none", "ppc64-pseries-f20")

View File

@ -914,6 +914,8 @@ class Guest(XMLBuilder):
for d in self.get_all_devices(): for d in self.get_all_devices():
if d.address.type != d.address.ADDRESS_TYPE_PCI: if d.address.type != d.address.ADDRESS_TYPE_PCI:
continue continue
if None in [d.address.domain, d.address.bus, d.address.slot]:
continue
addr = d.address addr = d.address
addrstr = "%d%d%d" % (d.address.domain, addrstr = "%d%d%d" % (d.address.domain,