[libvirt] [PATCH 14/15] qemu: Do not restore unpriv_sgio if the disk is shared by other domain

Osier Yang jyang at redhat.com
Wed Dec 5 08:20:48 UTC 2012


Just like for domain shutdown, this prevents restoring the disk's
unpriv_sgio if it's being shared by other domain(s).
---
 src/qemu/qemu_driver.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 7288ad6..153e780 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6201,7 +6201,11 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
 
     if (ret == 0) {
         /* Restore the disk's unpriv_sgio */
-        if (disk->cdbfilter) {
+        if (disk->cdbfilter &&
+            !qemuSharedDiskListFind(driver->sharedDisks,
+                                    disk->src,
+                                    NULL,
+                                    NULL)) {
             int val;
 
             if (disk->old_cdbfilter == VIR_DOMAIN_DISK_CDB_FILTER_YES)
-- 
1.7.7.6




More information about the libvir-list mailing list