]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Support sgio setting for volume type disk
authorOsier Yang <jyang@redhat.com>
Thu, 4 Apr 2013 19:38:02 +0000 (03:38 +0800)
committerOsier Yang <jyang@redhat.com>
Mon, 8 Apr 2013 11:10:12 +0000 (19:10 +0800)
src/qemu/qemu_conf.c
src/qemu/qemu_process.c

index 54d5ad64b03a8ec6f0f2d1af74aa9983ce5e9b9d..06bc4d3e1ebcd6f24b93c5df0a31e5750ce96e48 100644 (file)
@@ -996,9 +996,18 @@ qemuCheckSharedDisk(virHashTablePtr sharedDisks,
          disk->sgio == VIR_DOMAIN_DISK_SGIO_UNFILTERED))
         goto cleanup;
 
-    virReportError(VIR_ERR_OPERATION_INVALID,
-                   _("sgio of shared disk '%s' conflicts with other "
-                     "active domains"), disk->src);
+    if (disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME) {
+        virReportError(VIR_ERR_OPERATION_INVALID,
+                       _("sgio of shared disk 'pool=%s' 'volume=%s' conflicts "
+                         "with other active domains"),
+                       disk->srcpool->pool,
+                       disk->srcpool->volume);
+    } else {
+        virReportError(VIR_ERR_OPERATION_INVALID,
+                       _("sgio of shared disk '%s' conflicts with other "
+                         "active domains"), disk->src);
+    }
+
     ret = -1;
 
 cleanup:
index 31427edb5c938d0488d7e81c4c891f7ea3896f5f..39c49ce286a6ffb575aa35bc2b585d8a4854044f 100644 (file)
@@ -3235,9 +3235,12 @@ qemuSetUnprivSGIO(virDomainDiskDefPtr disk)
     /* "sgio" is only valid for block disk; cdrom
      * and floopy disk can have empty source.
      */
-    if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK ||
+    if (!disk->src ||
         disk->device != VIR_DOMAIN_DISK_DEVICE_LUN ||
-        !disk->src)
+        (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK &&
+         !(disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME &&
+           disk->srcpool &&
+           disk->srcpool->voltype == VIR_STORAGE_VOL_BLOCK)))
         return 0;
 
     sysfs_path = virGetUnprivSGIOSysfsPath(disk->src, NULL);