提交 6e9d290b 编写于 作者: J Jeff Cody 提交者: Stefan Hajnoczi

block: vhdx - minor comments and typo correction.

Just a couple of minor comments to help note where allocated
buffers are freed, and a typo fix.
Signed-off-by: NJeff Cody <jcody@redhat.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 0173e7bb
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
* Authors: * Authors:
* Jeff Cody <jcody@redhat.com> * Jeff Cody <jcody@redhat.com>
* *
* 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: * 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. * 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. * See the COPYING.LIB file in the top-level directory.
...@@ -264,6 +264,7 @@ static int vhdx_parse_header(BlockDriverState *bs, BDRVVHDXState *s) ...@@ -264,6 +264,7 @@ static int vhdx_parse_header(BlockDriverState *bs, BDRVVHDXState *s)
uint64_t h2_seq = 0; uint64_t h2_seq = 0;
uint8_t *buffer; uint8_t *buffer;
/* header1 & header2 are freed in vhdx_close() */
header1 = qemu_blockalign(bs, sizeof(VHDXHeader)); header1 = qemu_blockalign(bs, sizeof(VHDXHeader));
header2 = qemu_blockalign(bs, sizeof(VHDXHeader)); header2 = qemu_blockalign(bs, sizeof(VHDXHeader));
...@@ -790,6 +791,7 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, ...@@ -790,6 +791,7 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
goto fail; goto fail;
} }
/* s->bat is freed in vhdx_close() */
s->bat = qemu_blockalign(bs, s->bat_rt.length); s->bat = qemu_blockalign(bs, s->bat_rt.length);
ret = bdrv_pread(bs->file, s->bat_offset, s->bat, s->bat_rt.length); ret = bdrv_pread(bs->file, s->bat_offset, s->bat, s->bat_rt.length);
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
* Authors: * Authors:
* Jeff Cody <jcody@redhat.com> * Jeff Cody <jcody@redhat.com>
* *
* 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: * 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. * 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. * See the COPYING.LIB file in the top-level directory.
...@@ -116,7 +116,7 @@ typedef struct QEMU_PACKED VHDXHeader { ...@@ -116,7 +116,7 @@ typedef struct QEMU_PACKED VHDXHeader {
valid. */ valid. */
uint16_t log_version; /* version of the log format. Mustn't be uint16_t log_version; /* version of the log format. Mustn't be
zero, unless log_guid is also zero */ 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" */ only supported version is "1" */
uint32_t log_length; /* length of the log. Must be multiple uint32_t log_length; /* length of the log. Must be multiple
of 1MB */ of 1MB */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册