mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
vmware/vmx: use virDomainDefPostParse after parsing vmx config
This change ensures to call driver specific post-parse code to modify domain definition after parsing hypervisor config the same way we do after parsing XML. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
ea723c4826
commit
eba20715f9
@ -2743,7 +2743,7 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
|
|||||||
ctx.autodetectSCSIControllerModel = NULL;
|
ctx.autodetectSCSIControllerModel = NULL;
|
||||||
ctx.datacenterPath = priv->primary->datacenterPath;
|
ctx.datacenterPath = priv->primary->datacenterPath;
|
||||||
|
|
||||||
def = virVMXParseConfig(&ctx, priv->xmlopt, vmx);
|
def = virVMXParseConfig(&ctx, priv->xmlopt, priv->caps, vmx);
|
||||||
|
|
||||||
if (def) {
|
if (def) {
|
||||||
if (powerState != esxVI_VirtualMachinePowerState_PoweredOff)
|
if (powerState != esxVI_VirtualMachinePowerState_PoweredOff)
|
||||||
@ -2802,7 +2802,7 @@ esxConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
|
|||||||
ctx.autodetectSCSIControllerModel = NULL;
|
ctx.autodetectSCSIControllerModel = NULL;
|
||||||
ctx.datacenterPath = NULL;
|
ctx.datacenterPath = NULL;
|
||||||
|
|
||||||
def = virVMXParseConfig(&ctx, priv->xmlopt, nativeConfig);
|
def = virVMXParseConfig(&ctx, priv->xmlopt, priv->caps, nativeConfig);
|
||||||
|
|
||||||
if (def)
|
if (def)
|
||||||
xml = virDomainDefFormat(def, VIR_DOMAIN_DEF_FORMAT_INACTIVE);
|
xml = virDomainDefFormat(def, VIR_DOMAIN_DEF_FORMAT_INACTIVE);
|
||||||
|
@ -166,7 +166,8 @@ vmwareLoadDomains(struct vmware_driver *driver)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((vmdef =
|
if ((vmdef =
|
||||||
virVMXParseConfig(&ctx, driver->xmlopt, vmx)) == NULL) {
|
virVMXParseConfig(&ctx, driver->xmlopt,
|
||||||
|
driver->caps, vmx)) == NULL) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1035,7 +1035,7 @@ vmwareConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
|
|||||||
ctx.autodetectSCSIControllerModel = NULL;
|
ctx.autodetectSCSIControllerModel = NULL;
|
||||||
ctx.datacenterPath = NULL;
|
ctx.datacenterPath = NULL;
|
||||||
|
|
||||||
def = virVMXParseConfig(&ctx, driver->xmlopt, nativeConfig);
|
def = virVMXParseConfig(&ctx, driver->xmlopt, driver->caps, nativeConfig);
|
||||||
|
|
||||||
if (def != NULL)
|
if (def != NULL)
|
||||||
xml = virDomainDefFormat(def, VIR_DOMAIN_DEF_FORMAT_INACTIVE);
|
xml = virDomainDefFormat(def, VIR_DOMAIN_DEF_FORMAT_INACTIVE);
|
||||||
|
@ -1276,6 +1276,7 @@ virVMXGatherSCSIControllers(virVMXContext *ctx, virDomainDefPtr def,
|
|||||||
virDomainDefPtr
|
virDomainDefPtr
|
||||||
virVMXParseConfig(virVMXContext *ctx,
|
virVMXParseConfig(virVMXContext *ctx,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
|
virCapsPtr caps,
|
||||||
const char *vmx)
|
const char *vmx)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
@ -1811,6 +1812,10 @@ virVMXParseConfig(virVMXContext *ctx,
|
|||||||
def->namespaceData = namespaceData;
|
def->namespaceData = namespaceData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (virDomainDefPostParse(def, caps, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
|
||||||
|
xmlopt) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -82,6 +82,7 @@ char *virVMXConvertToUTF8(const char *encoding, const char *string);
|
|||||||
|
|
||||||
virDomainDefPtr virVMXParseConfig(virVMXContext *ctx,
|
virDomainDefPtr virVMXParseConfig(virVMXContext *ctx,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
|
virCapsPtr caps,
|
||||||
const char *vmx);
|
const char *vmx);
|
||||||
|
|
||||||
int virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
|
int virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
|
||||||
|
@ -78,7 +78,7 @@ testCompareFiles(const char *vmx, const char *xml)
|
|||||||
if (virtTestLoadFile(vmx, &vmxData) < 0)
|
if (virtTestLoadFile(vmx, &vmxData) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(def = virVMXParseConfig(&ctx, xmlopt, vmxData)))
|
if (!(def = virVMXParseConfig(&ctx, xmlopt, caps, vmxData)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!virDomainDefCheckABIStability(def, def)) {
|
if (!virDomainDefCheckABIStability(def, def)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user