[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH for-4.5 v7 5/7] tools: Add vmware_port support
This new libxl_domain_create_info field is used to set XEN_DOMCTL_CDF_vmware_port for the xc_domain_create() routine. In xen it is is_vmware_port_enabled. If is_vmware_port_enabled then enable a limited support of VMware's hyper-call. VMware's hyper-call is also known as VMware Backdoor I/O Port. if vmware_port is not specified in the config file, let "vmware_hw != 0" be the default value. This means that only vmware_hw = 7 needs to be specified to enable both features. Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx> --- docs/man/xl.cfg.pod.5 | 11 +++++++++++ tools/libxl/libxl.h | 5 +++++ tools/libxl/libxl_create.c | 9 +++++++-- tools/libxl/libxl_dm.c | 4 +++- tools/libxl/libxl_internal.h | 3 ++- tools/libxl/libxl_types.idl | 1 + tools/libxl/xl_cmdimpl.c | 1 + 7 files changed, 30 insertions(+), 4 deletions(-) diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 index 6628cfc..413fe8c 100644 --- a/docs/man/xl.cfg.pod.5 +++ b/docs/man/xl.cfg.pod.5 @@ -1214,6 +1214,17 @@ For vssd:VirtualSystemType == vmx-07, vmware_hw = 7. =back +=item B<vmware_port=BOOLEAN> + +Turns on or off the exposure of VMware port. This is known as +vmport in QEMU. Also called VMware Backdoor I/O Port. Not all +defined VMware backdoor commands are implemented. All of the +ones that Linux kernel uses are defined. + +if vmware_port is not specified in the config file, let vmware_hw != 0 +be the default value. This means that only vmware_hw = 7 needs to +be specified to enable both features. + =back =head3 Emulated VGA Graphics Device diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 09faa04..9307bb4 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -168,6 +168,11 @@ #define LIBXL_HAVE_BUILDINFO_HVM_VMWARE_HW 1 /* + * libxl_domain_create_info has the vmware_port field. + */ +#define LIBXL_HAVE_CREATEINFO_VMWARE_PORT 1 + +/* * libxl ABI compatibility * * The only guarantee which libxl makes regarding ABI compatibility diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 9f4e03c..bda9f96 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -25,7 +25,8 @@ #include <xen/hvm/hvm_info_table.h> int libxl__domain_create_info_setdefault(libxl__gc *gc, - libxl_domain_create_info *c_info) + libxl_domain_create_info *c_info, + bool vmware_port_default) { if (!c_info->type) return ERROR_INVAL; @@ -38,6 +39,7 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc, libxl_defbool_setdefault(&c_info->hap, libxl_defbool_val(c_info->pvh)); } + libxl_defbool_setdefault(&c_info->vmware_port, vmware_port_default); libxl_defbool_setdefault(&c_info->run_hotplug_scripts, true); libxl_defbool_setdefault(&c_info->driver_domain, false); @@ -505,6 +507,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info, flags |= XEN_DOMCTL_CDF_hvm_guest; flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0; flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off; + flags |= libxl_defbool_val(info->vmware_port)? XEN_DOMCTL_CDF_vmware_port : 0; } else if (libxl_defbool_val(info->pvh)) { flags |= XEN_DOMCTL_CDF_pvh_guest; if (!libxl_defbool_val(info->hap)) { @@ -833,7 +836,9 @@ static void initiate_domain_create(libxl__egc *egc, goto error_out; } - ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info); + ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info, + d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM && + d_config->b_info.u.hvm.vmware_hw); if (ret) goto error_out; ret = libxl__domain_make(gc, &d_config->c_info, &domid); diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 8bd6414..bc52957 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -996,7 +996,9 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss) dm_config->c_info.run_hotplug_scripts = guest_config->c_info.run_hotplug_scripts; - ret = libxl__domain_create_info_setdefault(gc, &dm_config->c_info); + ret = libxl__domain_create_info_setdefault(gc, &dm_config->c_info, + dm_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM && + dm_config->b_info.u.hvm.vmware_hw); if (ret) goto out; ret = libxl__domain_build_info_setdefault(gc, &dm_config->b_info); if (ret) goto out; diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index b87c5e2..d74d9ff 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1063,7 +1063,8 @@ _hidden int libxl__nic_type(libxl__gc *gc, libxl__device *dev, * to be called before using any values within these structures. */ _hidden int libxl__domain_create_info_setdefault(libxl__gc *gc, - libxl_domain_create_info *c_info); + libxl_domain_create_info *c_info, + bool vmware_port_default); _hidden int libxl__domain_build_info_setdefault(libxl__gc *gc, libxl_domain_build_info *b_info); _hidden int libxl__device_disk_setdefault(libxl__gc *gc, diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 5d25b77..c75e1f6 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -304,6 +304,7 @@ libxl_domain_create_info = Struct("domain_create_info",[ ("type", libxl_domain_type), ("hap", libxl_defbool), ("oos", libxl_defbool), + ("vmware_port", libxl_defbool), ("ssidref", uint32), ("ssid_label", string), ("name", string), diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 89d1724..b821e63 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -892,6 +892,7 @@ static void parse_config_data(const char *config_source, } xlu_cfg_get_defbool(config, "oos", &c_info->oos, 0); + xlu_cfg_get_defbool(config, "vmware_port", &c_info->vmware_port, 0); if (!xlu_cfg_get_string (config, "pool", &buf, 0)) xlu_cfg_replace_string(config, "pool", &c_info->pool_name, 0); -- 1.8.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |