mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
virDomainBackupDefParse: Use virXMLProp*
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
14c803cb82
commit
deac783c86
@ -222,8 +222,6 @@ virDomainBackupDefParse(xmlXPathContextPtr ctxt,
|
|||||||
def->incremental = virXPathString("string(./incremental)", ctxt);
|
def->incremental = virXPathString("string(./incremental)", ctxt);
|
||||||
|
|
||||||
if ((node = virXPathNode("./server", ctxt))) {
|
if ((node = virXPathNode("./server", ctxt))) {
|
||||||
g_autofree char *tls = NULL;
|
|
||||||
|
|
||||||
if (def->type != VIR_DOMAIN_BACKUP_TYPE_PULL) {
|
if (def->type != VIR_DOMAIN_BACKUP_TYPE_PULL) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("use of <server> requires pull mode backup"));
|
_("use of <server> requires pull mode backup"));
|
||||||
@ -249,18 +247,9 @@ virDomainBackupDefParse(xmlXPathContextPtr ctxt,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tls = virXMLPropString(node, "tls"))) {
|
if (virXMLPropTristateBool(node, "tls", VIR_XML_PROP_NONE,
|
||||||
int tmp;
|
&def->tls) < 0)
|
||||||
|
return NULL;
|
||||||
if ((tmp = virTristateBoolTypeFromString(tls)) <= 0) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
|
||||||
_("unknown value '%s' of 'tls' attribute"),\
|
|
||||||
tls);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
def->tls = tmp;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((n = virXPathNodeSet("./disks/*", ctxt, &nodes)) < 0)
|
if ((n = virXPathNodeSet("./disks/*", ctxt, &nodes)) < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user