From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nuz7c-00079m-4d for qemu-devel@nongnu.org; Thu, 25 Mar 2010 22:18:04 -0400 Received: from [140.186.70.92] (port=54028 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nuz7Y-00074D-Tz for qemu-devel@nongnu.org; Thu, 25 Mar 2010 22:18:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nuz7V-0001KQ-NB for qemu-devel@nongnu.org; Thu, 25 Mar 2010 22:17:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16983) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nuz7V-0001KH-Eb for qemu-devel@nongnu.org; Thu, 25 Mar 2010 22:17:57 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2Q2HuUi006732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Mar 2010 22:17:56 -0400 Date: Fri, 26 Mar 2010 07:46:28 +0530 From: Amit Shah Message-ID: <20100326021628.GI8111@amit-x200.redhat.com> References: <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> <20100325155541.570f817d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100325155541.570f817d@redhat.com> 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: Luiz Capitulino Cc: Juan Quintela , Gerd Hoffmann , qemu list , "Michael S. Tsirkin" On (Thu) Mar 25 2010 [15:55:41], Luiz Capitulino wrote: > 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. What about other events that VIRTIO_SERIAL generates? Should they have a different event by themselves? Or should they ride on top of VIRTIO_SERIAL and mention different 'operations' that caused the event? > > +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}. Fixed. > > + > > +- "result": The result of the operation {json-string} > > + This is one of the following: > > + "pass", "fail" > > "result" could be a boolean "success". OK; success/fail? Also, by boolean, do you mean the data type? How is that represented? (Note: I put the port number as '%ld' instead of '%u' since %u isn't parsed..) > > +- "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. The answer to the first question above will answer this too. > > +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). OK; I'll do that. > Implementation looks ok. OK, thanks. Amit