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>
This commit is contained in:
parent
131fe64e63
commit
02fd9f8aee
2 changed files with 43 additions and 0 deletions
|
|
@ -1031,3 +1031,43 @@
|
|||
##
|
||||
{ 'event': 'NETDEV_STREAM_DISCONNECTED',
|
||||
'data': { 'netdev-id': 'str' } }
|
||||
|
||||
##
|
||||
# @NETDEV_VHOST_USER_CONNECTED:
|
||||
#
|
||||
# Emitted when the vhost-user chardev is connected
|
||||
#
|
||||
# @netdev-id: QEMU netdev id that is connected
|
||||
#
|
||||
# @chardev-id: The character device id used by the QEMU netdev
|
||||
#
|
||||
# Since: 10.0
|
||||
#
|
||||
# .. qmp-example::
|
||||
#
|
||||
# <- { "timestamp": {"seconds": 1739538638, "microseconds": 354181 },
|
||||
# "event": "NETDEV_VHOST_USER_CONNECTED",
|
||||
# "data": { "netdev-id": "netdev0", "chardev-id": "chr0" } }
|
||||
#
|
||||
##
|
||||
{ 'event': 'NETDEV_VHOST_USER_CONNECTED',
|
||||
'data': { 'netdev-id': 'str', 'chardev-id': 'str' } }
|
||||
|
||||
##
|
||||
# @NETDEV_VHOST_USER_DISCONNECTED:
|
||||
#
|
||||
# Emitted when the vhost-user chardev is disconnected
|
||||
#
|
||||
# @netdev-id: QEMU netdev id that is disconnected
|
||||
#
|
||||
# Since: 10.0
|
||||
#
|
||||
# .. qmp-example::
|
||||
#
|
||||
# <- { "timestamp": { "seconds": 1739538634, "microseconds": 920450 },
|
||||
# "event": "NETDEV_VHOST_USER_DISCONNECTED",
|
||||
# "data": { "netdev-id": "netdev0" } }
|
||||
#
|
||||
##
|
||||
{ 'event': 'NETDEV_VHOST_USER_DISCONNECTED',
|
||||
'data': { 'netdev-id': 'str' } }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue