[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 10/38] virtio: virtqueue_get_avail_bytes: fix desc_
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 10/38] virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over the indirect descriptor table |
Date: |
Wed, 25 Sep 2013 07:57:38 -0500 |
From: yinyin <address@hidden>
virtqueue_get_avail_bytes: when found a indirect desc, we need loop over it.
/* loop over the indirect descriptor table */
indirect = 1;
max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc);
num_bufs = i = 0;
desc_pa = vring_desc_addr(desc_pa, i);
But, It init i to 0, then use i to update desc_pa. so we will always get:
desc_pa = vring_desc_addr(desc_pa, 0);
the last two line should swap.
Cc: address@hidden
Signed-off-by: Yin Yin <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit 1ae2757c6c4525c9b42f408c86818f843bad7418)
Signed-off-by: Michael Roth <address@hidden>
---
hw/virtio/virtio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index f03c45d..2f1e73b 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -377,8 +377,8 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int
*in_bytes,
/* loop over the indirect descriptor table */
indirect = 1;
max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc);
- num_bufs = i = 0;
desc_pa = vring_desc_addr(desc_pa, i);
+ num_bufs = i = 0;
}
do {
--
1.7.9.5
- [Qemu-stable] Patch Round-up for stable 1.6.1, freeze on 2013-09-30, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 03/38] target-ppc: fix bit extraction for FPBF and FPL, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 02/38] gdbstub: Fix gdb_register_coprocessor() register counting, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 01/38] block: ensure bdrv_drain_all() works during bdrv_delete(), Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 06/38] usb/dev-hid: Modified usb-tablet category from Misc to Input, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 05/38] scripts/qapi.py: Avoid syntax not supported by Python 2.4, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 04/38] rdma: silly ipv6 bugfix, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 07/38] scsi: Fix scsi_bus_legacy_add_drive() scsi-generic with serial, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 09/38] pseries: Fix stalls on hypervisor virtual console, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 10/38] virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over the indirect descriptor table,
Michael Roth <=
- [Qemu-stable] [PATCH 08/38] pc: fix regression for 64 bit PCI memory, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 11/38] xhci: fix endpoint interval calculation, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 15/38] adlib: sort offsets in portio registration, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 14/38] target-i386: fix disassembly with PAE=1, PG=0, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 13/38] block: expect errors from bdrv_co_is_allocated, Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 12/38] Revert "usb-hub: report status changes only once", Michael Roth, 2013/09/25
- [Qemu-stable] [PATCH 16/38] exec: fix writing to MMIO area with non-power-of-two length, Michael Roth, 2013/09/25