From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qip95-0006sL-Ez for qemu-devel@nongnu.org; Mon, 18 Jul 2011 10:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qip92-0001pP-HT for qemu-devel@nongnu.org; Mon, 18 Jul 2011 10:50:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qip91-0001p5-V6 for qemu-devel@nongnu.org; Mon, 18 Jul 2011 10:50:04 -0400 Message-ID: <4E2448C3.4030101@redhat.com> Date: Mon, 18 Jul 2011 16:52:51 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1310471799-20055-1-git-send-email-famcool@gmail.com> In-Reply-To: <1310471799-20055-1-git-send-email-famcool@gmail.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v9 00/12] Adding VMDK monolithic flat support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: stefanha@gmail.com, qemu-devel@nongnu.org, hch@lst.de Am 12.07.2011 13:56, schrieb Fam Zheng: > Changes from v8: > 09/12: remove duplicated sscanf > 10/12: change option name to 'subformat', change commit message typo, > factor common parts of creating, and other small improvements > > Fam Zheng (12): > VMDK: introduce VmdkExtent > VMDK: bugfix, align offset to cluster in get_whole_cluster > VMDK: probe for monolithicFlat images > VMDK: separate vmdk_open by format version > VMDK: add field BDRVVmdkState.desc_offset > VMDK: flush multiple extents > VMDK: move 'static' cid_update flag to bs field > VMDK: change get_cluster_offset return type > VMDK: open/read/write for monolithicFlat image > VMDK: create different subformats > VMDK: fix coding style > block: add bdrv_get_allocated_file_size() operation > > block.c | 19 + > block.h | 1 + > block/raw-posix.c | 21 + > block/raw-win32.c | 29 ++ > block/vmdk.c | 1296 ++++++++++++++++++++++++++++++++++++----------------- > block_int.h | 2 + > qemu-img.c | 31 +-- > 7 files changed, 964 insertions(+), 435 deletions(-) This doesn't build for me: cc1: warnings being treated as errors block/vmdk.c: In function 'vmdk_parse_extents': block/vmdk.c:482: error: format '%lld' expects type 'long long int *', but argument 4 has type 'int64_t *' block/vmdk.c:482: error: format '%lld' expects type 'long long int *', but argument 7 has type 'int64_t *' block/vmdk.c: In function 'vmdk_create_extent': block/vmdk.c:1024: error: invalid storage class for function 'filename_decompose' [...] The following patch makes it compile. I haven't tried figuring out which patches need to be fixed, but should be easy enough for you. Please resend only those patches that need to be changed, I have already merged everything (plus my fixup) and will only update it in the block branch. Kevin diff --git a/block/vmdk.c b/block/vmdk.c index 63d7605..37478d2 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -478,7 +478,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs, * RW [size in sectors] SPARSE "file-name.vmdk" */ flat_offset = -1; - ret = sscanf(p, "%10s %lld %10s %511s %lld", + ret = sscanf(p, "%10s %" SCNd64 " %10s %511s %" SCNd64, access, §ors, type, fname, &flat_offset); if (ret < 4 || strcmp(access, "RW")) { goto next_line; @@ -927,6 +927,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize, bool flat) 0644); if (fd < 0) { return -errno; + } if (flat) { ret = ftruncate(fd, filesize); if (ret < 0) {