Skip to contentSkip to conversation

virtio update

GIT PULL Michael S. Tsirkin 2 participants 3 messages May 13, 2014

lore
Share & tools
lore
#0 lore raw

The following changes since commit 06b4f00d53637f2c16a62c2cbaa30bffb045cf88:

Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging (2014-05-09 15:46:34 +0100)

are available in the git repository at:

git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git for_upstream

for you to fetch changes up to 937251408051e0489f78e4db3c92e045b147b38b:

virtio: allow mapping up to max queue size (2014-05-12 12:07:21 +0300)

----------------------------------------------------------------
virtio update

looks like a quiet week
minor bugfix in virtio by myself

----------------------------------------------------------------
Michael S. Tsirkin (1):
virtio: allow mapping up to max queue size

 hw/virtio/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#1 lore raw

[Qemu-devel] [PULL] virtio: allow mapping up to max queue size

It's a loop from i < num_sg and the array is VIRTQUEUE_MAX_SIZE - so it's OK if the value read is VIRTQUEUE_MAX_SIZE.

Not a big problem in practice as people don't use
such big queues, but it's inelegant.

---
 hw/virtio/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio.c +1 -1
index 7f4e7ec..3557c17 100644
@@ -430,7 +430,7 @@ void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
     unsigned int i;
     hwaddr len;
 
-    if (num_sg >= VIRTQUEUE_MAX_SIZE) {
+    if (num_sg > VIRTQUEUE_MAX_SIZE) {
         error_report("virtio: map attempt out of bounds: %zd > %d",
                      num_sg, VIRTQUEUE_MAX_SIZE);
         exit(1);
Signature · 1 line
MST
#2 lore raw

Re: [Qemu-devel] [PULL] virtio: allow mapping up to max queue size

Quoted 18 lines · Michael S. Tsirkin

It's a loop from i < num_sg and the array is VIRTQUEUE_MAX_SIZE - so it's OK if the value read is VIRTQUEUE_MAX_SIZE.

Not a big problem in practice as people don't use
such big queues, but it's inelegant.

---
 hw/virtio/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio.c +0 -0
index 7f4e7ec..3557c17 100644

hw/virtio/virtio.c void virtqueue_map_sg(struct iovec *sg, hwaddr *addr, · line 436

Quoted 8 lines
hw/virtio/virtio.c +1 -1
@@ -430,7 +430,7 @@ void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
     unsigned int i;
     hwaddr len;
 
-    if (num_sg >= VIRTQUEUE_MAX_SIZE) {
+    if (num_sg > VIRTQUEUE_MAX_SIZE) {
         error_report("virtio: map attempt out of bounds: %zd > %d",
                      num_sg, VIRTQUEUE_MAX_SIZE);
         exit(1);

ACK

Thanks,
Marcel