From patchwork Thu Nov 7 13:12:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 289326 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 33AAC2C00BA for ; Fri, 8 Nov 2013 00:20:04 +1100 (EST) Received: from localhost ([::1]:40263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VePVC-00044c-8U for incoming@patchwork.ozlabs.org; Thu, 07 Nov 2013 08:20:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VePQX-0007nW-Nr for qemu-devel@nongnu.org; Thu, 07 Nov 2013 08:15:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VePQR-0006yL-M3 for qemu-devel@nongnu.org; Thu, 07 Nov 2013 08:15:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VePQR-0006xs-Ez for qemu-devel@nongnu.org; Thu, 07 Nov 2013 08:15:07 -0500 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 rA7DDo3V027838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Nov 2013 08:13:51 -0500 Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rA7DDnbA009702; Thu, 7 Nov 2013 08:13:50 -0500 From: Stefan Hajnoczi To: Date: Thu, 7 Nov 2013 14:12:32 +0100 Message-Id: <1383829964-32364-25-git-send-email-stefanha@redhat.com> In-Reply-To: <1383829964-32364-1-git-send-email-stefanha@redhat.com> References: <1383829964-32364-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jeff Cody , Stefan Hajnoczi , Anthony Liguori Subject: [Qemu-devel] [PULL 24/36] block: vhdx code movement - move vhdx_close() above vhdx_open() 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: Jeff Cody Signed-off-by: Jeff Cody Signed-off-by: Stefan Hajnoczi --- block/vhdx.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/block/vhdx.c b/block/vhdx.c index 241703a..3f06ce3 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -778,6 +778,17 @@ exit: } +static void vhdx_close(BlockDriverState *bs) +{ + BDRVVHDXState *s = bs->opaque; + qemu_vfree(s->headers[0]); + qemu_vfree(s->headers[1]); + qemu_vfree(s->bat); + qemu_vfree(s->parent_entries); + migrate_del_blocker(s->migration_blocker); + error_free(s->migration_blocker); +} + static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { @@ -1035,17 +1046,6 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, } -static void vhdx_close(BlockDriverState *bs) -{ - BDRVVHDXState *s = bs->opaque; - qemu_vfree(s->headers[0]); - qemu_vfree(s->headers[1]); - qemu_vfree(s->bat); - qemu_vfree(s->parent_entries); - migrate_del_blocker(s->migration_blocker); - error_free(s->migration_blocker); -} - static BlockDriver bdrv_vhdx = { .format_name = "vhdx", .instance_size = sizeof(BDRVVHDXState),