提交 5793b8ba 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 75a4ec42
......@@ -6087,7 +6087,7 @@ virDomainDiskDefValidate(const virDomainDef *def,
if (disk->src->type == VIR_STORAGE_TYPE_NVME) {
/* NVMe namespaces start from 1 */
if (disk->src->nvme->namespace == 0) {
if (disk->src->nvme->namespc == 0) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("NVMe namespace can't be zero"));
return -1;
......@@ -9533,7 +9533,7 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
{
g_autoptr(virStorageSourceNVMeDef) nvme = NULL;
g_autofree char *type = NULL;
g_autofree char *namespace = NULL;
g_autofree char *namespc = NULL;
g_autofree char *managed = NULL;
xmlNodePtr address;
......@@ -9552,16 +9552,16 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
return -1;
}
if (!(namespace = virXMLPropString(node, "namespace"))) {
if (!(namespc = virXMLPropString(node, "namespace"))) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing 'namespace' attribute to disk source"));
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,
_("malformed namespace '%s'"),
namespace);
namespc);
return -1;
}
......@@ -24689,7 +24689,7 @@ virDomainDiskSourceNVMeFormat(virBufferPtr attrBuf,
virBufferAddLit(attrBuf, " type='pci'");
virBufferAsprintf(attrBuf, " managed='%s'",
virTristateBoolTypeToString(nvme->managed));
virBufferAsprintf(attrBuf, " namespace='%llu'", nvme->namespace);
virBufferAsprintf(attrBuf, " namespace='%llu'", nvme->namespc);
virPCIDeviceAddressFormat(childBuf, nvme->pciAddr, false);
}
......
......@@ -2212,7 +2212,7 @@ virHostdevGetNVMeDeviceList(virNVMeDeviceListPtr nvmeDevices,
continue;
if (!(dev = virNVMeDeviceNew(&srcNVMe->pciAddr,
srcNVMe->namespace,
srcNVMe->namespc,
srcNVMe->managed)))
return -1;
......
......@@ -1008,7 +1008,7 @@ qemuBlockStorageSourceGetNVMeProps(virStorageSourcePtr src)
ignore_value(virJSONValueObjectCreate(&ret,
"s:driver", "nvme",
"s:device", pciAddr,
"U:namespace", nvme->namespace,
"U:namespace", nvme->namespc,
NULL));
return ret;
}
......
......@@ -2052,7 +2052,7 @@ virStorageSourceNVMeDefCopy(const virStorageSourceNVMeDef *src)
ret = g_new0(virStorageSourceNVMeDef, 1);
ret->namespace = src->namespace;
ret->namespc = src->namespc;
ret->managed = src->managed;
virPCIDeviceAddressCopy(&ret->pciAddr, &src->pciAddr);
return ret;
......@@ -2069,7 +2069,7 @@ virStorageSourceNVMeDefIsEqual(const virStorageSourceNVMeDef *a,
if (!a || !b)
return false;
if (a->namespace != b->namespace ||
if (a->namespc != b->namespc ||
a->managed != b->managed ||
!virPCIDeviceAddressEqual(&a->pciAddr, &b->pciAddr))
return false;
......
......@@ -245,7 +245,7 @@ struct _virStorageSourceInitiatorDef {
typedef struct _virStorageSourceNVMeDef virStorageSourceNVMeDef;
typedef virStorageSourceNVMeDef *virStorageSourceNVMeDefPtr;
struct _virStorageSourceNVMeDef {
unsigned long long namespace;
unsigned long long namespc;
int managed; /* enum virTristateBool */
virPCIDeviceAddress pciAddr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册