]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vmx: Define VMX_CONFIG_FORMAT_ARGV
authorHan Han <hhan@redhat.com>
Tue, 9 Apr 2019 10:01:25 +0000 (18:01 +0800)
committerCole Robinson <crobinso@redhat.com>
Tue, 9 Apr 2019 19:30:04 +0000 (15:30 -0400)
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 <crobinso@redhat.com>
Signed-off-by: Han Han <hhan@redhat.com>
src/esx/esx_driver.c
src/vmware/vmware_driver.c
src/vmx/vmx.h

index 08d33b6f3ba2698e13a4be7b68f9793d5f6708d9..d80fef0a584b8237acccffc8b46b3622ea3f7d90 100644 (file)
@@ -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;
index f4b0989afd4c5173a9991dfb9e5d65b4d0d8d3a4..1bc8a06c39f6d2f53caaec732830a2b92e7a35d9 100644 (file)
@@ -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;
index cb99e84d18c0db775562757ba7267cf2d15a9b76..8c068b4cb25f236e093e209da129042c5fa6ec04 100644 (file)
@@ -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);