qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] qdev: add virtserial char drv init hacks


From: Amit Shah
Subject: [Qemu-devel] [PATCH] qdev: add virtserial char drv init hacks
Date: Tue, 9 Jun 2009 22:12:47 +0530

Signed-off-by: Amit Shah <address@hidden>
---
 hw/qdev.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index 689cf4c..661bcde 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -172,9 +172,13 @@ CharDriverState *qdev_init_chardev(DeviceState *dev)
 {
     static int next_serial;
     static int next_virtconsole;
+    static int next_virtserial;
+
     /* FIXME: This is a nasty hack that needs to go away.  */
-    if (strncmp(dev->type->name, "virtio", 6) == 0) {
+    if (strncmp(dev->name, "virtio-console", 14) == 0) {
         return virtcon_hds[next_virtconsole++];
+    } else if (strncmp(dev->name, "virtio-serial", 13) == 0) {
+        return virtio_serial_hds[next_virtserial++];
     } else {
         return serial_hds[next_serial++];
     }
-- 
1.6.0.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]