[libvirt] [PATCH v2 10/11] domain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE
Jiri Denemark
jdenemar at redhat.com
Mon Sep 26 08:56:29 UTC 2016
On Fri, Sep 23, 2016 at 15:25:03 +0200, Michal Privoznik wrote:
> This is an internal flag that prevents our two entry points to
> XML parsing (virDomainDefParse and virDomainDeviceDefParse) from
> running post parse callbacks. This is expected to be used in
> cases when we already have full domain/device XML and we are just
> parsing it back (i.e. virDomainDefCopy or virDomainDeviceDefCopy)
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> src/conf/domain_conf.c | 8 ++++++++
> src/conf/domain_conf.h | 2 ++
> 2 files changed, 10 insertions(+)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index b11a296..bd20b74 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -4428,6 +4428,10 @@ virDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
> {
> int ret;
>
> + /* fill in configuration only in certain places */
> + if (flags & VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE)
> + return 0;
> +
> if (xmlopt->config.devicesPostParseCallback) {
> ret = xmlopt->config.devicesPostParseCallback(dev, def, caps, flags,
> xmlopt->config.priv,
> @@ -4577,6 +4581,10 @@ virDomainDefPostParse(virDomainDefPtr def,
> .parseOpaque = parseOpaque,
> };
>
> + /* fill in configuration only in certain places */
> + if (parseFlags & VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE)
> + return 0;
> +
The comments are rather useless.
ACK if you remove them.
Jirka
More information about the libvir-list
mailing list