[PATCH 2/2] qemu: Fix SCSI hotplug on pseries guests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vitor de Lima <vitor.lima@xxxxxxxxxxxxxxx>

This patch moves some code in the qemuDomainAttachSCSIDisk
function. The check for the existence of a PCI address assigned
to the SCSI controller was moved in order to be executed only
when needed. The PCI address of a controller is not necessary
if QEMU_CAPS_DEVICE is not supported.

This fixes issues with the hotplug of SCSI disks on pseries guests.
---
 src/qemu/qemu_hotplug.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index e9424d9..6eb483c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -518,12 +518,6 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn,
        and hence the above loop must iterate at least once.  */
     sa_assert(cont);
 
-    if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("SCSI controller %d was missing its PCI address"), cont->idx);
-        goto error;
-    }
-
     if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks+1) < 0)
         goto error;
 
@@ -540,6 +534,13 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn,
             }
         }
     } else {
+        if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("SCSI controller %d was missing its PCI address"),
+                           cont->idx);
+            goto error;
+        }
+
         virDomainDeviceDriveAddress driveAddr;
         ret = qemuMonitorAttachDrive(priv->mon,
                                      drivestr,
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]