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@xxxxxxxxxx> --- src/xen/xend_internal.c | 7 +++++-- src/xenconfig/xen_sxpr.c | 21 ++++++++++----------- src/xenconfig/xen_sxpr.h | 6 +++++- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index db3820d..cf7cdd0 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -1552,7 +1552,9 @@ xenDaemonDomainFetch(virConnectPtr conn, int domid, const char *name, if (!(def = xenParseSxpr(root, cpus, tty, - vncport))) + vncport, + priv->caps, + priv->xmlopt))) goto cleanup; cleanup: @@ -3082,7 +3084,8 @@ xenDaemonDomainBlockPeek(virConnectPtr conn, vncport = xenStoreDomainGetVNCPort(conn, id); xenUnifiedUnlock(priv); - if (!(def = xenParseSxpr(root, NULL, tty, vncport))) + if (!(def = xenParseSxpr(root, NULL, tty, 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 d99bac0..d7b700d 100644 --- a/src/xenconfig/xen_sxpr.c +++ b/src/xenconfig/xen_sxpr.c @@ -1065,7 +1065,11 @@ xenParseSxprPCI(virDomainDefPtr def, */ virDomainDefPtr xenParseSxpr(const struct sexpr *root, - const char *cpus, char *tty, int vncport) + const char *cpus, + char *tty, + int vncport, + virCapsPtr caps, + virDomainXMLOptionPtr xmlopt) { const char *tmp; virDomainDefPtr def; @@ -1371,6 +1375,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: @@ -1405,16 +1413,7 @@ xenParseSxprString(const char *sexpr, if (!root) return NULL; - if (!(def = xenParseSxpr(root, 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, 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 a4f4c44..e925208 100644 --- a/src/xenconfig/xen_sxpr.h +++ b/src/xenconfig/xen_sxpr.h @@ -43,7 +43,11 @@ virDomainDefPtr xenParseSxprString(const char *sexpr, virDomainXMLOptionPtr xmlopt); virDomainDefPtr xenParseSxpr(const struct sexpr *root, - const char *cpus, char *tty, int vncport); + const char *cpus, + char *tty, + int vncport, + virCapsPtr caps, + virDomainXMLOptionPtr xmlopt); int xenParseSxprSound(virDomainDefPtr def, const char *str); -- 2.7.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list