From 326d532cd597f883f779710dff6870ee5a547770 Mon Sep 17 00:00:00 2001 Message-Id: <326d532cd597f883f779710dff6870ee5a547770.1346840133.git.minovotn@redhat.com> In-Reply-To: <2a711d63f161f5fa916f886f6b7b78ff366f9d0c.1346840133.git.minovotn@redhat.com> References: <2a711d63f161f5fa916f886f6b7b78ff366f9d0c.1346840133.git.minovotn@redhat.com> From: Kevin Wolf <kwolf@redhat.com> Date: Thu, 30 Aug 2012 14:21:12 +0200 Subject: [PATCH 2/4] virtio-blk: fix the list operation in virtio_blk_load(). RH-Author: Kevin Wolf <kwolf@redhat.com> Message-id: <1346336473-10384-3-git-send-email-kwolf@redhat.com> Patchwork-id: 41515 O-Subject: [RHEL-5.9 KVM PATCH 2/3] virtio-blk: fix the list operation in virtio_blk_load(). Bugzilla: 684745 RH-Acked-by: Michael S. Tsirkin <mst@redhat.com> RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com> RH-Acked-by: Asias He <asias@redhat.com> From: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Bugzilla: 684745 Upstream commit: 20a81e4d Although it is really rare to get in to the while loop, the list operation in the loop is obviously wrong. Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- qemu/hw/virtio-blk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Signed-off-by: Michal Novotny <minovotn@redhat.com> --- qemu/hw/virtio-blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/hw/virtio-blk.c b/qemu/hw/virtio-blk.c index 3e1ffd9..878d488 100644 --- a/qemu/hw/virtio-blk.c +++ b/qemu/hw/virtio-blk.c @@ -372,7 +372,7 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id) VirtIOBlockReq *req = virtio_blk_alloc_request(s); qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem)); req->next = s->rq; - s->rq = req->next; + s->rq = req; } if (version_id > 2) { qemu_get_8s(f, &write_cache); -- 1.7.11.4