Received: from eggs.gnu.org ([2001:4830:134:3::10]:58134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKZ0I-0005uW-O9 for qemu-devel@nongnu.org; Mon, 03 Mar 2014 14:58:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKZ0C-0000gm-OG for qemu-devel@nongnu.org; Mon, 03 Mar 2014 14:58:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKZ0C-0000gV-Fy for qemu-devel@nongnu.org; Mon, 03 Mar 2014 14:58:16 -0500 Date: Mon, 3 Mar 2014 14:58:08 -0500 From: Jeff Cody Message-ID: <20140303195808.GA26457@localhost.localdomain> References: <1383905551-16411-1-git-send-email-stefanha@redhat.com> <1383905551-16411-34-git-send-email-stefanha@redhat.com> <3030240E-C490-4E7C-8D41-5319E25DA8A6@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3030240E-C490-4E7C-8D41-5319E25DA8A6@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL v2 33/37] block: vhdx - add .bdrv_create() support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Peter Maydell , QEMU Developers , Stefan Hajnoczi , Anthony Liguori On Fri, Feb 21, 2014 at 01:06:43PM +0100, Alexander Graf wrote: >=20 > On 08.11.2013, at 11:12, Stefan Hajnoczi wrote: >=20 > > From: Jeff Cody > >=20 > > This adds support for VHDX image creation, for images of type "Fixed" > > and "Dynamic". "Differencing" types (i.e., VHDX images with backing > > files) are currently not supported. > >=20 > > Options for image creation include: > > * log size: > > The size of the journaling log for VHDX. Minimum is 1MB, > > and it must be a multiple of 1MB. Invalid log sizes will be > > silently fixed by rounding up to the nearest MB. > >=20 > > Default is 1MB. > >=20 > > * block size: > > This is the size of a payload block. The range is 1MB to 256M= B, > > inclusive, and must be a multiple of 1MB as well. Invalid siz= es > > and multiples will be silently fixed. If '0' is passed, then > > a sane size is chosen (depending on virtual image size). > >=20 > > Default is 0 (Auto-select). > >=20 > > * subformat: > > - "dynamic" > > An image without data pre-allocated. > > - "fixed" > > An image with data pre-allocated. > >=20 > > Default is "dynamic" > >=20 > > When creating the image file, the lettered sections are created: > >=20 > > -----------------------------------------------------------------. > > | (A) | (B) | (C) | (D) | (E) > > | File ID | Header1 | Header 2 | Region Tbl 1 | Region Tbl 2 > > | | | | | > > .-----------------------------------------------------------------. > > 0 64KB 128KB 192KB 256KB 320KB > >=20 > > .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------. > > | (F) | (G) | (H) | > > | Journal Log | BAT / Bitmap | Metadata | .... data ...... > > | | | | > > .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------. > > 1MB (var.) (var.) (var.) > >=20 > > Signed-off-by: Jeff Cody > > Signed-off-by: Stefan Hajnoczi > > --- > > block/vhdx.c | 558 ++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++ > > block/vhdx.h | 15 +- > > 2 files changed, 572 insertions(+), 1 deletion(-) > >=20 > >=20 >=20 > [..=E2=80=A6] >=20 > > /* Header for the region table block */ > > +#define VHDX_REGION_SIGNATURE 0x69676572 /* "regi" in ASCII */ > > typedef struct QEMU_PACKED VHDXRegionTableHeader { > > uint32_t signature; /* "regi" in ASCII */ > > uint32_t checksum; /* CRC-32C hash of the 64KB t= able */ > > @@ -238,6 +247,7 @@ typedef uint64_t VHDXBatEntry; > > #define VHDX_METADATA_MAX_ENTRIES 2047 /* not including the header *= / > > #define VHDX_METADATA_TABLE_MAX_SIZE \ > > (VHDX_METADATA_ENTRY_SIZE * (VHDX_METADATA_MAX_ENTRIES+1)) > > +#define VHDX_METADATA_SIGNATURE 0x617461646174656D /* "metadata" in= ASCII */ >=20 > This is missing a "ULL" tag. There are a few places where compilation o= f vhdx spawns warnings on 32bit hosts - I haven't checked all of them. >=20 > 02/21 12:22:14 ERROR| utils:0144| [stderr] block/vhdx.c: In functio= n 'vhdx_open': > 02/21 12:22:14 ERROR| utils:0144| [stderr] block/vhdx.c:957: warnin= g: integer constant is too large for 'long' type > 02/21 12:22:14 ERROR| utils:0144| [stderr] block/vhdx.c: In functio= n 'vhdx_block_translate': > 02/21 12:22:14 ERROR| utils:0144| [stderr] block/vhdx.c:1027: warni= ng: integer constant is too large for 'long' type > 02/21 12:22:14 ERROR| utils:0144| [stderr] block/vhdx.c: In functio= n 'vhdx_create_new_metadata': > 02/21 12:22:14 ERROR| utils:0144| [stderr] block/vhdx.c:1455: warni= ng: integer constant is too large for 'long' type > 02/21 12:22:14 ERROR| utils:0144| [stderr] block/vhdx.c: In functio= n 'vhdx_create': > 02/21 12:22:14 ERROR| utils:0144| [stderr] block/vhdx.c:1812: warni= ng: integer constant is too large for 'long' type >=20 >=20 Hi Alex, I've compiled this using both i686/i386 Fedora 20 and OpenSuse 13.1 hosts, and I did not run into these warnings. Could you tell me what host and compiler you are using for compilation, so I can reproduce and verify the fix? Thanks, Jeff