From patchwork Mon Sep 9 09:14:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tal Kain X-Patchwork-Id: 273596 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DF62C2C0113 for ; Tue, 10 Sep 2013 01:25:02 +1000 (EST) Received: from localhost ([::1]:52262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ3Km-0004Tb-FR for incoming@patchwork.ozlabs.org; Mon, 09 Sep 2013 11:25:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIweN-0006dz-Bv for qemu-devel@nongnu.org; Mon, 09 Sep 2013 04:16:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIweG-0008L5-D7 for qemu-devel@nongnu.org; Mon, 09 Sep 2013 04:16:47 -0400 Received: from na3sys010aog103.obsmtp.com ([74.125.245.74]:39524) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1VIweG-0008Kw-5K for qemu-devel@nongnu.org; Mon, 09 Sep 2013 04:16:40 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]) (using TLSv1) by na3sys010aob103.postini.com ([74.125.244.12]) with SMTP ID DSNKUi2D5r/zwgptsmW4kTaNhsLlyaG53JzQ@postini.com; Mon, 09 Sep 2013 01:16:39 PDT Received: by mail-wi0-f176.google.com with SMTP id cb5so3028169wib.15 for ; Mon, 09 Sep 2013 01:16:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6ok+733BPLNb7BYZgykBpHpJQxPloaRLiLILsB2FP2o=; b=W47STc17EwFLjLmAP/HPOx4gaOX8Sd3HeMmvh9wT2ZZGYCPU8Epx5+l0Q6ss+0BV10 QCYWIjL4OzDdVFOGfwsUX5laJPKeqfFEUkHdVGzxl74pLzwdsHdwuf0+zfZ9hQZGbng/ mHqwQlKkq/mWyToG2Omf2TT9uWduTvNfWqle1T0mdWaiqKqSDFZ4lwQ9YpnrAM37hzbf 2euJTDY73RjYuxujHs34fx2URii/ajG8YU6jBqP4gbEXX3aTf4P29PmIDotRLUF5cSYb Q3HQtGjZTLaEb8+PsDuNCR10wM1syK6NhoidUNLiwzFxt5DmWOYb5h4o1F5a0S7bXAl7 biNQ== X-Gm-Message-State: ALoCoQmnyNzOCzjvNrsAaajb8JrvYT7wTXt5dMTJb2jCKG8rh7ppR8TtAjPKMqfR4LYUlJNGMtdOTTLXQdjUJww1NmnAFnQ9ke3wj7TOYOahzwhAfEAGNlohwjYLmT46vhVX0sESK/898OGdlO4qL3834RWHxqcEbJKFkqeoQOGAfvD6XfDCq5g= X-Received: by 10.180.206.244 with SMTP id lr20mr7411656wic.45.1378714597326; Mon, 09 Sep 2013 01:16:37 -0700 (PDT) X-Received: by 10.180.206.244 with SMTP id lr20mr7411649wic.45.1378714597255; Mon, 09 Sep 2013 01:16:37 -0700 (PDT) Received: from predator.ravello.local ([213.57.127.2]) by mx.google.com with ESMTPSA id d11sm15777830wic.4.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Sep 2013 01:16:36 -0700 (PDT) From: Tal Kain To: qemu-devel@nongnu.org Date: Mon, 9 Sep 2013 11:14:55 +0200 Message-Id: <1378718095-18850-1-git-send-email-tal.kain@ravellosystems.com> X-Mailer: git-send-email 1.7.9.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 74.125.245.74 X-Mailman-Approved-At: Mon, 09 Sep 2013 11:24:40 -0400 Cc: kwolf@redhat.com, hvx@ravellosystems.com, Tal Kain , stefanha@redhat.com Subject: [Qemu-devel] [PATCH] raw-win32.c: Fix incorrect handling behaviour of small block files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It is a valid case that the read data's size is smaller than the requested size since there could be files that are smaller than the minimum block size (For ex. when a VMDK disk descriptor file) Signed-off-by: Tal Kain --- block/raw-win32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/raw-win32.c b/block/raw-win32.c index 9b5b2af..bffbee8 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -85,6 +85,7 @@ static size_t handle_aiocb_rw(RawWin32AIOData *aiocb) ret_count = 0; } if (ret_count != len) { + offset += ret_count; break; } offset += len;