summary refs log tree commit diff stats
path: root/hw/virtio/vhost-user-snd.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2025-02-17 10:25:50 +0100
committerMichael S. Tsirkin <mst@redhat.com>2025-02-21 07:21:25 -0500
commit02fd9f8aeeb184276b283ae2f404bc3acf1e7b7a (patch)
tree771b519e53c2967a4b856495cb22eff20dfc031b /hw/virtio/vhost-user-snd.c
parent131fe64e63c88ec52c45a5946a478c0edeb31b78 (diff)
downloadfocaccia-qemu-02fd9f8aeeb184276b283ae2f404bc3acf1e7b7a.tar.gz
focaccia-qemu-02fd9f8aeeb184276b283ae2f404bc3acf1e7b7a.zip
net: vhost-user: add QAPI events to report connection state
The netdev reports NETDEV_VHOST_USER_CONNECTED event when
the chardev is connected, and NETDEV_VHOST_USER_DISCONNECTED
when it is disconnected.

The NETDEV_VHOST_USER_CONNECTED event includes the chardev id.

This allows a system manager like libvirt to detect when the server
fails.

For instance with passt:

{ 'execute': 'qmp_capabilities' }
{ "return": { } }

[killing passt here]

{ "timestamp": { "seconds": 1739538634, "microseconds": 920450 },
  "event": "NETDEV_VHOST_USER_DISCONNECTED",
  "data": { "netdev-id": "netdev0" } }

[automatic reconnection with reconnect-ms]

{ "timestamp": { "seconds": 1739538638, "microseconds": 354181 },
  "event": "NETDEV_VHOST_USER_CONNECTED",
  "data": { "netdev-id": "netdev0", "chardev-id": "chr0" } }

Tested-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20250217092550.1172055-1-lvivier@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/vhost-user-snd.c')
0 files changed, 0 insertions, 0 deletions