From 1c819449836b926d6f9db860127211ef092da88e Mon Sep 17 00:00:00 2001 From: KONRAD Frederic Date: Wed, 24 Apr 2013 10:21:21 +0200 Subject: virtio: remove virtiobindings. This remove virtio-bindings, and use class instead. Signed-off-by: KONRAD Frederic Message-id: 1366791683-5350-6-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori --- hw/net/vhost_net.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'hw/net/vhost_net.c') diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 8c5384cf76..006576db31 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -37,6 +37,7 @@ #include #include "hw/virtio/vhost.h" +#include "hw/virtio/virtio-bus.h" struct vhost_net { struct vhost_dev dev; @@ -211,9 +212,12 @@ static void vhost_net_stop_one(struct vhost_net *net, int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues) { + BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(dev))); + VirtioBusState *vbus = VIRTIO_BUS(qbus); + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus); int r, i = 0; - if (!dev->binding->set_guest_notifiers) { + if (!k->set_guest_notifiers) { error_report("binding does not support guest notifiers"); r = -ENOSYS; goto err; @@ -227,9 +231,7 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, } } - r = dev->binding->set_guest_notifiers(dev->binding_opaque, - total_queues * 2, - true); + r = k->set_guest_notifiers(qbus->parent, total_queues * 2, true); if (r < 0) { error_report("Error binding guest notifier: %d", -r); goto err; @@ -247,11 +249,12 @@ err: void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, int total_queues) { + BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(dev))); + VirtioBusState *vbus = VIRTIO_BUS(qbus); + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus); int i, r; - r = dev->binding->set_guest_notifiers(dev->binding_opaque, - total_queues * 2, - false); + r = k->set_guest_notifiers(qbus->parent, total_queues * 2, false); if (r < 0) { fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", r); fflush(stderr); -- cgit 1.4.1