Received: from eggs.gnu.org ([2001:4830:134:3::10]:36782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJhoZ-0006ot-3p for qemu-devel@nongnu.org; Fri, 06 Feb 2015 07:15:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJhoV-00072V-Jp for qemu-devel@nongnu.org; Fri, 06 Feb 2015 07:15:14 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:52386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJhoV-00072J-CA for qemu-devel@nongnu.org; Fri, 06 Feb 2015 07:15:11 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Feb 2015 12:15:09 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id AC0F21B0804B for ; Fri, 6 Feb 2015 12:15:15 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t16CF7VF3146140 for ; Fri, 6 Feb 2015 12:15:07 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t16CEwhL020500 for ; Fri, 6 Feb 2015 05:15:06 -0700 Date: Fri, 6 Feb 2015 13:14:46 +0100 From: Cornelia Huck Message-ID: <20150206131446.713805ed.cornelia.huck@de.ibm.com> In-Reply-To: <1423201286-16503-1-git-send-email-tiejun.chen@intel.com> References: <1423201286-16503-1-git-send-email-tiejun.chen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v2][RFC][PATCH] virtio: uniform virtio device IDs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tiejun Chen Cc: mst@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, aliguori@amazon.com, amit.shah@redhat.com On Fri, 6 Feb 2015 13:41:26 +0800 Tiejun Chen 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 > --- > hw/9pfs/virtio-9p.h | 2 -- > include/hw/virtio/virtio-balloon.h | 3 --- > include/hw/virtio/virtio-blk.h | 3 --- > include/hw/virtio/virtio-rng.h | 3 --- > include/hw/virtio/virtio-scsi.h | 3 --- > include/hw/virtio/virtio-serial.h | 3 --- > include/hw/virtio/virtio.h | 16 ++++++++++++++++ > pc-bios/s390-ccw/virtio.h | 8 +------- > 8 files changed, 17 insertions(+), 24 deletions(-) > > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > index f24997d..9ad6bb2 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 Linux's linux/virtio_ids.h */ Why not refer to the virtio spec instead? :) And maybe add in the ids that already have been reserved. > + > +enum virtio_dev_type { > + VIRTIO_ID_RESERVED = 0, /* invalid virtio device */ > + VIRTIO_ID_NET = 1, /* virtio net */ > + VIRTIO_ID_BLOCK = 2, /* virtio block */ > + VIRTIO_ID_CONSOLE = 3, /* virtio console */ > + VIRTIO_ID_RNG = 4, /* virtio rng */ > + VIRTIO_ID_BALLOON = 5, /* virtio balloon */ /* virtio balloon (legacy) */ > + VIRTIO_ID_RPMSG = 7, /* virtio remote processor messaging */ > + VIRTIO_ID_SCSI = 8, /* virtio scsi */ > + VIRTIO_ID_9P = 9, /* 9p virtio console */ > + VIRTIO_ID_RPROC_SERIAL = 11, /* virtio remoteproc serial link */ > + VIRTIO_ID_CAIF = 12, /* Virtio caif */ > +}; > + > /* from Linux's linux/virtio_config.h */ > > /* Status byte for guest to report progress, and synchronize features. */ > diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h > index c23466b..2eabcb4 100644 > --- a/pc-bios/s390-ccw/virtio.h > +++ b/pc-bios/s390-ccw/virtio.h > @@ -11,6 +11,7 @@ > #ifndef VIRTIO_H > #define VIRTIO_H > > +#include "hw/virtio/virtio.h" This won't work, the bios can't use the common headers. > #include "s390-ccw.h" > > /* Status byte for guest to report progress, and synchronize features. */ > @@ -23,13 +24,6 @@ > /* We've given up on this device. */ > #define VIRTIO_CONFIG_S_FAILED 0x80 > > -enum virtio_dev_type { > - VIRTIO_ID_NET = 1, > - VIRTIO_ID_BLOCK = 2, > - VIRTIO_ID_CONSOLE = 3, > - VIRTIO_ID_BALLOON = 5, > -}; Even though this one is incomplete; but we don't need anything but the block id anyway. > - > struct virtio_dev_header { > enum virtio_dev_type type : 8; > u8 num_vq;