mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virNodeDevCapsDefParseULong: Use virXPathUInt instead of virXPathULong
Fix the function argument to properly spell out 'unsigned int' and use virXPathUInt instead of virXPathULong and a temporary value. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a3f7165889
commit
f7281dd014
@ -833,15 +833,14 @@ virNodeDevCapsDefParseIntOptional(const char *xpath,
|
|||||||
static int
|
static int
|
||||||
virNodeDevCapsDefParseULong(const char *xpath,
|
virNodeDevCapsDefParseULong(const char *xpath,
|
||||||
xmlXPathContextPtr ctxt,
|
xmlXPathContextPtr ctxt,
|
||||||
unsigned *value,
|
unsigned int *value,
|
||||||
virNodeDeviceDef *def,
|
virNodeDeviceDef *def,
|
||||||
const char *missing_error_fmt,
|
const char *missing_error_fmt,
|
||||||
const char *invalid_error_fmt)
|
const char *invalid_error_fmt)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned long val;
|
|
||||||
|
|
||||||
ret = virXPathULong(xpath, ctxt, &val);
|
ret = virXPathUInt(xpath, ctxt, value);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
ret == -1 ? missing_error_fmt : invalid_error_fmt,
|
ret == -1 ? missing_error_fmt : invalid_error_fmt,
|
||||||
@ -849,7 +848,6 @@ virNodeDevCapsDefParseULong(const char *xpath,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
*value = val;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user