virDomainDefParseNode(xmlDocPtr xml,
                      xmlNodePtr root,
                      virDomainXMLOptionPtr xmlopt,
                      void *parseOpaque,
                      unsigned int flags)
{
    g_autoptr(xmlXPathContext) ctxt = NULL;
    g_autoptr(virDomainDef) def = NULL;

    if (!(ctxt = virXMLXPathContextNew(xml)))
        return NULL;

    ctxt->node = root;

    if (!(def = virDomainDefParseXML(xml, ctxt, xmlopt, flags)))
        return NULL;

    /* callback to fill driver specific domain aspects */
    if (virDomainDefPostParse(def, flags, xmlopt, parseOpaque) < 0)
        return NULL;

    /* validate configuration */
    if (virDomainDefValidate(def, flags, xmlopt) < 0)
        return NULL;

    return g_steal_pointer(&def);
}
virDomainDefParseNode(xmlDocPtr xml,
                      xmlNodePtr root,
                      virDomainXMLOptionPtr xmlopt,
                      void *parseOpaque,
                      unsigned int flags)
{
    g_autoptr(xmlXPathContext) ctxt = NULL;
    g_autoptr(virDomainDef) def = NULL;

    if (!(ctxt = virXMLXPathContextNew(xml)))
        return NULL;

    ctxt->node = root;

    if (!(def = virDomainDefParseXML(xml, ctxt, xmlopt, flags)))
        return NULL;

     
    if (virDomainDefPostParse(def, flags, xmlopt, parseOpaque) < 0)
        return NULL;

     
    if (virDomainDefValidate(def, flags, xmlopt) < 0)
        return NULL;

    return g_steal_pointer(&def);
}