Tuesday, 9 April
2019
Tue, 9 Apr
'19
5:01 a.m.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
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);
--
2.20.1