Re: [PATCH 8/8] qemu: Support sgio setting for volume type disk

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

 



On 05/04/13 03:38, Osier Yang wrote:
---
  src/qemu/qemu_process.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 3ac0c70..757f8b8 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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);

With the following missed diff squashed in:


diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index c7b8045..e67c960 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1014,9 +1014,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:
--
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]