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