[PATCH 1/5] qemu: remove nonsensical sanity check in processNetdevStreamDisconnectedEvent()

Laine Stump via Devel posted 5 patches 8 months, 1 week ago
[PATCH 1/5] qemu: remove nonsensical sanity check in processNetdevStreamDisconnectedEvent()
Posted by Laine Stump via Devel 8 months, 1 week ago
By definition QEMU will never send a NETDEV_STREAM_DISCONNECTED event
if it doesn't support the reconnect option for a stream netdev (and
even if, by some comedy of errors, it did send
NETDEV_STREAM_DISCONNECTED in that case, our response to the event
doesn't request anything at all of QEMU (much less something that
would fail if QEMU didn't understand NETDEV_STREAM_DISCONNETED) - it
just starts a new passt process to replace the one that has just been
terminated, so we don't need to check the QEMU capabilities for
QEMU_CAPS_NETDEV_STREAM_RECONNECT.

Signed-off-by: Laine Stump <laine@redhat.com>
---
 src/qemu/qemu_driver.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6ce949dd07..411cf79317 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3612,7 +3612,6 @@ processNetdevStreamDisconnectedEvent(virDomainObj *vm,
 {
     virDomainDeviceDef dev;
     virDomainNetDef *def;
-    virQEMUCaps *qemuCaps = QEMU_DOMAIN_PRIVATE(vm)->qemuCaps;
     const char *devAlias = STRSKIP(netdevId, "host");
 
     /* The event sends us the "netdev-id", but we don't store the
@@ -3658,12 +3657,6 @@ processNetdevStreamDisconnectedEvent(virDomainObj *vm,
         goto endjob;
     }
 
-    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT)) {
-        VIR_WARN("ignore NETDEV_STREAM_DISCONNECTED event for passt network device %s in domain %s - QEMU binary does not support reconnect",
-                  def->info.alias, vm->def->name);
-        goto endjob;
-    }
-
     /* handle the event - restart the passt process with its original
      * parameters
      */
-- 
2.49.0
Re: [PATCH 1/5] qemu: remove nonsensical sanity check in processNetdevStreamDisconnectedEvent()
Posted by Jiri Denemark via Devel 8 months, 1 week ago
On Thu, Apr 10, 2025 at 02:58:26 -0400, Laine Stump wrote:
> By definition QEMU will never send a NETDEV_STREAM_DISCONNECTED event
> if it doesn't support the reconnect option for a stream netdev (and

Hmm, nested parenthesis and with a closing one missing :-) I suggest
just s/ (a/. A/

> even if, by some comedy of errors, it did send
> NETDEV_STREAM_DISCONNECTED in that case, our response to the event
> doesn't request anything at all of QEMU (much less something that
> would fail if QEMU didn't understand NETDEV_STREAM_DISCONNETED) - it
> just starts a new passt process to replace the one that has just been
> terminated, so we don't need to check the QEMU capabilities for
> QEMU_CAPS_NETDEV_STREAM_RECONNECT.
> 
> Signed-off-by: Laine Stump <laine@redhat.com>
> ---
>  src/qemu/qemu_driver.c | 7 -------
>  1 file changed, 7 deletions(-)

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>