mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: rename 'namespace' property of struct _virStorageSourceNVMeDef
While 'namespace' is not a reserved word in C, it is in C++. Our compilers are happy with it but syntax-hilighting in some editors hilights is as a keyword. Rename it to prevent confusion. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
75a4ec42f7
commit
5793b8baa7
@ -6087,7 +6087,7 @@ virDomainDiskDefValidate(const virDomainDef *def,
|
|||||||
|
|
||||||
if (disk->src->type == VIR_STORAGE_TYPE_NVME) {
|
if (disk->src->type == VIR_STORAGE_TYPE_NVME) {
|
||||||
/* NVMe namespaces start from 1 */
|
/* NVMe namespaces start from 1 */
|
||||||
if (disk->src->nvme->namespace == 0) {
|
if (disk->src->nvme->namespc == 0) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("NVMe namespace can't be zero"));
|
_("NVMe namespace can't be zero"));
|
||||||
return -1;
|
return -1;
|
||||||
@ -9533,7 +9533,7 @@ 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 *namespace = NULL;
|
g_autofree char *namespc = NULL;
|
||||||
g_autofree char *managed = NULL;
|
g_autofree char *managed = NULL;
|
||||||
xmlNodePtr address;
|
xmlNodePtr address;
|
||||||
|
|
||||||
@ -9552,16 +9552,16 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(namespace = virXMLPropString(node, "namespace"))) {
|
if (!(namespc = virXMLPropString(node, "namespace"))) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("missing 'namespace' attribute to disk source"));
|
_("missing 'namespace' attribute to disk source"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virStrToLong_ull(namespace, NULL, 10, &nvme->namespace) < 0) {
|
if (virStrToLong_ull(namespc, NULL, 10, &nvme->namespc) < 0) {
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
_("malformed namespace '%s'"),
|
_("malformed namespace '%s'"),
|
||||||
namespace);
|
namespc);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24689,7 +24689,7 @@ virDomainDiskSourceNVMeFormat(virBufferPtr attrBuf,
|
|||||||
virBufferAddLit(attrBuf, " type='pci'");
|
virBufferAddLit(attrBuf, " type='pci'");
|
||||||
virBufferAsprintf(attrBuf, " managed='%s'",
|
virBufferAsprintf(attrBuf, " managed='%s'",
|
||||||
virTristateBoolTypeToString(nvme->managed));
|
virTristateBoolTypeToString(nvme->managed));
|
||||||
virBufferAsprintf(attrBuf, " namespace='%llu'", nvme->namespace);
|
virBufferAsprintf(attrBuf, " namespace='%llu'", nvme->namespc);
|
||||||
virPCIDeviceAddressFormat(childBuf, nvme->pciAddr, false);
|
virPCIDeviceAddressFormat(childBuf, nvme->pciAddr, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2212,7 +2212,7 @@ virHostdevGetNVMeDeviceList(virNVMeDeviceListPtr nvmeDevices,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(dev = virNVMeDeviceNew(&srcNVMe->pciAddr,
|
if (!(dev = virNVMeDeviceNew(&srcNVMe->pciAddr,
|
||||||
srcNVMe->namespace,
|
srcNVMe->namespc,
|
||||||
srcNVMe->managed)))
|
srcNVMe->managed)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -1008,7 +1008,7 @@ qemuBlockStorageSourceGetNVMeProps(virStorageSourcePtr src)
|
|||||||
ignore_value(virJSONValueObjectCreate(&ret,
|
ignore_value(virJSONValueObjectCreate(&ret,
|
||||||
"s:driver", "nvme",
|
"s:driver", "nvme",
|
||||||
"s:device", pciAddr,
|
"s:device", pciAddr,
|
||||||
"U:namespace", nvme->namespace,
|
"U:namespace", nvme->namespc,
|
||||||
NULL));
|
NULL));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2052,7 +2052,7 @@ virStorageSourceNVMeDefCopy(const virStorageSourceNVMeDef *src)
|
|||||||
|
|
||||||
ret = g_new0(virStorageSourceNVMeDef, 1);
|
ret = g_new0(virStorageSourceNVMeDef, 1);
|
||||||
|
|
||||||
ret->namespace = src->namespace;
|
ret->namespc = src->namespc;
|
||||||
ret->managed = src->managed;
|
ret->managed = src->managed;
|
||||||
virPCIDeviceAddressCopy(&ret->pciAddr, &src->pciAddr);
|
virPCIDeviceAddressCopy(&ret->pciAddr, &src->pciAddr);
|
||||||
return ret;
|
return ret;
|
||||||
@ -2069,7 +2069,7 @@ virStorageSourceNVMeDefIsEqual(const virStorageSourceNVMeDef *a,
|
|||||||
if (!a || !b)
|
if (!a || !b)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (a->namespace != b->namespace ||
|
if (a->namespc != b->namespc ||
|
||||||
a->managed != b->managed ||
|
a->managed != b->managed ||
|
||||||
!virPCIDeviceAddressEqual(&a->pciAddr, &b->pciAddr))
|
!virPCIDeviceAddressEqual(&a->pciAddr, &b->pciAddr))
|
||||||
return false;
|
return false;
|
||||||
|
@ -245,7 +245,7 @@ struct _virStorageSourceInitiatorDef {
|
|||||||
typedef struct _virStorageSourceNVMeDef virStorageSourceNVMeDef;
|
typedef struct _virStorageSourceNVMeDef virStorageSourceNVMeDef;
|
||||||
typedef virStorageSourceNVMeDef *virStorageSourceNVMeDefPtr;
|
typedef virStorageSourceNVMeDef *virStorageSourceNVMeDefPtr;
|
||||||
struct _virStorageSourceNVMeDef {
|
struct _virStorageSourceNVMeDef {
|
||||||
unsigned long long namespace;
|
unsigned long long namespc;
|
||||||
int managed; /* enum virTristateBool */
|
int managed; /* enum virTristateBool */
|
||||||
virPCIDeviceAddress pciAddr;
|
virPCIDeviceAddress pciAddr;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user