]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix check for primary IDE controller in QEMU PCI slot assignment
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 15 Feb 2010 14:37:04 +0000 (14:37 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 16 Feb 2010 14:33:29 +0000 (14:33 +0000)
A typo in the check for the primary IDE controller could cause
a crash on restore depending on the exact guest config.

* src/qemu/qemu_conf.c: Fix s/video/controller/ typo & slot
  number typo

src/qemu/qemu_conf.c

index 551c8dea6704fbbffdc20370ad83f17988a6fd79..c9fe55bebd976b3db62e1d37f9b3b45d4cdd9aec 100644 (file)
@@ -2133,10 +2133,10 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
         if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE &&
             def->controllers[i]->idx == 0) {
             if (def->controllers[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
-                if (def->videos[i]->info.addr.pci.domain != 0 ||
-                    def->videos[i]->info.addr.pci.bus != 0 ||
-                    def->videos[i]->info.addr.pci.slot != 2 ||
-                    def->videos[i]->info.addr.pci.function != 0) {
+                if (def->controllers[i]->info.addr.pci.domain != 0 ||
+                    def->controllers[i]->info.addr.pci.bus != 0 ||
+                    def->controllers[i]->info.addr.pci.slot != 1 ||
+                    def->controllers[i]->info.addr.pci.function != 1) {
                     qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                                     _("Primary IDE controller must have PCI address 0:0:1.1"));
                     goto error;