From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRqqL-0002N4-FC for qemu-devel@nongnu.org; Mon, 04 Jan 2010 12:35:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRqqG-0002IW-B1 for qemu-devel@nongnu.org; Mon, 04 Jan 2010 12:35:48 -0500 Received: from [199.232.76.173] (port=41091 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRqqG-0002I6-0d for qemu-devel@nongnu.org; Mon, 04 Jan 2010 12:35:44 -0500 Received: from mx20.gnu.org ([199.232.41.8]:51209) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NRqqF-0000GM-39 for qemu-devel@nongnu.org; Mon, 04 Jan 2010 12:35:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRqqE-00053k-3y for qemu-devel@nongnu.org; Mon, 04 Jan 2010 12:35:42 -0500 From: Amit Shah Date: Mon, 4 Jan 2010 23:04:15 +0530 Message-Id: <1262626457-26671-7-git-send-email-amit.shah@redhat.com> In-Reply-To: <1262626457-26671-6-git-send-email-amit.shah@redhat.com> References: <1262626457-26671-1-git-send-email-amit.shah@redhat.com> <1262626457-26671-2-git-send-email-amit.shah@redhat.com> <1262626457-26671-3-git-send-email-amit.shah@redhat.com> <1262626457-26671-4-git-send-email-amit.shah@redhat.com> <1262626457-26671-5-git-send-email-amit.shah@redhat.com> <1262626457-26671-6-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 6/8] virtio-serial-bus: Add ability to hot-unplug ports List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amit Shah , kraxel@redhat.com, agraf@suse.de, armbru@redhat.com Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 2 ++ hw/virtio-serial.h | 1 + 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index bc47629..cf532f6 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -843,6 +843,8 @@ static int virtser_port_qdev_exit(DeviceState *qdev) VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev); VirtIOSerial *vser = port->vser; + send_control_event(port, VIRTIO_CONSOLE_PORT_REMOVE, 1); + /* * Don't decrement nr_ports here; thus we keep a linearly * increasing port id. Not utilising an id again saves us a couple diff --git a/hw/virtio-serial.h b/hw/virtio-serial.h index acb601d..13f6989 100644 --- a/hw/virtio-serial.h +++ b/hw/virtio-serial.h @@ -61,6 +61,7 @@ struct virtio_console_header { #define VIRTIO_CONSOLE_PORT_NAME 4 #define VIRTIO_CONSOLE_THROTTLE_PORT 5 #define VIRTIO_CONSOLE_CACHE_BUFFERS 6 +#define VIRTIO_CONSOLE_PORT_REMOVE 7 /* == In-qemu interface == */ -- 1.6.2.5