
Patch 1 fixes a segfault in one certain disk hot unplug case. Patch 2 moves decreases the log verbosity VIR_ERR_NO_SUPPORT Patch 3 removes some dead code noticed while browsing the code. All ought to be safe for the release. Peter Krempa (3): qemu: hotplug: Audit device detach before deleting it daemon: Drop log level of VIR_ERR_NO_SUPPORT to debug qemu: monitor: Remove wrappers for 'block-dirty-bitmap-enable'/'block-dirty-bitmap-disable' src/qemu/qemu_hotplug.c | 7 +++++-- src/qemu/qemu_monitor.c | 18 ------------------ src/qemu/qemu_monitor.h | 8 -------- src/qemu/qemu_monitor_json.c | 26 -------------------------- src/remote/remote_daemon.c | 1 + tests/qemumonitorjsontest.c | 2 -- 6 files changed, 6 insertions(+), 56 deletions(-) -- 2.51.0

From: Peter Krempa <pkrempa@redhat.com> Commit f30843142aa0836423f5e3ff7a45707eb13ce553 introduced a code path for solving a race when qemu doesn't know about a device but libvirt still does. The patch introduced a call to 'qemuDomainRemoveDevice' (which deletes/frees the device definition) and placed it before the call to 'qemuDomainRemoveAuditDevice' (which accesses the device definition to do the audit log reporting). Reorder them to prevent the qemu driver crashing in the corner case where qemu already detached the device but libvirt didn't yet process it, which can be triggered by calling the asynchronous 'virDomainDetachDeviceAlias' API. In addition in case when we're about to delete the device and return success we need to also report successful detach in the audit log so the logic calling the auditing function needs to be fixed as well. Resolves: https://issues.redhat.com/browse/RHEL-110191 Fixes: f30843142aa0836423f5e3ff7a45707eb13ce553 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_hotplug.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index e9568af125..afc75072ae 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6620,10 +6620,13 @@ qemuDomainDetachDeviceLive(virDomainObj *vm, rc = qemuDomainDeleteDevice(vm, info->alias); if (rc < 0) { + /* we want to report succesful detach if device doesn't exist any more in qemu */ + if (virDomainObjIsActive(vm)) + qemuDomainRemoveAuditDevice(vm, &detach, rc == -2); + if (rc == -2) ret = qemuDomainRemoveDevice(driver, vm, &detach); - if (virDomainObjIsActive(vm)) - qemuDomainRemoveAuditDevice(vm, &detach, false); + goto cleanup; } -- 2.51.0

From: Peter Krempa <pkrempa@redhat.com> The error code signals that the API the user called is not supported by the driver. This can happen with some hypervisor drivers which don't have everything implemented yet. There's no point in spamming the log with it. Closes: https://gitlab.com/libvirt/libvirt/-/issues/805 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/remote/remote_daemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index 1424d4cf5e..2973813548 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -108,6 +108,7 @@ static int daemonErrorLogFilter(virErrorPtr err, int priority) case VIR_ERR_NO_CLIENT: case VIR_ERR_NO_HOSTNAME: case VIR_ERR_NO_NETWORK_METADATA: + case VIR_ERR_NO_SUPPORT: return VIR_LOG_DEBUG; } -- 2.51.0

