diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-01-10 13:52:53 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-01-11 13:40:59 -0600 |
commit | 8172539d21a03e982aa7f139ddc1607dc1422045 (patch) | |
tree | 67ceb2ca2ea245060d9285623e26e3a42b3cdc1a /hw/virtio.h | |
parent | 704a76fcd24372a683652651b4597f6654084975 (diff) | |
download | qemu-8172539d21a03e982aa7f139ddc1607dc1422045.zip qemu-8172539d21a03e982aa7f139ddc1607dc1422045.tar.gz qemu-8172539d21a03e982aa7f139ddc1607dc1422045.tar.bz2 |
virtio: add features as qdev properties
Add feature bits as properties to virtio. This makes it possible to e.g. define
machine without indirect buffer support, which is required for 0.10
compatibility, or without hardware checksum support, which is required for 0.11
compatibility. Since default values for optional features are now set by qdev,
get_features callback has been modified: it sets non-optional bits, and clears
bits not supported by host.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio.h')
-rw-r--r-- | hw/virtio.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/virtio.h b/hw/virtio.h index 85ef171..3994cc9 100644 --- a/hw/virtio.h +++ b/hw/virtio.h @@ -105,7 +105,7 @@ struct VirtIODevice void *config; uint16_t config_vector; int nvectors; - uint32_t (*get_features)(VirtIODevice *vdev); + uint32_t (*get_features)(VirtIODevice *vdev, uint32_t requested_features); uint32_t (*bad_features)(VirtIODevice *vdev); void (*set_features)(VirtIODevice *vdev, uint32_t val); void (*get_config)(VirtIODevice *vdev, uint8_t *config); @@ -176,4 +176,9 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev); void virtio_net_exit(VirtIODevice *vdev); +#define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \ + DEFINE_PROP_BIT("indirect_desc", _state, _field, \ + VIRTIO_RING_F_INDIRECT_DESC, true) + + #endif |