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