mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
virtio: feature bit manipulation helpers
Add virtio_{add,clear}_feature helper functions for manipulating a feature bits variable. This has some benefits over open coding: - add check that the bit is in a sane range - make it obvious at a glance what is going on - have a central point to change when we want to extend feature bits Convert existing code manipulating features to use the new helpers. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
a590fd5ba8
commit
0cd09c3a6c
8 changed files with 44 additions and 32 deletions
|
@ -743,8 +743,8 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev)
|
|||
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;
|
||||
virtio_add_feature(&dev->host_features[0], VIRTIO_F_NOTIFY_ON_EMPTY);
|
||||
virtio_add_feature(&dev->host_features[0], VIRTIO_F_BAD_FEATURE);
|
||||
|
||||
css_generate_sch_crws(sch->cssid, sch->ssid, sch->schid,
|
||||
parent->hotplugged, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue