提交 eba20715 编写于 作者: P Pavel Hrdina

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: NPavel Hrdina <phrdina@redhat.com>
上级 ea723c48
......@@ -2743,7 +2743,7 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
ctx.autodetectSCSIControllerModel = NULL;
ctx.datacenterPath = priv->primary->datacenterPath;
def = virVMXParseConfig(&ctx, priv->xmlopt, vmx);
def = virVMXParseConfig(&ctx, priv->xmlopt, priv->caps, vmx);
if (def) {
if (powerState != esxVI_VirtualMachinePowerState_PoweredOff)
......@@ -2802,7 +2802,7 @@ esxConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
ctx.autodetectSCSIControllerModel = NULL;
ctx.datacenterPath = NULL;
def = virVMXParseConfig(&ctx, priv->xmlopt, nativeConfig);
def = virVMXParseConfig(&ctx, priv->xmlopt, priv->caps, nativeConfig);
if (def)
xml = virDomainDefFormat(def, VIR_DOMAIN_DEF_FORMAT_INACTIVE);
......
......@@ -166,7 +166,8 @@ vmwareLoadDomains(struct vmware_driver *driver)
goto cleanup;
if ((vmdef =
virVMXParseConfig(&ctx, driver->xmlopt, vmx)) == NULL) {
virVMXParseConfig(&ctx, driver->xmlopt,
driver->caps, vmx)) == NULL) {
goto cleanup;
}
......
......@@ -1035,7 +1035,7 @@ vmwareConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
ctx.autodetectSCSIControllerModel = NULL;
ctx.datacenterPath = NULL;
def = virVMXParseConfig(&ctx, driver->xmlopt, nativeConfig);
def = virVMXParseConfig(&ctx, driver->xmlopt, driver->caps, nativeConfig);
if (def != NULL)
xml = virDomainDefFormat(def, VIR_DOMAIN_DEF_FORMAT_INACTIVE);
......
......@@ -1276,6 +1276,7 @@ virVMXGatherSCSIControllers(virVMXContext *ctx, virDomainDefPtr def,
virDomainDefPtr
virVMXParseConfig(virVMXContext *ctx,
virDomainXMLOptionPtr xmlopt,
virCapsPtr caps,
const char *vmx)
{
bool success = false;
......@@ -1811,6 +1812,10 @@ virVMXParseConfig(virVMXContext *ctx,
def->namespaceData = namespaceData;
}
if (virDomainDefPostParse(def, caps, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
xmlopt) < 0)
goto cleanup;
success = true;
cleanup:
......
......@@ -82,6 +82,7 @@ char *virVMXConvertToUTF8(const char *encoding, const char *string);
virDomainDefPtr virVMXParseConfig(virVMXContext *ctx,
virDomainXMLOptionPtr xmlopt,
virCapsPtr caps,
const char *vmx);
int virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
......
......@@ -78,7 +78,7 @@ testCompareFiles(const char *vmx, const char *xml)
if (virtTestLoadFile(vmx, &vmxData) < 0)
goto cleanup;
if (!(def = virVMXParseConfig(&ctx, xmlopt, vmxData)))
if (!(def = virVMXParseConfig(&ctx, xmlopt, caps, vmxData)))
goto cleanup;
if (!virDomainDefCheckABIStability(def, def)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册