From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Use qemu_memalign instead of qemu_malloc Date: Wed, 25 Jun 2008 09:19:48 -0500 Message-ID: <48625404.9070803@us.ibm.com> References: <1214333395-4094-1-git-send-email-aliguori@us.ibm.com> <48620DAB.5010501@suse.de> <48624C9D.90903@us.ibm.com> <486252FA.6030804@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Kevin Wolf Return-path: Received: from e1.ny.us.ibm.com ([32.97.182.141]:34003 "EHLO e1.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752726AbYFYOUW (ORCPT ); Wed, 25 Jun 2008 10:20:22 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e1.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m5PEKLwx032203 for ; Wed, 25 Jun 2008 10:20:21 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m5PEKJaG897272 for ; Wed, 25 Jun 2008 10:20:19 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5PEK9Kt001618 for ; Wed, 25 Jun 2008 08:20:10 -0600 In-Reply-To: <486252FA.6030804@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Kevin Wolf wrote: > Anthony Liguori schrieb: > >> Kevin Wolf wrote: >> >>> Anthony Liguori schrieb: >>> >>> >>>> I guess the main block code is not as defensive as I thought it was. >>>> This patch >>>> uses qemu_memalign to allocate the buffers for IO so that you don't >>>> get errors >>>> when using O_DIRECT. >>>> >>>> >>> Actually, the block code should be able to deal with unaligned buffers >>> since qemu rev. 4599. This change seems to be present in current KVM. >>> >>> >> That was what I thought at first too. >> >> >>> Can you tell exactly which operation failed? >>> >> The aio requests fail with -22 (EINVAL). >> > > Yes, if it fails, the EINVAL is no surprise. I meant what code path it > was using. Obviously we missed something in our patch and I'd like to > fix that. Did the error occur on raw images or something like qcow2? > It's a raw image and the calls are being made via bdrv_aio_read/bdrv_aio_write. It doesn't occur with a qcow2 but then cache=off doesn't seem to do what it's supposed to with cache=off (I believe the underlying backing file is not opened O_DIRECT?). Regards, Anthony Liguori > Kevin >