[Top][All Lists]

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

[Qemu-devel] [PATCH 0/2] help libvirt know what's up with qga

From: Laszlo Ersek
Subject: [Qemu-devel] [PATCH 0/2] help libvirt know what's up with qga
Date: Thu, 29 May 2014 21:36:39 +0200

In this series I try to implement the ideas that (I believe) were
suggested by Gerd and Amit in

When the guest agent exits or dies (disconnects from the virtio-serial
port), the backend (eg. a host-side unix domain socket) doesn't (in
general, can't) reflect it. This lack of info tends to trip up libvirt
in some cases, waiting indefinitely for an agent that doesn't exist.

The series adds two monitor events that report about virtio-serial ports
being opened and closed (for online notification), and extends the
"query-chardev" QMP command's return type with a "frontend_open" bool
(for querying at late libvirt startup).

Admittedly, these two don't report on the same level (frontend vs.
backend), but the association is under libvirt's control, so it should
be fine, and it helps keep the series non-intrusive. (Also known as, "I
have a fleeting chance implementing it, having authored neither chardev
nor virtio-serial".)

The series can be tested with libvirt immediately, as follows:

  1. set up qga as usual

  2. add the following XML element under the /domain element in the
     domain config:

     <qemu:commandline xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
       <qemu:arg value='-global'/>
       <qemu:arg value='virtserialport.report_connstate=true'/>

     (libvirt ignores unrecognized events, see

  3. configure libvirtd to log QEMU monitor and agent traffic;
     in "libvirtd.conf", set

     log_filters="1:qemu_monitor_ 1:qemu_agent"

  4. in the guest, start & stop the guest agent, and in lockstep:
     - on the host, issue:
       virsh qemu-monitor-command DOMAIN --pretty \

     - on the host, grep the libvirtd log for the new events:

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1080376

Laszlo Ersek (2):
  virtio-serial: report frontend connection state via monitor
  char: report frontend open/closed state in 'query-chardev'

 qapi-schema.json          |  8 +++++++-
 include/monitor/monitor.h |  2 ++
 hw/char/virtio-console.c  | 20 +++++++++++++++++---
 monitor.c                 |  2 ++
 qemu-char.c               |  2 ++
 docs/qmp/qmp-events.txt   | 34 ++++++++++++++++++++++++++++++++++
 qmp-commands.hx           | 19 ++++++++++++++-----
 7 files changed, 78 insertions(+), 9 deletions(-)


reply via email to

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