[arch-commits] Commit in qemu-kvm/trunk (2 files)

Thomas Bächler thomas at archlinux.org
Sun Apr 11 11:29:25 UTC 2010


    Date: Sunday, April 11, 2010 @ 07:29:25
  Author: thomas
Revision: 77164

Fix a problem with virtio-blk where lots of I/O errors occur (easily reproducible by running pacman -Syy)

Added:
  qemu-kvm/trunk/block-avoid-creating-too-large-iovecs-in-multiwrite_merge.diff
Modified:
  qemu-kvm/trunk/PKGBUILD

----------------------------------------------------------------+
 PKGBUILD                                                       |    9 +
 block-avoid-creating-too-large-iovecs-in-multiwrite_merge.diff |   49 ++++++++++
 2 files changed, 55 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-04-11 11:22:39 UTC (rev 77163)
+++ PKGBUILD	2010-04-11 11:29:25 UTC (rev 77164)
@@ -2,7 +2,7 @@
 # Maintainer: Tobias Powalowski <tpowa at archlinux.org>
 pkgname=qemu-kvm
 pkgver=0.12.3
-pkgrel=1
+pkgrel=2
 pkgdesc="Latest KVM QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation."
 arch=(i686 x86_64)
 license=('GPL2' 'LGPL2.1')
@@ -14,11 +14,13 @@
 provides=('qemu')
 replaces=('kvm')
 source=(http://downloads.sourceforge.net/kvm/${pkgname}-${pkgver}.tar.gz
-        65-kvm.rules)
+        65-kvm.rules
+        block-avoid-creating-too-large-iovecs-in-multiwrite_merge.diff)
 
 build()
 {
     cd ${srcdir}/${pkgname}-${pkgver}
+    patch -p1 -i ${srcdir}/block-avoid-creating-too-large-iovecs-in-multiwrite_merge.diff || return 1
     # fix esound building
     ./configure --prefix=/usr \
                 --audio-drv-list=alsa,sdl,oss,esd \
@@ -38,4 +40,5 @@
                      ${pkgdir}/lib/udev/rules.d/65-kvm.rules
 }
 md5sums=('ab484975004f66fb48cb5589bd9b9dcb'
-         'b316a066d2f1bb57d8f5b7ea1d0d1caf')
+         'b316a066d2f1bb57d8f5b7ea1d0d1caf'
+         '3d71cb1c3d7c24e4ee1a6264b6f60dca')

Added: block-avoid-creating-too-large-iovecs-in-multiwrite_merge.diff
===================================================================
--- block-avoid-creating-too-large-iovecs-in-multiwrite_merge.diff	                        (rev 0)
+++ block-avoid-creating-too-large-iovecs-in-multiwrite_merge.diff	2010-04-11 11:29:25 UTC (rev 77164)
@@ -0,0 +1,49 @@
+From: Christoph Hellwig <hch at lst.de>
+Date: Tue, 26 Jan 2010 13:49:08 +0000 (+0100)
+Subject: block: avoid creating too large iovecs in multiwrite_merge
+X-Git-Url: http://git.kernel.org/?p=virt%2Fkvm%2Fqemu-kvm.git;a=commitdiff_plain;h=e2a305fb13ff0f5cf6ff805555aaa90a5ed5954c
+
+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 at lst.de>
+Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>
+---
+
+diff --git a/block.c b/block.c
+index 9c106a8..1919d19 100644
+--- a/block.c
++++ b/block.c
+@@ -1691,6 +1691,10 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs,
+             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));
+diff --git a/qemu-common.h b/qemu-common.h
+index ae4f23b..b09f717 100644
+--- a/qemu-common.h
++++ b/qemu-common.h
+@@ -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




More information about the arch-commits mailing list