|
|
9ae3a8 |
From c732ec0ec457f0cb003b3b1db56c0bd96432baac Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
Date: Mon, 3 Aug 2015 16:51:19 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 05/13] virtio-scsi: use virtqueue_map_sg() when loading
|
|
|
9ae3a8 |
requests
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1438620680-24121-2-git-send-email-stefanha@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 67255
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.2 qemu-kvm PATCH 1/2] virtio-scsi: use virtqueue_map_sg() when loading requests
|
|
|
9ae3a8 |
Bugzilla: 1249718
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
The VirtQueueElement struct is serialized during migration but the
|
|
|
9ae3a8 |
in_sg[]/out_sg[] iovec arrays are not usable on the destination host
|
|
|
9ae3a8 |
because the pointers are meaningless.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Use virtqueue_map_sg() to refresh in_sg[]/out_sg[] to valid pointers
|
|
|
9ae3a8 |
based on in_addr[]/out_addr[] hwaddrs.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Cc: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
Message-Id: <1438262173-11546-2-git-send-email-stefanha@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 1cc933453bf2baae1feb7c8e757bdfd0ef639002)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conficts:
|
|
|
9ae3a8 |
* Context conflict because upstream has error handling code for
|
|
|
9ae3a8 |
virtio_scsi_parse_req().
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/scsi/virtio-scsi.c | 6 ++++++
|
|
|
9ae3a8 |
1 file changed, 6 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
|
|
|
9ae3a8 |
index cda8f8a..8232fc9 100644
|
|
|
9ae3a8 |
--- a/hw/scsi/virtio-scsi.c
|
|
|
9ae3a8 |
+++ b/hw/scsi/virtio-scsi.c
|
|
|
9ae3a8 |
@@ -154,6 +154,12 @@ static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
|
|
|
9ae3a8 |
#endif
|
|
|
9ae3a8 |
assert(req->elem.in_num <= ARRAY_SIZE(req->elem.in_sg));
|
|
|
9ae3a8 |
assert(req->elem.out_num <= ARRAY_SIZE(req->elem.out_sg));
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ virtqueue_map_sg(req->elem.in_sg, req->elem.in_addr,
|
|
|
9ae3a8 |
+ req->elem.in_num, 1);
|
|
|
9ae3a8 |
+ virtqueue_map_sg(req->elem.out_sg, req->elem.out_addr,
|
|
|
9ae3a8 |
+ req->elem.out_num, 0);
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
virtio_scsi_parse_req(s, vs->cmd_vqs[n], req);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
scsi_req_ref(sreq);
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|