From: Peter Krempa Date: Mon, 12 Aug 2024 14:04:20 +0000 (+0200) Subject: qemu: hotplug: Rollback FD passthrough for 'slirpfd' and 'vdpafd' on hotplug failure X-Git-Tag: v10.7.0-rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3edf03c310b7c4b9fc67fc6c9e3129312e37653;p=thirdparty%2Flibvirt.git qemu: hotplug: Rollback FD passthrough for 'slirpfd' and 'vdpafd' on hotplug failure 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 Reviewed-by: Ján Tomko --- 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);