]> xenbits.xensource.com Git - qemu-xen-4.6-testing.git/commitdiff
virtio-blk: correctly link new request in virtio_blk_load()
authorYunlei Ding <yunlei.ding@citrix.com>
Tue, 11 Mar 2014 09:49:59 +0000 (09:49 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Oct 2015 15:52:07 +0000 (16:52 +0100)
s->rq should be set with req instead of req-next.

Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
Coverity-ID: 1055910
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
hw/virtio-blk.c

index fcf893a6957cfa6b99d25bcadfdbce5501d4b1f3..f3a81e34503146822a59fe8ff6b5b70a9d8740ff 100644 (file)
@@ -288,7 +288,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;
     }
 
     return 0;