From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NusDk-0004Ad-QP for qemu-devel@nongnu.org; Thu, 25 Mar 2010 14:55:56 -0400 Received: from [140.186.70.92] (port=35667 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NusDj-00049K-Cv for qemu-devel@nongnu.org; Thu, 25 Mar 2010 14:55:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NusDh-00048r-W7 for qemu-devel@nongnu.org; Thu, 25 Mar 2010 14:55:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60609) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NusDh-00048Z-LG for qemu-devel@nongnu.org; Thu, 25 Mar 2010 14:55:53 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2PItq7R028090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Mar 2010 14:55:52 -0400 Date: Thu, 25 Mar 2010 15:55:41 -0300 From: Luiz Capitulino Message-ID: <20100325155541.570f817d@redhat.com> In-Reply-To: <1269442173-18421-11-git-send-email-amit.shah@redhat.com> References: <1269442173-18421-1-git-send-email-amit.shah@redhat.com> <1269442173-18421-2-git-send-email-amit.shah@redhat.com> <1269442173-18421-3-git-send-email-amit.shah@redhat.com> <1269442173-18421-4-git-send-email-amit.shah@redhat.com> <1269442173-18421-5-git-send-email-amit.shah@redhat.com> <1269442173-18421-6-git-send-email-amit.shah@redhat.com> <1269442173-18421-7-git-send-email-amit.shah@redhat.com> <1269442173-18421-8-git-send-email-amit.shah@redhat.com> <1269442173-18421-9-git-send-email-amit.shah@redhat.com> <1269442173-18421-10-git-send-email-amit.shah@redhat.com> <1269442173-18421-11-git-send-email-amit.shah@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 10/15] virtio-serial: Add QMP events for failed port/device add List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Juan Quintela , Gerd Hoffmann , qemu list , "Michael S. Tsirkin" On Wed, 24 Mar 2010 20:19:28 +0530 Amit Shah wrote: > When adding a port or a device to the guest fails, management software > might be interested in knowing and then cleaning up the host-side of the > port. Introduce QMP events to signal such errors. > > Signed-off-by: Amit Shah > CC: Luiz Capitulino > --- > QMP/qmp-events.txt | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ > hw/virtio-serial-bus.c | 15 +++++++++++++++ > monitor.c | 3 +++ > monitor.h | 1 + > 4 files changed, 67 insertions(+), 0 deletions(-) > > diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt > index a94e9b4..f13cf45 100644 > --- a/QMP/qmp-events.txt > +++ b/QMP/qmp-events.txt > @@ -188,3 +188,51 @@ Example: > > Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is > followed respectively by the RESET, SHUTDOWN, or STOP events. > + > +VIRTIO_SERIAL > +------------- It should be VIRTIO_SERIAL_ADD. > + > +Emitted when errors occur in guest port add or guest device add. > + > +Data: > + > +- "device": The virtio-serial device that triggered the event {json-string} > + This is the name given to the bus on the command line: > + -device virtio-serial,id="foo" > + here, the device name is "foo" > + > +- "port": The port number that triggered the event {json-number} > + This is the number given to the port on the command line: > + -device virtserialport,nr=2 > + here, the port number is 2. If not mentioned on the command > + line, the number is auto-assigned. We use (json-number) instead of {json-number}. > + > +- "result": The result of the operation {json-string} > + This is one of the following: > + "pass", "fail" "result" could be a boolean "success". > + > +- "operation": The operation that triggered the event {json-sring} > + This is one of the following: > + "port_add", "device_add" You can drop the '_add', as this information is in the event name. > + > +Example: > + > +Port 0 add failure in the guest: > + > +{ "timestamp": {"seconds": 1269438649, "microseconds": 851170}, > + "event": "VIRTIO_SERIAL", > + "data": { > + "device": "virtio-serial-bus.0", > + "port": 0, > + "result": "fail", > + "operation": "port_add" } } If you look at the other events you will see that I put the event first and the timestamp later, I know this is not how the event is going to be on the wire but improves the readability of this file (and the spec says that clients should not assume the ordering of dicts or lists). Implementation looks ok.