[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] vhost: add set_vhost_endpoint and clear_vhost_e
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 2/4] vhost: add set_vhost_endpoint and clear_vhost_endpoint callbacks |
Date: |
Wed, 30 Jan 2013 17:41:24 +0100 |
Needed for vhost-scsi, see previous commit.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/vhost.c | 9 +++++++++
hw/virtio.h | 2 ++
2 files changed, 11 insertions(+)
diff --git a/hw/vhost.c b/hw/vhost.c
index edb6b08..09fa4e1 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -985,6 +985,12 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice
*vdev)
goto fail_vq;
}
}
+ if (vdev->set_vhost_endpoint) {
+ r = vdev->set_vhost_endpoint(vdev);
+ if (r < 0) {
+ goto fail_vq;
+ }
+ }
for (j = 0; j < hdev->nvqs; ++j) {
r = vhost_virtqueue_start(hdev,
@@ -1051,6 +1057,9 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice
*vdev)
}
assert (r >= 0);
+ if (vdev->clear_vhost_endpoint) {
+ vdev->clear_vhost_endpoint(vdev);
+ }
hdev->started = false;
g_free(hdev->log);
hdev->log = NULL;
diff --git a/hw/virtio.h b/hw/virtio.h
index 9cc7b85..dd37d59 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -134,6 +134,8 @@ struct VirtIODevice
*/
uint32_t (*get_features)(VirtIODevice *vdev, uint32_t requested_features);
uint32_t (*bad_features)(VirtIODevice *vdev);
+ int (*set_vhost_endpoint)(VirtIODevice *vdev);
+ void (*clear_vhost_endpoint)(VirtIODevice *vdev);
void (*set_features)(VirtIODevice *vdev, uint32_t val);
void (*get_config)(VirtIODevice *vdev, uint8_t *config);
void (*set_config)(VirtIODevice *vdev, const uint8_t *config);
--
1.8.1
- [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Paolo Bonzini, 2013/01/30
- [Qemu-devel] [PATCH 1/4] vhost: do VHOST_SET_VRING_KICK after setting up all vrings, Paolo Bonzini, 2013/01/30
- [Qemu-devel] [PATCH 2/4] vhost: add set_vhost_endpoint and clear_vhost_endpoint callbacks,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 3/4] virtio-scsi: create VirtIOSCSICommon, Paolo Bonzini, 2013/01/30
- [Qemu-devel] [PATCH 4/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Paolo Bonzini, 2013/01/30
- Re: [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Michael S. Tsirkin, 2013/01/30
- Re: [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Nicholas A. Bellinger, 2013/01/31
- Re: [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Michael S. Tsirkin, 2013/01/31