[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 33/43] virtio: fix feature bit checks
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 33/43] virtio: fix feature bit checks |
Date: |
Tue, 24 Feb 2015 15:48:08 -0600 |
From: Cornelia Huck <address@hidden>
Several places check against the feature bit number instead of against
the feature bit. Fix them.
Cc: address@hidden
Reported-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>
(cherry picked from commit 91d5c57a2e98845c02cda026f3f6a88cb5e14225)
Signed-off-by: Michael Roth <address@hidden>
---
hw/scsi/virtio-scsi.c | 2 +-
hw/virtio/dataplane/vring.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index ef48550..a44c410 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;
}
diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index 61f6d83..78c6f45 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -133,12 +133,12 @@ bool vring_should_notify(VirtIODevice *vdev, Vring *vring)
* interrupts. */
smp_mb();
- if ((vdev->guest_features & VIRTIO_F_NOTIFY_ON_EMPTY) &&
+ if ((vdev->guest_features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) &&
unlikely(vring->vr.avail->idx == vring->last_avail_idx)) {
return true;
}
- if (!(vdev->guest_features & VIRTIO_RING_F_EVENT_IDX)) {
+ if (!(vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX))) {
return !(vring->vr.avail->flags & VRING_AVAIL_F_NO_INTERRUPT);
}
old = vring->signalled_used;
--
1.9.1
- [Qemu-devel] [PATCH 24/43] PPC: Fix crash on spapr_tce_table_finalize(), (continued)
- [Qemu-devel] [PATCH 24/43] PPC: Fix crash on spapr_tce_table_finalize(), Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 21/43] target-xtensa: test cross-page opcode, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 26/43] serial: reset thri_pending on IER writes with THRI=0, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 23/43] atomic: fix position of volatile qualifier, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 22/43] migration/block: fix pending() return value, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 15/43] qcow2: Fix header extension size check, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 20/43] target-xtensa: fix translation for opcodes crossing page boundary, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 29/43] linux-user: Fix broken m68k signal handling on 64 bit hosts, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 27/43] serial: refine serial_thr_ipending_needed, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 28/43] pckbd: set bits 2-3-6-7 of the output port by default, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 33/43] virtio: fix feature bit checks,
Michael Roth <=
- [Qemu-devel] [PATCH 32/43] vt82c686: avoid out-of-bounds read, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 31/43] target-i386: fix movntsd on big-endian hosts, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 30/43] scsi: fix cancellation when I/O was completed but DMA was not., Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 02/43] block: Omit bdrv_find_format for essential drivers, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 36/43] target-arm/translate-a64: Fix wrong mmu_idx usage for LDT/STT, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 34/43] sb16: fix interrupt acknowledgement, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 35/43] hw/input/hid.c Fix capslock hid code, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 39/43] libcacard: stop linking against every single 3rd party library, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 37/43] vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 38/43] qemu-thread: fix qemu_event without futexes, Michael Roth, 2015/02/24