Re: [ kvm-Bugs-2941282 ] Ubuntu 10.04 installer fails due to I/O errors with virtio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Initial Comment:
> I tried installing Ubuntu 10.04 and Fedora 12 in a KVM virtual machine using virtio, on a 8G raw file-backed disk. Both installers failed half-way due to I/O errors. So I tried reproducing it and managed to repeat it 6 times. The bug doesn't occur with IDE emulation. The bug happens fairly quickly with -smp 4 -- usually within 5 minutes -- but is much rarer with -smp 1.
> 
> Ubuntu installer has kernel 2.6.32-11-generic
> Fedora 12 has kernel 2.6.31.5-127.fc12.x86_64
> Host has kernel 2.6.32.6 (Arch Linux) and QEMU 0.12.2

Can you check if the patch below fixes it?

---

From: Christoph Hellwig <hch@xxxxxx>
Subject: [PATCH v2] block: avoid creating too large iovecs in multiwrite_merge

If we go over the maximum number of iovecs support by syscall we get
back EINVAL from the kernel which translate to I/O errors for the guest.

Add a MAX_IOV defintion for platforms that don't have it.  For now we use
the same 1024 define that's used on Linux and various other platforms,
but until the windows block backend implements some kind of vectored I/O
it doesn't matter.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: qemu/block.c
===================================================================
--- qemu.orig/block.c	2010-01-26 10:59:39.757004445 +0100
+++ qemu/block.c	2010-01-26 11:01:38.056023231 +0100
@@ -1689,6 +1689,10 @@ static int multiwrite_merge(BlockDriverS
             merge = bs->drv->bdrv_merge_requests(bs, &reqs[outidx], &reqs[i]);
         }
 
+        if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1 > IOV_MAX) {
+            merge = 0;
+        }
+
         if (merge) {
             size_t size;
             QEMUIOVector *qiov = qemu_mallocz(sizeof(*qiov));
Index: qemu/qemu-common.h
===================================================================
--- qemu.orig/qemu-common.h	2010-01-26 14:41:40.894254285 +0100
+++ qemu/qemu-common.h	2010-01-26 14:42:27.267275698 +0100
@@ -54,6 +54,10 @@ struct iovec {
     void *iov_base;
     size_t iov_len;
 };
+/*
+ * Use the same value as Linux for now.
+ */
+#define IOV_MAX		1024
 #else
 #include <sys/uio.h>
 #endif
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux