diff options
author | KONRAD Frederic | 2013-04-24 10:21:21 +0200 |
---|---|---|
committer | Anthony Liguori | 2013-04-24 18:50:20 +0200 |
commit | 1c819449836b926d6f9db860127211ef092da88e (patch) | |
tree | 944df847df34b0e3603a9caa58c3f789784f253b /hw/scsi/vhost-scsi.c | |
parent | virtio: remove the function pointer. (diff) | |
download | qemu-1c819449836b926d6f9db860127211ef092da88e.tar.gz qemu-1c819449836b926d6f9db860127211ef092da88e.tar.xz qemu-1c819449836b926d6f9db860127211ef092da88e.zip |
virtio: remove virtiobindings.
This remove virtio-bindings, and use class instead.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366791683-5350-6-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi/vhost-scsi.c')
-rw-r--r-- | hw/scsi/vhost-scsi.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 3c93172e83..d7a1c33183 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -22,6 +22,7 @@ #include "hw/virtio/vhost-scsi.h" #include "hw/virtio/vhost.h" #include "hw/virtio/virtio-scsi.h" +#include "hw/virtio/virtio-bus.h" static int vhost_scsi_set_endpoint(VHostSCSI *s) { @@ -52,8 +53,10 @@ static int vhost_scsi_start(VHostSCSI *s) { int ret, abi_version, i; VirtIODevice *vdev = VIRTIO_DEVICE(s); + BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); - if (!vdev->binding->set_guest_notifiers) { + if (!k->set_guest_notifiers) { error_report("binding does not support guest notifiers"); return -ENOSYS; } @@ -88,7 +91,7 @@ static int vhost_scsi_start(VHostSCSI *s) goto err_vhost_stop; } - ret = vdev->binding->set_guest_notifiers(vdev->binding_opaque, s->dev.nvqs, true); + ret = k->set_guest_notifiers(qbus->parent, s->dev.nvqs, true); if (ret < 0) { error_report("Error binding guest notifier"); goto err_endpoint; @@ -116,11 +119,12 @@ err_notifiers: static void vhost_scsi_stop(VHostSCSI *s) { VirtIODevice *vdev = VIRTIO_DEVICE(s); + BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); int ret = 0; - if (!vdev->binding->set_guest_notifiers) { - ret = vdev->binding->set_guest_notifiers(vdev->binding_opaque, - s->dev.nvqs, false); + if (!k->set_guest_notifiers) { + ret = k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false); if (ret < 0) { error_report("vhost guest notifier cleanup failed: %d\n", ret); } |