Revision daac8fdc
b/block/vmdk.c | ||
---|---|---|
481 | 481 |
return ret; |
482 | 482 |
} |
483 | 483 |
|
484 |
static int vmdk_open_vmdk3(BlockDriverState *bs,
|
|
485 |
BlockDriverState *file, |
|
486 |
int flags) |
|
484 |
static int vmdk_open_vmfs_sparse(BlockDriverState *bs,
|
|
485 |
BlockDriverState *file,
|
|
486 |
int flags)
|
|
487 | 487 |
{ |
488 | 488 |
int ret; |
489 | 489 |
uint32_t magic; |
... | ... | |
674 | 674 |
magic = be32_to_cpu(magic); |
675 | 675 |
switch (magic) { |
676 | 676 |
case VMDK3_MAGIC: |
677 |
return vmdk_open_vmdk3(bs, file, flags);
|
|
677 |
return vmdk_open_vmfs_sparse(bs, file, flags);
|
|
678 | 678 |
break; |
679 | 679 |
case VMDK4_MAGIC: |
680 | 680 |
return vmdk_open_vmdk4(bs, file, flags); |
... | ... | |
718 | 718 |
} |
719 | 719 |
|
720 | 720 |
if (sectors <= 0 || |
721 |
(strcmp(type, "FLAT") && strcmp(type, "SPARSE")) || |
|
721 |
(strcmp(type, "FLAT") && strcmp(type, "SPARSE") && |
|
722 |
strcmp(type, "VMFSSPARSE")) || |
|
722 | 723 |
(strcmp(access, "RW"))) { |
723 | 724 |
goto next_line; |
724 | 725 |
} |
... | ... | |
741 | 742 |
return ret; |
742 | 743 |
} |
743 | 744 |
extent->flat_start_offset = flat_offset << 9; |
744 |
} else if (!strcmp(type, "SPARSE")) { |
|
745 |
/* SPARSE extent */ |
|
745 |
} else if (!strcmp(type, "SPARSE") || !strcmp(type, "VMFSSPARSE")) {
|
|
746 |
/* SPARSE extent and VMFSSPARSE extent are both "COWD" sparse file*/
|
|
746 | 747 |
ret = vmdk_open_sparse(bs, extent_file, bs->open_flags); |
747 | 748 |
if (ret) { |
748 | 749 |
bdrv_delete(extent_file); |
... | ... | |
789 | 790 |
goto exit; |
790 | 791 |
} |
791 | 792 |
if (strcmp(ct, "monolithicFlat") && |
793 |
strcmp(ct, "vmfsSparse") && |
|
792 | 794 |
strcmp(ct, "twoGbMaxExtentSparse") && |
793 | 795 |
strcmp(ct, "twoGbMaxExtentFlat")) { |
794 | 796 |
fprintf(stderr, |
... | ... | |
1381 | 1383 |
return ret; |
1382 | 1384 |
} |
1383 | 1385 |
|
1384 |
|
|
1385 | 1386 |
static int vmdk_create_extent(const char *filename, int64_t filesize, |
1386 | 1387 |
bool flat, bool compress, bool zeroed_grain) |
1387 | 1388 |
{ |
Also available in: Unified diff