[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 48/96] virtio: cull virtio_bus_set_vdev_features
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 48/96] virtio: cull virtio_bus_set_vdev_features |
Date: |
Wed, 18 Feb 2015 22:48:46 +0100 |
From: Cornelia Huck <address@hidden>
The only user of this function was virtio-ccw, and it should use
virtio_set_features() like everybody else: We need to make sure
that bad features are masked out properly, which this function did
not do.
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/virtio/virtio-bus.h | 3 ---
hw/s390x/virtio-ccw.c | 3 +--
hw/virtio/virtio-bus.c | 14 --------------
3 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
index 0756545..0d2e7b4 100644
--- a/include/hw/virtio/virtio-bus.h
+++ b/include/hw/virtio/virtio-bus.h
@@ -84,9 +84,6 @@ size_t virtio_bus_get_vdev_config_len(VirtioBusState *bus);
/* Get the features of the plugged device. */
uint32_t virtio_bus_get_vdev_features(VirtioBusState *bus,
uint32_t requested_features);
-/* Set the features of the plugged device. */
-void virtio_bus_set_vdev_features(VirtioBusState *bus,
- uint32_t requested_features);
/* Get bad features of the plugged device. */
uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus);
/* Get config of the plugged device. */
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index ea236c9..84f17bc 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -400,8 +400,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
ccw.cda + sizeof(features.features));
features.features = ldl_le_phys(&address_space_memory, ccw.cda);
if (features.index < ARRAY_SIZE(dev->host_features)) {
- virtio_bus_set_vdev_features(&dev->bus, features.features);
- vdev->guest_features = features.features;
+ virtio_set_features(vdev, features.features);
} else {
/*
* If the guest supports more feature bits, assert that it
diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c
index dfd2d8c..be886e7 100644
--- a/hw/virtio/virtio-bus.c
+++ b/hw/virtio/virtio-bus.c
@@ -109,20 +109,6 @@ uint32_t virtio_bus_get_vdev_features(VirtioBusState *bus,
return k->get_features(vdev, requested_features);
}
-/* Set the features of the plugged device. */
-void virtio_bus_set_vdev_features(VirtioBusState *bus,
- uint32_t requested_features)
-{
- VirtIODevice *vdev = virtio_bus_get_device(bus);
- VirtioDeviceClass *k;
-
- assert(vdev != NULL);
- k = VIRTIO_DEVICE_GET_CLASS(vdev);
- if (k->set_features != NULL) {
- k->set_features(vdev, requested_features);
- }
-}
-
/* Get bad features of the plugged device. */
uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus)
{
--
MST
- [Qemu-devel] [PULL 40/96] virtio-scsi: use standard-headers, (continued)
- [Qemu-devel] [PULL 40/96] virtio-scsi: use standard-headers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 41/96] virtio-serial: switch to standard-headers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 42/96] update-linux-headers: use standard-headers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 43/96] linux-headers: use standard-headers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 44/96] virtio-pci: use standard headers, Michael S. Tsirkin, 2015/02/18
- Re: [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 45/96] scripts: add arch specific standard-headers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 46/96] standard-headers: add s390 virtio headers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 47/96] s390: use standard headers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 48/96] virtio: cull virtio_bus_set_vdev_features,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 49/96] virtio: feature bit manipulation helpers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 50/96] virtio: add feature checking helpers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 51/96] acpi-build: skip hotplugged bridges, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 52/96] pc: acpi: use local var for accessing ACPI tables blob in acpi_build(), Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 53/96] update-linux-headers.sh: s/__inline__/inline/, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 54/96] virtio-serial-bus.c: drop virtio_ids.h, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 55/96] standard-headers: include stdint.h, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 56/96] virtio_ring.h: s/__inline__/inline/, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 57/96] acpi: introduce AML composer aml_append(), Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 58/96] acpi: add aml_scope() term, Michael S. Tsirkin, 2015/02/18