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 <crobinso@redhat.com>
Signed-off-by: Han Han <hhan@redhat.com>
This commit is contained in:
Han Han 2019-04-09 18:01:25 +08:00 committed by Cole Robinson
parent 9009858d5b
commit 9895f00126
3 changed files with 5 additions and 3 deletions

View 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;

View 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;

View 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);