[PATCH] qemu: hotplug: Rollback FD passthrough for 'slirpfd' and 'vdpafd' on hotplug failure

Peter Krempa posted 1 patch 3 months, 1 week ago
src/qemu/qemu_hotplug.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH] qemu: hotplug: Rollback FD passthrough for 'slirpfd' and 'vdpafd' on hotplug failure
Posted by Peter Krempa 3 months, 1 week ago
On failure to plug the device the cleanup path didn't roll back the FD
passing to qemu thus qemu would hold the FDs indefinitely.

Resolves: https://issues.redhat.com/browse/RHEL-53964
Fixes: b79abf9c3cdab8bcecfa8769629a4cdf4bf0b6c3 (vdpafd)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_hotplug.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 7cb1800504..75b97cf736 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1456,6 +1456,9 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
         VIR_WARN("Failed to remove network backend for netdev %s",
                  netdev_name);

+    qemuFDPassTransferMonitorRollback(netpriv->vdpafd, priv->mon);
+    qemuFDPassDirectTransferMonitorRollback(netpriv->slirpfd, priv->mon);
+
     for (n = netpriv->tapfds; n; n = n->next)
         qemuFDPassDirectTransferMonitorRollback(n->data, priv->mon);

-- 
2.46.0
Re: [PATCH] qemu: hotplug: Rollback FD passthrough for 'slirpfd' and 'vdpafd' on hotplug failure
Posted by Ján Tomko 3 months, 1 week ago
On a Monday in 2024, Peter Krempa wrote:
>On failure to plug the device the cleanup path didn't roll back the FD
>passing to qemu thus qemu would hold the FDs indefinitely.
>
>Resolves: https://issues.redhat.com/browse/RHEL-53964
>Fixes: b79abf9c3cdab8bcecfa8769629a4cdf4bf0b6c3 (vdpafd)
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_hotplug.c | 3 +++
> 1 file changed, 3 insertions(+)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano