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

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



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


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