mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
virQEMUCapsLoadCache: Use 'virXMLPropUInt' instead of 'virXPathULong'
The libvirt version is stored in an 'unsigned int' use the proper XPath query function for the type and remove the temporary variable. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
5ff3e29d44
commit
a3c7426839
@ -4385,7 +4385,6 @@ virQEMUCapsLoadCache(virArch hostArch,
|
||||
g_autoptr(xmlDoc) doc = NULL;
|
||||
g_autoptr(xmlXPathContext) ctxt = NULL;
|
||||
long long int l;
|
||||
unsigned long lu;
|
||||
|
||||
if (!(doc = virXMLParse(filename, NULL, NULL, "qemuCaps", &ctxt, NULL, false)))
|
||||
return -1;
|
||||
@ -4397,9 +4396,9 @@ virQEMUCapsLoadCache(virArch hostArch,
|
||||
}
|
||||
qemuCaps->libvirtCtime = (time_t)l;
|
||||
|
||||
qemuCaps->libvirtVersion = 0;
|
||||
if (virXPathULong("string(./selfvers)", ctxt, &lu) == 0)
|
||||
qemuCaps->libvirtVersion = lu;
|
||||
if (virXMLPropUInt(ctxt->node, "selfvers", 10, VIR_XML_PROP_NONE,
|
||||
&qemuCaps->libvirtVersion) < 0)
|
||||
return -1;
|
||||
|
||||
if (!skipInvalidation &&
|
||||
(qemuCaps->libvirtCtime != virGetSelfLastChanged() ||
|
||||
|
Loading…
Reference in New Issue
Block a user