      /* update L2 table */
      if (bdrv_pwrite_sync(
                  extent->file,
-@@ -1026,6 +1066,97 @@ static int vmdk_L2update(VmdkExtent *extent, VmdkMetaData *m_data)
+@@ -1026,6 +1066,97 @@
      return VMDK_OK;
  }
  

     ret = 0;
  out:
     g_free(data);
@@ -1534,10 +1688,12 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
     int ret, i;
     BlockDriverState *bs = NULL;
     VMDK4Header header;

 
     ret = bdrv_create_file(filename, opts, &local_err);
     if (ret < 0) {
@@ -1562,28 +1718,38 @@
     }
     magic = cpu_to_be32(VMDK4_MAGIC);
     memset(&header, 0, sizeof(header));
