From 9895f00126f027cdd330800064773d2c260360f1 Mon Sep 17 00:00:00 2001 From: Han Han Date: Tue, 9 Apr 2019 18:01:25 +0800 Subject: [PATCH] vmx: Define VMX_CONFIG_FORMAT_ARGV Define VMX_CONFIG_FORMAT_ARGV to replace the hardcoded 'vmware-vmx' string used by the domxml-X-native APIs. This follows the pattern used by other drivers. Reviewed-by: Cole Robinson Signed-off-by: Han Han --- src/esx/esx_driver.c | 4 ++-- src/vmware/vmware_driver.c | 2 +- src/vmx/vmx.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 08d33b6f3b..d80fef0a58 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -2710,7 +2710,7 @@ esxConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat, memset(&data, 0, sizeof(data)); - if (STRNEQ(nativeFormat, "vmware-vmx")) { + if (STRNEQ(nativeFormat, VMX_CONFIG_FORMAT_ARGV)) { virReportError(VIR_ERR_INVALID_ARG, _("Unsupported config format '%s'"), nativeFormat); return NULL; @@ -2755,7 +2755,7 @@ esxConnectDomainXMLToNative(virConnectPtr conn, const char *nativeFormat, memset(&data, 0, sizeof(data)); - if (STRNEQ(nativeFormat, "vmware-vmx")) { + if (STRNEQ(nativeFormat, VMX_CONFIG_FORMAT_ARGV)) { virReportError(VIR_ERR_INVALID_ARG, _("Unsupported config format '%s'"), nativeFormat); return NULL; diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index f4b0989afd..1bc8a06c39 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -956,7 +956,7 @@ vmwareConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat, virCheckFlags(0, NULL); - if (STRNEQ(nativeFormat, "vmware-vmx")) { + if (STRNEQ(nativeFormat, VMX_CONFIG_FORMAT_ARGV)) { virReportError(VIR_ERR_INVALID_ARG, _("Unsupported config format '%s'"), nativeFormat); return NULL; diff --git a/src/vmx/vmx.h b/src/vmx/vmx.h index cb99e84d18..8c068b4cb2 100644 --- a/src/vmx/vmx.h +++ b/src/vmx/vmx.h @@ -26,6 +26,8 @@ # include "virconf.h" # include "domain_conf.h" +# define VMX_CONFIG_FORMAT_ARGV "vmware-vmx" + typedef struct _virVMXContext virVMXContext; virDomainXMLOptionPtr virVMXDomainXMLConfInit(void);