From: Michael S. Tsirkin Date: Mon, 24 Sep 2012 13:09:30 +0000 (+0200) Subject: virtio: don't mark unaccessed memory as dirty X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0cea71a207508c2b8f563b2644ac46009832c8f4;p=qemu.git virtio: don't mark unaccessed memory as dirty offset of accessed buffer is calculated using iov_length, so it can exceed accessed len. If that happens math in len - offset wraps around, and size becomes wrong. As real value is 0, so this is harmless but unnecessary. Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/virtio.c b/hw/virtio.c index 209c763751..b5764bb8f7 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -241,7 +241,7 @@ void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem, elem->in_sg[i].iov_len, 1, size); - offset += elem->in_sg[i].iov_len; + offset += size; } for (i = 0; i < elem->out_num; i++)