Blame qemu-virtio-serial-bus-Add-ability-to-hot-unplug-ports.patch

amitshah 99a9ef
From c101ff585d5b156a1f3461015a9acd73f15a45f6 Mon Sep 17 00:00:00 2001
amitshah 99a9ef
From: Amit Shah <amit.shah@redhat.com>
amitshah 99a9ef
Date: Wed, 20 Jan 2010 00:36:55 +0530
amitshah 99a9ef
Subject: [PATCH 5/9] virtio-serial-bus: Add ability to hot-unplug ports
amitshah 99a9ef
amitshah 99a9ef
Signed-off-by: Amit Shah <amit.shah@redhat.com>
amitshah 99a9ef
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
amitshah 99a9ef
---
amitshah 99a9ef
 hw/virtio-serial-bus.c |    2 ++
amitshah 99a9ef
 hw/virtio-serial.h     |    1 +
amitshah 99a9ef
 2 files changed, 3 insertions(+), 0 deletions(-)
amitshah 99a9ef
amitshah 99a9ef
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
amitshah 99a9ef
index 6d69c56..037864f 100644
amitshah 99a9ef
--- a/hw/virtio-serial-bus.c
amitshah 99a9ef
+++ b/hw/virtio-serial-bus.c
amitshah 99a9ef
@@ -517,6 +517,8 @@ static int virtser_port_qdev_exit(DeviceState *qdev)
amitshah 99a9ef
     VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev);
amitshah 99a9ef
     VirtIOSerial *vser = port->vser;
amitshah 99a9ef
 
amitshah 99a9ef
+    send_control_event(port, VIRTIO_CONSOLE_PORT_REMOVE, 1);
amitshah 99a9ef
+
amitshah 99a9ef
     /*
amitshah 99a9ef
      * Don't decrement nr_ports here; thus we keep a linearly
amitshah 99a9ef
      * increasing port id. Not utilising an id again saves us a couple
amitshah 99a9ef
diff --git a/hw/virtio-serial.h b/hw/virtio-serial.h
amitshah 99a9ef
index 28ea7da..f297b00 100644
amitshah 99a9ef
--- a/hw/virtio-serial.h
amitshah 99a9ef
+++ b/hw/virtio-serial.h
amitshah 99a9ef
@@ -51,6 +51,7 @@ struct virtio_console_control {
amitshah 99a9ef
 #define VIRTIO_CONSOLE_RESIZE		2
amitshah 99a9ef
 #define VIRTIO_CONSOLE_PORT_OPEN	3
amitshah 99a9ef
 #define VIRTIO_CONSOLE_PORT_NAME	4
amitshah 99a9ef
+#define VIRTIO_CONSOLE_PORT_REMOVE	5
amitshah 99a9ef
 
amitshah 99a9ef
 /* == In-qemu interface == */
amitshah 99a9ef
 
amitshah 99a9ef
-- 
amitshah 99a9ef
1.6.2.5
amitshah 99a9ef