From patchwork Wed Sep 25 21:02:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Cody X-Patchwork-Id: 278013 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 C4BC92C00A7 for ; Thu, 26 Sep 2013 07:03:54 +1000 (EST) Received: from localhost ([::1]:54726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOwFU-0008Sc-S5 for incoming@patchwork.ozlabs.org; Wed, 25 Sep 2013 17:03:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOwEw-0008Ki-N6 for qemu-devel@nongnu.org; Wed, 25 Sep 2013 17:03:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOwEp-0004nd-Kv for qemu-devel@nongnu.org; Wed, 25 Sep 2013 17:03:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOwEp-0004nB-Bl for qemu-devel@nongnu.org; Wed, 25 Sep 2013 17:03:11 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8PL3AL6018333 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Sep 2013 17:03:10 -0400 Received: from localhost ([10.3.112.14]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8PL38Za011538 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 25 Sep 2013 17:03:09 -0400 From: Jeff Cody To: qemu-devel@nongnu.org Date: Wed, 25 Sep 2013 17:02:46 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, famz@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH v6 01/20] block: vhdx - minor comments and typo correction. 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 Just a couple of minor comments to help note where allocated buffers are freed, and a typo fix. Signed-off-by: Jeff Cody --- block/vhdx.c | 6 ++++-- block/vhdx.h | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/block/vhdx.c b/block/vhdx.c index b8aa49c..276c105 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -6,9 +6,9 @@ * Authors: * Jeff Cody * - * This is based on the "VHDX Format Specification v0.95", published 4/12/2012 + * This is based on the "VHDX Format Specification v1.00", published 8/25/2012 * by Microsoft: - * https://www.microsoft.com/en-us/download/details.aspx?id=29681 + * https://www.microsoft.com/en-us/download/details.aspx?id=34750 * * This work is licensed under the terms of the GNU LGPL, version 2 or later. * See the COPYING.LIB file in the top-level directory. @@ -262,6 +262,7 @@ static int vhdx_parse_header(BlockDriverState *bs, BDRVVHDXState *s) uint64_t h2_seq = 0; uint8_t *buffer; + /* header1 & header2 are freed in vhdx_close() */ header1 = qemu_blockalign(bs, sizeof(VHDXHeader)); header2 = qemu_blockalign(bs, sizeof(VHDXHeader)); @@ -788,6 +789,7 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, goto fail; } + /* s->bat is freed in vhdx_close() */ s->bat = qemu_blockalign(bs, s->bat_rt.length); ret = bdrv_pread(bs->file, s->bat_offset, s->bat, s->bat_rt.length); diff --git a/block/vhdx.h b/block/vhdx.h index fb687ed..9eb6b97 100644 --- a/block/vhdx.h +++ b/block/vhdx.h @@ -6,9 +6,9 @@ * Authors: * Jeff Cody * - * This is based on the "VHDX Format Specification v0.95", published 4/12/2012 + * This is based on the "VHDX Format Specification v1.00", published 8/25/2012 * by Microsoft: - * https://www.microsoft.com/en-us/download/details.aspx?id=29681 + * https://www.microsoft.com/en-us/download/details.aspx?id=34750 * * This work is licensed under the terms of the GNU LGPL, version 2 or later. * See the COPYING.LIB file in the top-level directory. @@ -116,7 +116,7 @@ typedef struct QEMU_PACKED VHDXHeader { valid. */ uint16_t log_version; /* version of the log format. Mustn't be zero, unless log_guid is also zero */ - uint16_t version; /* version of th evhdx file. Currently, + uint16_t version; /* version of the vhdx file. Currently, only supported version is "1" */ uint32_t log_length; /* length of the log. Must be multiple of 1MB */