From patchwork Wed Dec 23 19:52:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 41697 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C67FCB7BF4 for ; Thu, 24 Dec 2009 07:04:57 +1100 (EST) Received: from localhost ([127.0.0.1]:37176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNXS1-0001s9-RJ for incoming@patchwork.ozlabs.org; Wed, 23 Dec 2009 15:04:53 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNXHR-0007BJ-3T for qemu-devel@nongnu.org; Wed, 23 Dec 2009 14:53:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNXHL-00076Q-Pn for qemu-devel@nongnu.org; Wed, 23 Dec 2009 14:53:56 -0500 Received: from [199.232.76.173] (port=43546 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNXHL-00076F-Lx for qemu-devel@nongnu.org; Wed, 23 Dec 2009 14:53:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5778) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNXHL-0008LH-IE for qemu-devel@nongnu.org; Wed, 23 Dec 2009 14:53:51 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBNJroow003456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 23 Dec 2009 14:53:50 -0500 Received: from localhost (vpn-11-174.rdu.redhat.com [10.11.11.174]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBNJrmAg011151; Wed, 23 Dec 2009 14:53:49 -0500 From: Amit Shah To: qemu-devel@nongnu.org Date: Thu, 24 Dec 2009 01:22:26 +0530 Message-Id: <1261597948-24293-7-git-send-email-amit.shah@redhat.com> In-Reply-To: <1261597948-24293-6-git-send-email-amit.shah@redhat.com> References: <1261597948-24293-1-git-send-email-amit.shah@redhat.com> <1261597948-24293-2-git-send-email-amit.shah@redhat.com> <1261597948-24293-3-git-send-email-amit.shah@redhat.com> <1261597948-24293-4-git-send-email-amit.shah@redhat.com> <1261597948-24293-5-git-send-email-amit.shah@redhat.com> <1261597948-24293-6-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Amit Shah , kraxel@redhat.com, agraf@suse.de, armbru@redhat.com Subject: [Qemu-devel] [PATCH 6/8] virtio-serial-bus: Add ability to hot-unplug ports X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 12317ba..0a85f6e 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -856,6 +856,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 a64ff4d..eacc73e 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 == */