*
* @def Domain definition
* @node An XML cipher node
- * @ctxt The XML context
*
* Parse the attributes from the cipher node and store the state
* attribute in @def.
*/
static int
virDomainKeyWrapCipherDefParseXML(virDomainKeyWrapDefPtr keywrap,
- xmlNodePtr node,
- xmlXPathContextPtr ctxt)
+ xmlNodePtr node)
{
char *name = NULL;
int state_type;
int name_type;
int ret = -1;
- xmlNodePtr oldnode = ctxt->node;
- ctxt->node = node;
- if (!(name = virXPathString("string(./@name)", ctxt))) {
+ if (!(name = virXMLPropString(node, "name"))) {
virReportError(VIR_ERR_CONF_SYNTAX, "%s",
_("missing name for cipher"));
goto cleanup;
goto cleanup;
}
- if (!(state = virXPathString("string(./@state)", ctxt))) {
+ if (!(state = virXMLPropString(node, "state"))) {
virReportError(VIR_ERR_CONF_SYNTAX,
_("missing state for cipher named %s"), name);
goto cleanup;
cleanup:
VIR_FREE(name);
VIR_FREE(state);
- ctxt->node = oldnode;
return ret;
}
goto cleanup;
for (i = 0; i < n; i++) {
- if (virDomainKeyWrapCipherDefParseXML(def->keywrap, nodes[i], ctxt) < 0)
+ if (virDomainKeyWrapCipherDefParseXML(def->keywrap, nodes[i]) < 0)
goto cleanup;
}