diff options
author | KONRAD Frederic <fred.konrad@greensocs.com> | 2013-04-24 10:21:21 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-24 11:50:20 -0500 |
commit | 1c819449836b926d6f9db860127211ef092da88e (patch) | |
tree | 944df847df34b0e3603a9caa58c3f789784f253b /hw/net/vhost_net.c | |
parent | 181103cd52710b987799ae980bb92407994243bc (diff) |
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/net/vhost_net.c')
-rw-r--r-- | hw/net/vhost_net.c | 17 |
1 files changed, 10 insertions, 7 deletions
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 <stdio.h> #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); |