[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCHv3 04/12] virtio: add notifier support
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCHv3 04/12] virtio: add notifier support |
Date: |
Tue, 2 Mar 2010 20:43:39 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
Add binding API to set host/guest notifiers.
Will be used by vhost.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
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;
+ }
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
--
1.7.0.18.g0d53a5
- [Qemu-devel] [PATCHv3 00/12] vhost-net: upstream integration, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 01/12] tap: add interface to get device fd, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 02/12] kvm: add API to set ioeventfd, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 03/12] notifier: event notifier implementation, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 04/12] virtio: add notifier support,
Michael S. Tsirkin <=
- [Qemu-devel] [PATCHv3 05/12] virtio: add APIs for queue fields, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 06/12] virtio: add set_status callback, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 07/12] virtio: move typedef to qemu-common, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 08/12] virtio-pci: fill in notifier support, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 09/12] vhost: vhost net support, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 10/12] tap: add vhost/vhostfd options, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 12/12] virtio-net: vhost net support, Michael S. Tsirkin, 2010/03/02
- [Qemu-devel] [PATCHv3 11/12] tap: add API to retrieve vhost net header, Michael S. Tsirkin, 2010/03/02