|
|
acda74 |
From bf15c630b7c54637220af65ac84cfd007c1c798a Mon Sep 17 00:00:00 2001
|
|
|
acda74 |
Message-Id: <bf15c630b7c54637220af65ac84cfd007c1c798a@dist-git>
|
|
|
acda74 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
acda74 |
Date: Tue, 31 Jan 2023 15:35:05 +0100
|
|
|
acda74 |
Subject: [PATCH] qemu: block: Properly handle FD-passed disk hot-(un-)plug
|
|
|
acda74 |
|
|
|
acda74 |
The hotplug code paths need to be able to pass the FDs to the monitor to
|
|
|
acda74 |
ensure that hotplug works.
|
|
|
acda74 |
|
|
|
acda74 |
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
acda74 |
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
acda74 |
(cherry picked from commit 3b8d669d557bd2ce8874f61e83b6d6074d365ec2)
|
|
|
acda74 |
|
|
|
acda74 |
https://bugzilla.redhat.com/show_bug.cgi?id=2040272
|
|
|
acda74 |
---
|
|
|
acda74 |
src/qemu/qemu_block.c | 7 +++++++
|
|
|
acda74 |
1 file changed, 7 insertions(+)
|
|
|
acda74 |
|
|
|
acda74 |
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
|
|
|
acda74 |
index e865aa17f9..c218262691 100644
|
|
|
acda74 |
--- a/src/qemu/qemu_block.c
|
|
|
acda74 |
+++ b/src/qemu/qemu_block.c
|
|
|
acda74 |
@@ -1410,6 +1410,9 @@ qemuBlockStorageSourceAttachApplyStorageDeps(qemuMonitor *mon,
|
|
|
acda74 |
qemuMonitorAddObject(mon, &data->tlsProps, &data->tlsAlias) < 0)
|
|
|
acda74 |
return -1;
|
|
|
acda74 |
|
|
|
acda74 |
+ if (qemuFDPassTransferMonitor(data->fdpass, mon) < 0)
|
|
|
acda74 |
+ return -1;
|
|
|
acda74 |
+
|
|
|
acda74 |
return 0;
|
|
|
acda74 |
}
|
|
|
acda74 |
|
|
|
acda74 |
@@ -1559,6 +1562,8 @@ qemuBlockStorageSourceAttachRollback(qemuMonitor *mon,
|
|
|
acda74 |
if (data->tlsKeySecretAlias)
|
|
|
acda74 |
ignore_value(qemuMonitorDelObject(mon, data->tlsKeySecretAlias, false));
|
|
|
acda74 |
|
|
|
acda74 |
+ qemuFDPassTransferMonitorRollback(data->fdpass, mon);
|
|
|
acda74 |
+
|
|
|
acda74 |
virErrorRestore(&orig_err);
|
|
|
acda74 |
}
|
|
|
acda74 |
|
|
|
acda74 |
@@ -1609,6 +1614,8 @@ qemuBlockStorageSourceDetachPrepare(virStorageSource *src)
|
|
|
acda74 |
|
|
|
acda74 |
if (srcpriv->tlsKeySecret)
|
|
|
acda74 |
data->tlsKeySecretAlias = g_strdup(srcpriv->tlsKeySecret->alias);
|
|
|
acda74 |
+
|
|
|
acda74 |
+ data->fdpass = srcpriv->fdpass;
|
|
|
acda74 |
}
|
|
|
acda74 |
|
|
|
acda74 |
return g_steal_pointer(&data);
|
|
|
acda74 |
--
|
|
|
acda74 |
2.39.1
|
|
|
acda74 |
|