Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwvUL-0005QG-0u for qemu-devel@nongnu.org; Wed, 31 Mar 2010 06:49:33 -0400 Received: from [140.186.70.92] (port=51761 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwvUI-0005Pf-3H for qemu-devel@nongnu.org; Wed, 31 Mar 2010 06:49:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwvUG-0007Ks-3I for qemu-devel@nongnu.org; Wed, 31 Mar 2010 06:49:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52568) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwsTD-0007Bx-Cn for qemu-devel@nongnu.org; Wed, 31 Mar 2010 03:36:18 -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 o2V7a7Sk015717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Mar 2010 03:36:08 -0400 From: Amit Shah Date: Wed, 31 Mar 2010 13:04:00 +0530 Message-Id: <1270020848-15526-10-git-send-email-amit.shah@redhat.com> In-Reply-To: <1270020848-15526-9-git-send-email-amit.shah@redhat.com> References: <1270020848-15526-1-git-send-email-amit.shah@redhat.com> <1270020848-15526-2-git-send-email-amit.shah@redhat.com> <1270020848-15526-3-git-send-email-amit.shah@redhat.com> <1270020848-15526-4-git-send-email-amit.shah@redhat.com> <1270020848-15526-5-git-send-email-amit.shah@redhat.com> <1270020848-15526-6-git-send-email-amit.shah@redhat.com> <1270020848-15526-7-git-send-email-amit.shah@redhat.com> <1270020848-15526-8-git-send-email-amit.shah@redhat.com> <1270020848-15526-9-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 09/17] virtio-serial: Propagate errors in initialising ports / devices in guest List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Amit Shah , "Michael S. Tsirkin" , Gerd Hoffmann , Juan Quintela If adding of ports or devices in the guest fails we can send out a QMP event so that management software can deal with it. Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index a19e751..33083af 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -223,6 +223,11 @@ static void handle_control_message(VirtIOSerial *vser, void *buf) switch(cpkt.event) { case VIRTIO_CONSOLE_DEVICE_READY: + if (!cpkt.value) { + error_report("virtio-serial-bus: Guest failure in adding device %s\n", + vser->bus->qbus.name); + break; + } /* * The device is up, we can now tell the device about all the * ports we have here. @@ -233,6 +238,11 @@ static void handle_control_message(VirtIOSerial *vser, void *buf) break; case VIRTIO_CONSOLE_PORT_READY: + if (!cpkt.value) { + error_report("virtio-serial-bus: Guest failure in adding port %u for device %s\n", + port->id, vser->bus->qbus.name); + break; + } /* * Now that we know the guest asked for the port name, we're * sure the guest has initialised whatever state is necessary -- 1.6.2.5