This patch partially reverts previous commit 91a00424 and moves the post
parse function to xenParseSxpr. This update is required because xen
driver calls xenParseSxpr directly.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/xen/xend_internal.c | 6 ++++--
src/xenconfig/xen_sxpr.c | 22 +++++++++++-----------
src/xenconfig/xen_sxpr.h | 9 +++++++--
3 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 21d99e3..a2f072b 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -1595,7 +1595,9 @@ xenDaemonDomainFetch(virConnectPtr conn, int domid, const char
*name,
priv->xendConfigVersion,
cpus,
tty,
- vncport)))
+ vncport,
+ priv->caps,
+ priv->xmlopt)))
goto cleanup;
cleanup:
@@ -3228,7 +3230,7 @@ xenDaemonDomainBlockPeek(virConnectPtr conn,
xenUnifiedUnlock(priv);
if (!(def = xenParseSxpr(root, priv->xendConfigVersion, NULL, tty,
- vncport)))
+ vncport, priv->caps, priv->xmlopt)))
goto cleanup;
if (!(actual = virDomainDiskPathByName(def, path))) {
diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c
index 49f438d..e69e91f 100644
--- a/src/xenconfig/xen_sxpr.c
+++ b/src/xenconfig/xen_sxpr.c
@@ -1087,7 +1087,11 @@ xenParseSxprPCI(virDomainDefPtr def,
virDomainDefPtr
xenParseSxpr(const struct sexpr *root,
int xendConfigVersion,
- const char *cpus, char *tty, int vncport)
+ const char *cpus,
+ char *tty,
+ int vncport,
+ virCapsPtr caps,
+ virDomainXMLOptionPtr xmlopt)
{
const char *tmp;
virDomainDefPtr def;
@@ -1475,6 +1479,10 @@ xenParseSxpr(const struct sexpr *root,
goto error;
}
+ if (virDomainDefPostParse(def, caps, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
+ xmlopt) < 0)
+ goto error;
+
return def;
error:
@@ -1511,16 +1519,8 @@ xenParseSxprString(const char *sexpr,
if (!root)
return NULL;
- if (!(def = xenParseSxpr(root, xendConfigVersion, NULL, tty, vncport)))
- goto cleanup;
-
- if (virDomainDefPostParse(def, caps, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
- xmlopt) < 0) {
- virDomainDefFree(def);
- def = NULL;
- }
-
- cleanup:
+ def = xenParseSxpr(root, xendConfigVersion, NULL, tty, vncport,
+ caps, xmlopt);
sexpr_free(root);
return def;
diff --git a/src/xenconfig/xen_sxpr.h b/src/xenconfig/xen_sxpr.h
index e42a931..36f1d1a 100644
--- a/src/xenconfig/xen_sxpr.h
+++ b/src/xenconfig/xen_sxpr.h
@@ -50,8 +50,13 @@ virDomainDefPtr xenParseSxprString(const char *sexpr,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt);
-virDomainDefPtr xenParseSxpr(const struct sexpr *root, int xendConfigVersion,
- const char *cpus, char *tty, int vncport);
+virDomainDefPtr xenParseSxpr(const struct sexpr *root,
+ int xendConfigVersion,
+ const char *cpus,
+ char *tty,
+ int vncport,
+ virCapsPtr caps,
+ virDomainXMLOptionPtr xmlopt);
int xenParseSxprSound(virDomainDefPtr def, const char *str);
--
2.6.3