[libvirt] [PATCH v2 10/12] conf: Change when virDomainDiskDefAssignAddress is called
Ján Tomko
jtomko at redhat.com
Mon Aug 3 13:49:47 UTC 2015
On Wed, Jul 22, 2015 at 10:54:32AM -0400, John Ferlan wrote:
> 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: John Ferlan <jferlan at redhat.com>
> ---
> src/conf/domain_conf.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
ACK
Jan
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index eba264d..1560823 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -4077,6 +4077,10 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev,
> disk->dst);
> 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) {
> @@ -7439,10 +7443,6 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
> }
>
> 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)
> goto error;
> }
> --
> 2.1.0
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150803/edba0c7f/attachment-0001.sig>
More information about the libvir-list
mailing list