aboutsummaryrefslogtreecommitdiffstats
path: root/tools/virtio/virtio_test.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-07 16:39:42 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 12:05:23 +0200
commite16e12be34648777606a2c03a3526409b38f0e63 (patch)
tree36298911ba8eed0a4805c2c30a56d92520d23432 /tools/virtio/virtio_test.c
parentvirtio: add low-level APIs for feature bits (diff)
downloadlinux-dev-e16e12be34648777606a2c03a3526409b38f0e63.tar.xz
linux-dev-e16e12be34648777606a2c03a3526409b38f0e63.zip
virtio: use u32, not bitmap for features
It seemed like a good idea to use bitmap for features in struct virtio_device, but it's actually a pain, and seems to become even more painful when we get more than 32 feature bits. Just change it to a u32 for now. Based on patch by Rusty. Suggested-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'tools/virtio/virtio_test.c')
-rw-r--r--tools/virtio/virtio_test.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index 00ea679b3826..db3437c641a6 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -60,7 +60,7 @@ void vhost_vq_setup(struct vdev_info *dev, struct vq_info *info)
{
struct vhost_vring_state state = { .index = info->idx };
struct vhost_vring_file file = { .index = info->idx };
- unsigned long long features = dev->vdev.features[0];
+ unsigned long long features = dev->vdev.features;
struct vhost_vring_addr addr = {
.index = info->idx,
.desc_user_addr = (uint64_t)(unsigned long)info->vring.desc,
@@ -113,8 +113,7 @@ static void vdev_info_init(struct vdev_info* dev, unsigned long long features)
{
int r;
memset(dev, 0, sizeof *dev);
- dev->vdev.features[0] = features;
- dev->vdev.features[1] = features >> 32;
+ dev->vdev.features = features;
dev->buf_size = 1024;
dev->buf = malloc(dev->buf_size);
assert(dev->buf);