From patchwork Fri Jan 29 20:22:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 75838 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o0TKMZr9007333 for ; Fri, 29 Jan 2010 20:22:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754603Ab0A2UWd (ORCPT ); Fri, 29 Jan 2010 15:22:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753088Ab0A2UWd (ORCPT ); Fri, 29 Jan 2010 15:22:33 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:46266 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752656Ab0A2UWc (ORCPT ); Fri, 29 Jan 2010 15:22:32 -0500 Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1NaxMN-0006GJ-UO for kvm@vger.kernel.org; Fri, 29 Jan 2010 20:22:31 +0000 Date: Fri, 29 Jan 2010 15:22:31 -0500 From: Christoph Hellwig To: kvm@vger.kernel.org Subject: Re: [ kvm-Bugs-2941282 ] Ubuntu 10.04 installer fails due to I/O errors with virtio Message-ID: <20100129202231.GA23315@infradead.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 29 Jan 2010 20:22:35 +0000 (UTC) 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 #endif