qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] net: vhost-user: add QAPI events to report connection state


From: Daniel P . Berrangé
Subject: Re: [PATCH] net: vhost-user: add QAPI events to report connection state
Date: Fri, 14 Feb 2025 13:59:20 +0000
User-agent: Mutt/2.2.13 (2024-03-09)

On Fri, Feb 14, 2025 at 11:18:55AM +0100, Laurent Vivier wrote:
> On 14/02/2025 11:06, Markus Armbruster wrote:
> > Laurent Vivier <lvivier@redhat.com> writes:
> > 
> > > 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 ChardevInfo
> > > (label, filename and frontend_open).
> > > 
> > > 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": 1739517243, "microseconds": 115081 },
> > >    "event": "NETDEV_VHOST_USER_DISCONNECTED",
> > >    "data": { "netdev-id": "netdev0" } }
> > > 
> > > [automatic reconnection with reconnect-ms]
> > > 
> > > { "timestamp": { "seconds": 1739517290, "microseconds": 343777 },
> > >    "event": "NETDEV_VHOST_USER_CONNECTED",
> > >    "data": { "netdev-id": "netdev0",
> > >              "info": { "frontend-open": true,
> > >                        "filename": "unix:",
> > >                        "label": "chr0" } } }
> > > 
> > > Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> > 
> > Standard question for events: if a management application misses an
> > event, say because it restarts and reconnects, is there a way to obtain
> > the missed information with a query command?
> > 
> 
> query-chardev could help but it doesn't provide the netdev id.

It doesn't have to IMHO. The application that created the NIC should know
what ID it assigned to both the netdev and chardev, and thus should be
able to use query-chardev to identify the chardev it previously
associated with the netdev.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]