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: b79abf9c3c (vdpafd)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-08-12 16:04:20 +02:00
parent 1b797e6421
commit b3edf03c31

View File

@ -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);