From 91d5c57a2e98845c02cda026f3f6a88cb5e14225 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Fri, 12 Dec 2014 10:01:46 +0100 Subject: virtio: fix feature bit checks Several places check against the feature bit number instead of against the feature bit. Fix them. Cc: qemu-stable@nongnu.org Reported-by: Thomas Huth Signed-off-by: Cornelia Huck Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/scsi/virtio-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/scsi') diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index b06dd39..9e2c718 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -144,7 +144,7 @@ static int virtio_scsi_parse_req(VirtIOSCSIReq *req, * * TODO: always disable this workaround for virtio 1.0 devices. */ - if ((vdev->guest_features & VIRTIO_F_ANY_LAYOUT) == 0) { + if ((vdev->guest_features & (1 << VIRTIO_F_ANY_LAYOUT)) == 0) { req_size = req->elem.out_sg[0].iov_len; resp_size = req->elem.in_sg[0].iov_len; } -- cgit v1.1