[PATCH 09/15] qemu: Do not restore the sysfs unpriv_sgio if the disk is being shared

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

 



This prevents restoring the unpriv_sgio if the disk is shared,
and is being used by other active domain. Because we don't want
to fall into the corruption situation.
---
 src/qemu/qemu_process.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 3923272..05f8622 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4151,6 +4151,17 @@ void qemuProcessStop(virQEMUDriverPtr driver,
         if (!disk->cdbfilter)
             continue;
 
+        /* Don't try to restore the unpriv_sgio if the disk is shared
+         * by other active domain(s). We don't want to fall into the
+         * corruptions.
+         */
+        if (disk->shared &&
+            qemuSharedDiskListFind(driver->sharedDisks,
+                                   disk->src,
+                                   NULL,
+                                   NULL))
+            continue;
+
         /* Restore sysfs unpriv_sgio for the disk */
         if (disk->old_cdbfilter == VIR_DOMAIN_DISK_CDB_FILTER_YES)
             val = 0;
-- 
1.7.7.6

--
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]