qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v9 00/12] Adding VMDK monolithic flat support


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v9 00/12] Adding VMDK monolithic flat support
Date: Mon, 18 Jul 2011 16:52:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10

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, &sectors, 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) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]