On 05/29/2014 01:36 PM, Laszlo Ersek wrote: > In addition to the on-line reporting added in the previous patch, allow > libvirt to query frontend state independently of events. > > Libvirt's path to identify the guest agent channel it cares about differs > between the event added in the previous patch and the QMP response field > added here. The event identifies the frontend device, by "id". The > 'query-chardev' QMP command identifies the backend device (again by "id"). > The association is under libvirt's control. > > RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1080376 > Signed-off-by: Laszlo Ersek <ler...@redhat.com> > --- > qapi-schema.json | 8 +++++++- > qemu-char.c | 2 ++ > qmp-commands.hx | 19 ++++++++++++++----- > 3 files changed, 23 insertions(+), 6 deletions(-) > > diff --git a/qapi-schema.json b/qapi-schema.json > index 7bc33ea..7692f9f 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -476,12 +476,18 @@ > # > # @filename: the filename of the character device > # > +# @frontend_open: #optional shows whether the frontend device attached to > this
s/frontend_open/frontend-open/ - as a new interface, we should be preferring '-' in the name. > +# backend (eg. with the chardev=... option) is in open or > +# closed state (since 2.2) Why 2.2? Are you saying it is too late to make the 2.1 soft freeze? Why optional? It is always emitted by your code, so it's simpler to just state that it is now a permanent part of the output struct (no back-compat considerations, since it is an output-only struct). > +# > # Notes: @filename is encoded using the QEMU command line character device > # encoding. See the QEMU man page for details. > # > # Since: 0.14.0 > ## > -{ 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} } > +{ 'type': 'ChardevInfo', 'data': {'label': 'str', > + 'filename': 'str', > + '*frontend_open': 'bool'} } Thus, s/*frontend_open/frontend-open/ > > ## > # @query-chardev: > diff --git a/qemu-char.c b/qemu-char.c > index 17b476e..021f86c 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -3439,6 +3439,8 @@ ChardevInfoList *qmp_query_chardev(Error **errp) > info->value = g_malloc0(sizeof(*info->value)); > info->value->label = g_strdup(chr->label); > info->value->filename = g_strdup(chr->filename); > + info->value->has_frontend_open = true; and drop this line > + info->value->frontend_open = chr->fe_open; > > info->next = chr_list; > chr_list = info; -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature