From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NnWIK-0001Mn-GH for qemu-devel@nongnu.org; Fri, 05 Mar 2010 07:06:16 -0500 Received: from [199.232.76.173] (port=58407 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnWIJ-0001Me-Sj for qemu-devel@nongnu.org; Fri, 05 Mar 2010 07:06:15 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NnWII-0001GO-3V for qemu-devel@nongnu.org; Fri, 05 Mar 2010 07:06:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43602) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NnWIH-0001GC-Nq for qemu-devel@nongnu.org; Fri, 05 Mar 2010 07:06:14 -0500 Date: Fri, 5 Mar 2010 17:34:50 +0530 From: Amit Shah Message-ID: <20100305120450.GB22141@amit-x200.redhat.com> References: <4312fc341affde984a9df650ca1e26cadeb8ca93.1267636215.git.mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4312fc341affde984a9df650ca1e26cadeb8ca93.1267636215.git.mst@redhat.com> Subject: [Qemu-devel] Re: [PATCHv4 04/12] virtio: add notifier support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: quintela@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com On (Wed) Mar 03 2010 [19:16:04], Michael S. Tsirkin wrote: > Add binding API to set host/guest notifiers. > Will be used by vhost. I've already mentioned this on IRC, but I'll put it here too, for tracking. > > Signed-off-by: Michael S. Tsirkin > --- > hw/virtio.c | 5 ++++- > hw/virtio.h | 3 +++ > 2 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/hw/virtio.c b/hw/virtio.c > index 7c020a3..1f5e7be 100644 > --- a/hw/virtio.c > +++ b/hw/virtio.c > @@ -73,6 +73,7 @@ struct VirtQueue > int inuse; > uint16_t vector; > void (*handle_output)(VirtIODevice *vdev, VirtQueue *vq); > + VirtIODevice *vdev; > }; > > /* virt queue functions */ > @@ -714,8 +715,10 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, > vdev->queue_sel = 0; > vdev->config_vector = VIRTIO_NO_VECTOR; > vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI_QUEUE_MAX); > - for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++) > + for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++) { > vdev->vq[i].vector = VIRTIO_NO_VECTOR; > + vdev->vq[i].vdev = vdev; > + } These two hunks don't belong to this patchset (and are not part of the commit description too..) > > vdev->name = name; > vdev->config_len = config_size; > diff --git a/hw/virtio.h b/hw/virtio.h > index 3baa2a3..af87889 100644 > --- a/hw/virtio.h > +++ b/hw/virtio.h > @@ -19,6 +19,7 @@ > #include "qdev.h" > #include "sysemu.h" > #include "block_int.h" > +#include "notifier.h" > > /* from Linux's linux/virtio_config.h */ > > @@ -89,6 +90,8 @@ typedef struct { > int (*load_config)(void * opaque, QEMUFile *f); > int (*load_queue)(void * opaque, int n, QEMUFile *f); > unsigned (*get_features)(void * opaque); > + int (*guest_notifier)(void * opaque, int n, bool assigned); > + int (*host_notifier)(void * opaque, int n, bool assigned); > } VirtIOBindings; > > #define VIRTIO_PCI_QUEUE_MAX 64 And I think this whole patch could be merged with the next one. Amit