From: "Chen, Tiejun" <tiejun.chen@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: amit.shah@redhat.com, borntraeger@de.ibm.com, agraf@suse.de,
aliguori@amazon.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [v2][RFC][PATCH] virtio: uniform virtio device IDs
Date: Mon, 09 Feb 2015 15:01:15 +0800 [thread overview]
Message-ID: <54D85B3B.3040306@intel.com> (raw)
In-Reply-To: <20150208104854.GF3185@redhat.com>
On 2015/2/8 18:48, Michael S. Tsirkin wrote:
> On Fri, Feb 06, 2015 at 01:14:46PM +0100, Cornelia Huck wrote:
>> On Fri, 6 Feb 2015 13:41:26 +0800
>> Tiejun Chen <tiejun.chen@intel.com> wrote:
>>
>>> Actually we define these device IDs in virtio standard, so
>>> we'd better put them into one common place to manage conveniently.
>>> Here I also add VIRTIO_ID_RESERVE according to virtio spec.
>>>
>>> Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
>
> We really should just write a script to import the headers
> from the linux kernel.
> They will need some tweaks to avoid dependencies on
> linux/types, but this seems easy to do - better than
> trying to keep things in sync manually.
I prefer Cornelia's comment since actually we're trying to define a
little bit according to a spec, so the following may be enough?
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index f24997d..4afb0b7 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -23,6 +23,22 @@
#include "hw/virtio/virtio-9p.h"
#endif
+/* Refer to VirtIO Spec 1.0. */
+
+#define VIRTIO_ID_RESERVED 0 /* reserved (invalid)*/
+#define VIRTIO_ID_NET 1 /* network card */
+#define VIRTIO_ID_BLOCK 2 /* block device */
+#define VIRTIO_ID_CONSOLE 3 /* console */
+#define VIRTIO_ID_RNG 4 /* entropy source */
+#define VIRTIO_ID_BALLOON 5 /* memory ballooning */
+#define VIRTIO_ID_IOMEMORY 6 /* ioMemory */
+#define VIRTIO_ID_RPMSG 7 /* rpmsg */
+#define VIRTIO_ID_SCSI 8 /* SCSI host */
+#define VIRTIO_ID_9P 9 /* 9P transport */
+#define VIRTIO_ID_MAC80211_WALN 10 /* mac80211 wlan */
+#define VIRTIO_ID_RPROC_SERIAL 11 /* rproc seria */
+#define VIRTIO_ID_CAIF 12 /* virtio CAIF */
+
/* from Linux's linux/virtio_config.h */
/* Status byte for guest to report progress, and synchronize features. */
Thanks
Tiejun
next prev parent reply other threads:[~2015-02-09 7:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 5:41 [Qemu-devel] [v2][RFC][PATCH] virtio: uniform virtio device IDs Tiejun Chen
2015-02-06 12:14 ` Cornelia Huck
2015-02-08 10:48 ` Michael S. Tsirkin
2015-02-09 7:01 ` Chen, Tiejun [this message]
2015-02-09 7:02 ` Michael S. Tsirkin
2015-02-09 7:10 ` Chen, Tiejun
2015-02-09 8:47 ` Cornelia Huck
2015-02-11 12:41 ` Michael S. Tsirkin
2015-02-11 18:10 ` Cornelia Huck
2015-02-11 19:53 ` Michael S. Tsirkin
2015-02-09 6:56 ` Chen, Tiejun
2015-02-06 16:28 ` Stefan Hajnoczi
2015-02-09 6:58 ` Chen, Tiejun
2015-02-09 19:57 ` Michael S. Tsirkin
2015-02-11 11:55 ` Amit Shah
2015-02-11 12:37 ` Michael S. Tsirkin
2015-02-11 11:18 ` 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=54D85B3B.3040306@intel.com \
--to=tiejun.chen@intel.com \
--cc=agraf@suse.de \
--cc=aliguori@amazon.com \
--cc=amit.shah@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=mst@redhat.com \
--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).