提交 e1dbce15 编写于 作者: J John Ferlan

conf: Change when virDomainDiskDefAssignAddress is called

Rather than calling virDomainDiskDefAssignAddress during the parsing of
the XML, moving the setting of disk addresses into the domain/device post
processing.

Commit id '37588b25' which introduced VIR_DOMAIN_DEF_PARSE_DISK_SOURCE
in order to avoid generating the address which wasn't required will not
be affected by this as all it cared about was processing the source XML.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 9bcdb210
...@@ -4109,6 +4109,10 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, ...@@ -4109,6 +4109,10 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev,
disk->dst); disk->dst);
return -1; return -1;
} }
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
virDomainDiskDefAssignAddress(xmlopt, disk) < 0)
return -1;
} }
if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) {
...@@ -7471,10 +7475,6 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, ...@@ -7471,10 +7475,6 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
} }
if (!(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) { if (!(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) {
if (def->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE
&& virDomainDiskDefAssignAddress(xmlopt, def) < 0)
goto error;
if (virDomainDiskBackingStoreParse(ctxt, def->src) < 0) if (virDomainDiskBackingStoreParse(ctxt, def->src) < 0)
goto error; goto error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册