aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/virtio-ccw.c
diff options
context:
space:
mode:
authorKONRAD Frederic <fred.konrad@greensocs.com>2013-04-24 10:21:20 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-24 11:50:20 -0500
commit181103cd52710b987799ae980bb92407994243bc (patch)
tree9442542631a8ef1920719cfaddebad25a7d17c0a /hw/s390x/virtio-ccw.c
parenta2f1078b70b6cfc98ed795f17f9d975b1dec1f65 (diff)
virtio: remove the function pointer.
This remove the function pointer in VirtIODevice, and use only VirtioDeviceClass function pointer. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Message-id: 1366791683-5350-5-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/s390x/virtio-ccw.c')
-rw-r--r--hw/s390x/virtio-ccw.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 0591dc2fb0..e14351cc4e 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -235,9 +235,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
features.index = ldub_phys(ccw.cda + sizeof(features.features));
features.features = ldl_le_phys(ccw.cda);
if (features.index < ARRAY_SIZE(dev->host_features)) {
- if (dev->vdev->set_features) {
- dev->vdev->set_features(dev->vdev, features.features);
- }
+ virtio_bus_set_vdev_features(&dev->bus, features.features);
dev->vdev->guest_features = features.features;
} else {
/*
@@ -265,7 +263,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
if (!ccw.cda) {
ret = -EFAULT;
} else {
- dev->vdev->get_config(dev->vdev, dev->vdev->config);
+ virtio_bus_get_vdev_config(&dev->bus, dev->vdev->config);
/* XXX config space endianness */
cpu_physical_memory_write(ccw.cda, dev->vdev->config, len);
sch->curr_status.scsw.count = ccw.count - len;
@@ -292,9 +290,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
/* XXX config space endianness */
memcpy(dev->vdev->config, config, len);
cpu_physical_memory_unmap(config, hw_len, 0, hw_len);
- if (dev->vdev->set_config) {
- dev->vdev->set_config(dev->vdev, dev->vdev->config);
- }
+ virtio_bus_set_vdev_config(&dev->bus, dev->vdev->config);
sch->curr_status.scsw.count = ccw.count - len;
ret = 0;
}
@@ -527,7 +523,9 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev)
virtio_bind_device(vdev, &virtio_ccw_bindings, DEVICE(dev));
/* Only the first 32 feature bits are used. */
- dev->host_features[0] = vdev->get_features(vdev, dev->host_features[0]);
+ dev->host_features[0] = virtio_bus_get_vdev_features(&dev->bus,
+ dev->host_features[0]);
+
dev->host_features[0] |= 0x1 << VIRTIO_F_NOTIFY_ON_EMPTY;
dev->host_features[0] |= 0x1 << VIRTIO_F_BAD_FEATURE;