From patchwork Mon Jul 9 14:16:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 169884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D72AB2C0089 for ; Tue, 10 Jul 2012 01:34:32 +1000 (EST) Received: from localhost ([::1]:33323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoEmP-0003gE-Cy for incoming@patchwork.ozlabs.org; Mon, 09 Jul 2012 10:17:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoElc-0001kq-Lq for qemu-devel@nongnu.org; Mon, 09 Jul 2012 10:16:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoEla-00088k-SJ for qemu-devel@nongnu.org; Mon, 09 Jul 2012 10:16:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoEla-00088O-K1 for qemu-devel@nongnu.org; Mon, 09 Jul 2012 10:16:46 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q69EGigS030496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Jul 2012 10:16:44 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q69EGTrl012288; Mon, 9 Jul 2012 10:16:43 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 9 Jul 2012 16:16:15 +0200 Message-Id: <1341843388-5663-13-git-send-email-kwolf@redhat.com> In-Reply-To: <1341843388-5663-1-git-send-email-kwolf@redhat.com> References: <1341843388-5663-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 12/25] blkdebug: pass getlength to underlying file 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 From: Paolo Bonzini This is required when using blkdebug with raw format. Unlike qcow2/QED, raw asks blkdebug for the length of the file, it doesn't get it from a header. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- block/blkdebug.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 1f79ef2..b084a23 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -429,6 +429,11 @@ static void blkdebug_debug_event(BlockDriverState *bs, BlkDebugEvent event) } } +static int64_t blkdebug_getlength(BlockDriverState *bs) +{ + return bdrv_getlength(bs->file); +} + static BlockDriver bdrv_blkdebug = { .format_name = "blkdebug", .protocol_name = "blkdebug", @@ -437,6 +442,7 @@ static BlockDriver bdrv_blkdebug = { .bdrv_file_open = blkdebug_open, .bdrv_close = blkdebug_close, + .bdrv_getlength = blkdebug_getlength, .bdrv_aio_readv = blkdebug_aio_readv, .bdrv_aio_writev = blkdebug_aio_writev,