From: Peter Krempa <pkrempa@redhat.com> Libvirt doesn't use them. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_monitor.c | 18 ------------------ src/qemu/qemu_monitor.h | 8 -------- src/qemu/qemu_monitor_json.c | 26 -------------------------- tests/qemumonitorjsontest.c | 2 -- 4 files changed, 54 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index c1fef8d5de..e1ff8c15ce 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4275,24 +4275,6 @@ qemuMonitorBitmapRemove(qemuMonitor *mon, } -int -qemuMonitorTransactionBitmapEnable(virJSONValue *actions, - const char *node, - const char *name) -{ - return qemuMonitorJSONTransactionBitmapEnable(actions, node, name); -} - - -int -qemuMonitorTransactionBitmapDisable(virJSONValue *actions, - const char *node, - const char *name) -{ - return qemuMonitorJSONTransactionBitmapDisable(actions, node, name); -} - - int qemuMonitorTransactionBitmapMerge(virJSONValue *actions, const char *node, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 755f347e17..93fa38da71 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1464,14 +1464,6 @@ qemuMonitorBitmapRemove(qemuMonitor *mon, const char *node, const char *name); int -qemuMonitorTransactionBitmapEnable(virJSONValue *actions, - const char *node, - const char *name); -int -qemuMonitorTransactionBitmapDisable(virJSONValue *actions, - const char *node, - const char *name); -int qemuMonitorTransactionBitmapMerge(virJSONValue *actions, const char *node, const char *target, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 9f51421478..029ecae81a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -8245,32 +8245,6 @@ qemuMonitorJSONBitmapRemove(qemuMonitor *mon, } -int -qemuMonitorJSONTransactionBitmapEnable(virJSONValue *actions, - const char *node, - const char *name) -{ - return qemuMonitorJSONTransactionAdd(actions, - "block-dirty-bitmap-enable", - "s:node", node, - "s:name", name, - NULL); -} - - -int -qemuMonitorJSONTransactionBitmapDisable(virJSONValue *actions, - const char *node, - const char *name) -{ - return qemuMonitorJSONTransactionAdd(actions, - "block-dirty-bitmap-disable", - "s:node", node, - "s:name", name, - NULL); -} - - int qemuMonitorJSONTransactionBitmapMerge(virJSONValue *actions, const char *node, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index a18872db60..f9dc4081f7 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2654,8 +2654,6 @@ testQemuMonitorJSONTransaction(const void *opaque) if (qemuMonitorTransactionBitmapAdd(actions, "node1", "bitmap1", true, true, 1234) < 0 || qemuMonitorTransactionBitmapRemove(actions, "node2", "bitmap2") < 0 || - qemuMonitorTransactionBitmapEnable(actions, "node3", "bitmap3") < 0 || - qemuMonitorTransactionBitmapDisable(actions, "node4", "bitmap4") < 0 || qemuMonitorTransactionBitmapMerge(actions, "node5", "bitmap5", &mergebitmaps) < 0 || qemuMonitorTransactionSnapshotBlockdev(actions, "node7", "overlay7") < 0 || qemuMonitorTransactionBackup(actions, "dev8", "job8", "target8", "bitmap8", -- 2.51.0

On Tue, Aug 26, 2025 at 05:16:32PM +0200, Peter Krempa via Devel wrote:
Patch 1 fixes a segfault in one certain disk hot unplug case.
Patch 2 moves decreases the log verbosity VIR_ERR_NO_SUPPORT
Patch 3 removes some dead code noticed while browsing the code.
All ought to be safe for the release.
Peter Krempa (3): qemu: hotplug: Audit device detach before deleting it daemon: Drop log level of VIR_ERR_NO_SUPPORT to debug qemu: monitor: Remove wrappers for 'block-dirty-bitmap-enable'/'block-dirty-bitmap-disable'
Reviewed-by: Martin Kletzander <mkletzan@redhat.com> and safe for freeze.
src/qemu/qemu_hotplug.c | 7 +++++-- src/qemu/qemu_monitor.c | 18 ------------------ src/qemu/qemu_monitor.h | 8 -------- src/qemu/qemu_monitor_json.c | 26 -------------------------- src/remote/remote_daemon.c | 1 + tests/qemumonitorjsontest.c | 2 -- 6 files changed, 6 insertions(+), 56 deletions(-)
-- 2.51.0

On a Tuesday in 2025, Peter Krempa via Devel wrote:
Patch 1 fixes a segfault in one certain disk hot unplug case.
Patch 2 moves decreases the log verbosity VIR_ERR_NO_SUPPORT
Patch 3 removes some dead code noticed while browsing the code.
All ought to be safe for the release.
Peter Krempa (3): qemu: hotplug: Audit device detach before deleting it daemon: Drop log level of VIR_ERR_NO_SUPPORT to debug qemu: monitor: Remove wrappers for 'block-dirty-bitmap-enable'/'block-dirty-bitmap-disable'
IMO there's no point in including patch 3/3 in this release.
src/qemu/qemu_hotplug.c | 7 +++++-- src/qemu/qemu_monitor.c | 18 ------------------ src/qemu/qemu_monitor.h | 8 -------- src/qemu/qemu_monitor_json.c | 26 -------------------------- src/remote/remote_daemon.c | 1 + tests/qemumonitorjsontest.c | 2 -- 6 files changed, 6 insertions(+), 56 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (3)
-
Ján Tomko
-
Martin Kletzander
-
Peter Krempa