]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Sep 2016 11:59:52 +0000 (13:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 26 Sep 2016 14:50:12 +0000 (16:50 +0200)
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@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h

index b11a2965ae2cf1cf26a672cd23c6ad4e34b263cb..a8c4999b9e643a86d917f4381e881d896973f35b 100644 (file)
@@ -4428,6 +4428,9 @@ virDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
 {
     int ret;
 
+    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 +4580,9 @@ virDomainDefPostParse(virDomainDefPtr def,
         .parseOpaque = parseOpaque,
     };
 
+    if (parseFlags & VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE)
+        return 0;
+
     /* this must be done before the hypervisor-specific callback,
      * in case presence of a controller at a specific index is checked
      */
index 7a2d62825d146df547130dcd580f45faf7832be9..d2065cf3edeac790c9a7d1a0dd51f780367ece3e 100644 (file)
@@ -2645,6 +2645,8 @@ typedef enum {
     VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 9,
     /* skip definition validation checks meant to be executed on define time only */
     VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 10,
+    /* skip post parse callback */
+    VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE = 1 << 11,
 } virDomainDefParseFlags;
 
 typedef enum {