[pve-devel] [PATCH] qemu 2.2.1: fix assert while resizing or hot plugging virtio scsi disks
Stefan Priebe
s.priebe at profihost.ag
Mon Mar 30 12:34:28 CEST 2015
Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
---
debian/patches/series | 1 +
debian/patches/virtio-scsi_fix_assert.patch | 45 +++++++++++++++++++++++++++
2 files changed, 46 insertions(+)
create mode 100644 debian/patches/virtio-scsi_fix_assert.patch
diff --git a/debian/patches/series b/debian/patches/series
index 7298a04..51b8c2f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -33,3 +33,4 @@ virtio-balloon-dimmfix1.patch
virtio-balloon-dimmfix2.patch
virtio-balloon-dimmfix3.patch
add-qmp-get-link-status.patch
+virtio-scsi_fix_assert.patch
diff --git a/debian/patches/virtio-scsi_fix_assert.patch b/debian/patches/virtio-scsi_fix_assert.patch
new file mode 100644
index 0000000..4e4ccce
--- /dev/null
+++ b/debian/patches/virtio-scsi_fix_assert.patch
@@ -0,0 +1,45 @@
+From 3ad2a905f10a4a9e7c7a385d64032a291eb6892b Mon Sep 17 00:00:00 2001
+From: Fam Zheng <famz at redhat.com>
+Date: Fri, 13 Mar 2015 15:55:54 +0800
+Subject: [PATCH] virtio-scsi: Fix assert in virtio_scsi_push_event
+
+Hotplugging a scsi-disk may trigger the assertion in qemu_sgl_concat.
+
+ qemu-system-x86_64: qemu/hw/scsi/virtio-scsi.c:115: qemu_sgl_concat:
+ Assertion `skip == 0' failed.
+
+This is introduced by commit 55783a55 (virtio-scsi: work around bug in
+old BIOSes) which didn't check out_num when accessing out_sg[0].iov_len
+(the same to in sg). For virtio_scsi_push_event, looking into out_sg
+doesn't make sense because 0 req_size is intended.
+
+Cc: qemu-stable at nongnu.org
+[Cc'ing qemu-stable because 55783a55 did it too]
+Signed-off-by: Fam Zheng <famz at redhat.com>
+Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
+---
+ hw/scsi/virtio-scsi.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
+index a44c410..810c377 100644
+--- a/hw/scsi/virtio-scsi.c
++++ b/hw/scsi/virtio-scsi.c
+@@ -145,8 +145,12 @@ static int virtio_scsi_parse_req(VirtIOSCSIReq *req,
+ * TODO: always disable this workaround for virtio 1.0 devices.
+ */
+ if ((vdev->guest_features & (1 << VIRTIO_F_ANY_LAYOUT)) == 0) {
+- req_size = req->elem.out_sg[0].iov_len;
+- resp_size = req->elem.in_sg[0].iov_len;
++ if (req->elem.out_num) {
++ req_size = req->elem.out_sg[0].iov_len;
++ }
++ if (req->elem.in_num) {
++ resp_size = req->elem.in_sg[0].iov_len;
++ }
+ }
+
+ out_size = qemu_sgl_concat(req, req->elem.out_sg,
+--
+1.7.10.4
+
--
1.7.10.4
More information about the pve-devel
mailing list