From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL7DD-0005yK-JB for qemu-devel@nongnu.org; Fri, 09 Nov 2018 08:52:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL7D7-0005Yy-8a for qemu-devel@nongnu.org; Fri, 09 Nov 2018 08:52:39 -0500 From: Alberto Garcia In-Reply-To: References: <20181101182738.70462-1-vsementsov@virtuozzo.com> <20181101182738.70462-7-vsementsov@virtuozzo.com> Date: Fri, 09 Nov 2018 14:51:42 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 6/7] qcow2: aio support for compressed cluster read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , "qemu-devel@nongnu.org" , "qemu-block@nongnu.org" Cc: "kwolf@redhat.com" , Denis Lunev , "mreitz@redhat.com" On Tue 06 Nov 2018 05:24:36 PM CET, Vladimir Sementsov-Ogievskiy wrote: >> Is there any reason why some parts of the QEMU code use qemu_blockalign >> and others qemu_try_blockalign() ? From what I can see it seems to be up >> to whoever wrote it... > > As I understand, the good reason to use _try_ versions, is when we are > allocating some size, taken from user input, so it may be > unpredictable large (hm, or just any really large allocation), so, I > use try_malloc for compressed size, which may be very large in somehow > corrupted image. Ah right, the value of the compressed size field can be up to 8192 sectors, or 4MB. I realized that you should add the coroutine_fn annotation to qcow2_co_preadv_compressed(). Other than that the patch looks good so, with that changed, Reviewed-by: Alberto Garcia Berto