#define VMDK_ZEROED (-3)
#define BLOCK_OPT_ZEROED_GRAIN "zeroed_grain"
+#define BLOCK_OPT_TOOLSVERSION "toolsversion"
typedef struct {
uint32_t version;
BlockdevVmdkAdapterType adapter_type,
const char *backing_file,
const char *hw_version,
+ const char *toolsversion,
bool compat6,
bool zeroed_grain,
vmdk_create_extent_fn extent_fn,
"ddb.geometry.cylinders = \"%" PRId64 "\"\n"
"ddb.geometry.heads = \"%" PRIu32 "\"\n"
"ddb.geometry.sectors = \"63\"\n"
- "ddb.adapterType = \"%s\"\n";
+ "ddb.adapterType = \"%s\"\n"
+ "ddb.toolsVersion = \"%s\"\n";
ext_desc_lines = g_string_new(NULL);
if (!hw_version) {
hw_version = "4";
}
+ if (!toolsversion) {
+ toolsversion = "2147483647";
+ }
if (adapter_type != BLOCKDEV_VMDK_ADAPTER_TYPE_IDE) {
/* that's the number of heads with which vmware operates when
size /
(int64_t)(63 * number_heads * BDRV_SECTOR_SIZE),
number_heads,
- BlockdevVmdkAdapterType_str(adapter_type));
+ BlockdevVmdkAdapterType_str(adapter_type),
+ toolsversion);
desc_len = strlen(desc);
/* the descriptor offset = 0x200 */
if (!split && !flat) {
BlockdevVmdkAdapterType adapter_type_enum;
char *backing_file = NULL;
char *hw_version = NULL;
+ char *toolsversion = NULL;
char *fmt = NULL;
BlockdevVmdkSubformat subformat;
int ret = 0;
adapter_type = qemu_opt_get_del(opts, BLOCK_OPT_ADAPTER_TYPE);
backing_file = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FILE);
hw_version = qemu_opt_get_del(opts, BLOCK_OPT_HWVERSION);
+ toolsversion = qemu_opt_get_del(opts, BLOCK_OPT_TOOLSVERSION);
compat6 = qemu_opt_get_bool_del(opts, BLOCK_OPT_COMPAT6, false);
if (strcmp(hw_version, "undefined") == 0) {
g_free(hw_version);
.opts = opts,
};
ret = vmdk_co_do_create(total_size, subformat, adapter_type_enum,
- backing_file, hw_version, compat6, zeroed_grain,
- vmdk_co_create_opts_cb, &data, errp);
+ backing_file, hw_version, toolsversion, compat6,
+ zeroed_grain, vmdk_co_create_opts_cb, &data, errp);
exit:
g_free(backing_fmt);
g_free(adapter_type);
g_free(backing_file);
g_free(hw_version);
+ g_free(toolsversion);
g_free(fmt);
g_free(desc);
g_free(path);
opts->adapter_type,
opts->backing_file,
opts->hwversion,
+ opts->toolsversion,
false,
opts->zeroed_grain,
vmdk_co_create_cb,
.def_value_str = "undefined"
},
{
+ .name = BLOCK_OPT_TOOLSVERSION,
+ .type = QEMU_OPT_STRING,
+ .help = "VMware guest tools version",
+ },
+ {
.name = BLOCK_OPT_SUBFMT,
.type = QEMU_OPT_STRING,
.help =