}
+/**
+ * virXMLPropLongLong:
+ * @node: XML dom node pointer
+ * @name: Name of the property (attribute) to get
+ * @base: Number base, see strtol
+ * @flags: Bitwise-OR of virXMLPropFlags
+ * @result: The returned value
+ * @defaultResult: Default value of @result in case the property is not found
+ *
+ * Convenience function to return value of a long long attribute.
+ *
+ * Returns 1 in case of success in which case @result is set,
+ * or 0 if the attribute is not present,
+ * or -1 and reports an error on failure.
+ */
+int
+virXMLPropLongLong(xmlNodePtr node,
+ const char *name,
+ int base,
+ virXMLPropFlags flags,
+ long long *result,
+ long long defaultResult)
+{
+ g_autofree char *tmp = NULL;
+ long long val;
+
+ *result = defaultResult;
+
+ if (!(tmp = virXMLPropString(node, name))) {
+ if (!(flags & VIR_XML_PROP_REQUIRED))
+ return 0;
+
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Missing required attribute '%s' in element '%s'"),
+ name, node->name);
+ return -1;
+ }
+
+ if (virStrToLong_ll(tmp, NULL, base, &val) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Invalid value for attribute '%s' in element '%s': '%s'. Expected long long integer value"),
+ name, node->name, tmp);
+ return -1;
+ }
+
+ if ((flags & VIR_XML_PROP_NONNEGATIVE) && (val < 0)) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Invalid value for attribute '%s' in element '%s': '%s'. Expected non-negative value"),
+ name, node->name, tmp);
+ return -1;
+ }
+
+ if ((flags & VIR_XML_PROP_NONZERO) && (val == 0)) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Invalid value for attribute '%s' in element '%s': Zero is not permitted"),
+ name, node->name);
+ return -1;
+ }
+
+ *result = val;
+ return 1;
+}
+
+
/**
* virXMLPropULongLong:
* @node: XML dom node pointer