mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
virDomainDiskSourceNVMeParse: Use virXMLPropULongLong()
Inside of virDomainDiskSourceNVMeParse() we have virXMLPropString() + virStrToLong_ull() combo. Switch to virXMLPropULongLong() which does the same thing. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
452695926d
commit
5bddeb8e37
@ -7229,7 +7229,6 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
|
|||||||
{
|
{
|
||||||
g_autoptr(virStorageSourceNVMeDef) nvme = NULL;
|
g_autoptr(virStorageSourceNVMeDef) nvme = NULL;
|
||||||
g_autofree char *type = NULL;
|
g_autofree char *type = NULL;
|
||||||
g_autofree char *namespc = NULL;
|
|
||||||
xmlNodePtr address;
|
xmlNodePtr address;
|
||||||
|
|
||||||
nvme = g_new0(virStorageSourceNVMeDef, 1);
|
nvme = g_new0(virStorageSourceNVMeDef, 1);
|
||||||
@ -7247,16 +7246,9 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(namespc = virXMLPropString(node, "namespace"))) {
|
if (virXMLPropULongLong(node, "namespace", 10,
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
VIR_XML_PROP_REQUIRED,
|
||||||
_("missing 'namespace' attribute to disk source"));
|
&nvme->namespc) < 0) {
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (virStrToLong_ull(namespc, NULL, 10, &nvme->namespc) < 0) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
|
||||||
_("malformed namespace '%1$s'"),
|
|
||||||
namespc);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user