From: Amit Shah <amit.shah@redhat.com>
To: anthony@codemonkey.ws
Cc: Amit Shah <amit.shah@redhat.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] qdev: add virtserial char drv init hacks
Date: Tue, 9 Jun 2009 22:12:47 +0530 [thread overview]
Message-ID: <1244565768-9103-3-git-send-email-amit.shah@redhat.com> (raw)
In-Reply-To: <1244565768-9103-2-git-send-email-amit.shah@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
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
next prev parent reply other threads:[~2009-06-09 16:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 16:42 [Qemu-devel] [RFC] virtio-serial device Amit Shah
2009-06-09 16:42 ` [Qemu-devel] [PATCH] pci: add define for communication class devices Amit Shah
2009-06-09 16:42 ` Amit Shah [this message]
2009-06-09 16:42 ` [Qemu-devel] [PATCH] virtio-serial: PCI device for simple host <-> guest communication Amit Shah
2009-06-09 17:15 ` [Qemu-devel] " Jan Kiszka
2009-06-09 18:15 ` Richard W.M. Jones
2009-06-09 19:19 ` Jan Kiszka
2009-06-09 18:17 ` [Qemu-devel] " Richard W.M. Jones
2009-06-09 18:47 ` Stuart Brady
2009-06-09 18:56 ` Anthony Liguori
2009-06-09 23:40 ` Paul Brook
2009-06-10 10:31 ` Amit Shah
2009-06-10 18:00 ` Jamie Lokier
2009-06-11 4:31 ` Amit Shah
2009-06-12 1:56 ` Jamie Lokier
2009-06-11 13:51 ` Amit Shah
2009-06-11 16:07 ` Blue Swirl
2009-06-11 16:21 ` Amit Shah
2009-06-10 10:28 ` Amit Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1244565768-9103-3-git-send-email-amit.shah@redhat.com \
--to=amit.shah@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).