render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 9b070e02e7b5bb95728a1fcdc8b7dfaaacc5f30a Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <9b070e02e7b5bb95728a1fcdc8b7dfaaacc5f30a@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 24 Mar 2020 16:25:55 +0100
fbe740
Subject: [PATCH] conf: rename 'namespace' property of struct
fbe740
 _virStorageSourceNVMeDef
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
While 'namespace' is not a reserved word in C, it is in C++. Our
fbe740
compilers are happy with it but syntax-hilighting in some editors
fbe740
hilights is as a keyword. Rename it to prevent confusion.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
fbe740
(cherry picked from commit 5793b8baa75747860f6ba97470969047e60c8579)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804617
fbe740
Message-Id: <bfe6cf10a95868ae56a91f362a1ea50667754027.1585063415.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/conf/domain_conf.c    | 12 ++++++------
fbe740
 src/qemu/qemu_block.c     |  2 +-
fbe740
 src/util/virhostdev.c     |  2 +-
fbe740
 src/util/virstoragefile.c |  4 ++--
fbe740
 src/util/virstoragefile.h |  2 +-
fbe740
 5 files changed, 11 insertions(+), 11 deletions(-)
fbe740
fbe740
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
fbe740
index 8aec85e83c..1e8518139c 100644
fbe740
--- a/src/conf/domain_conf.c
fbe740
+++ b/src/conf/domain_conf.c
fbe740
@@ -6054,7 +6054,7 @@ virDomainDiskDefValidate(const virDomainDef *def,
fbe740
 
fbe740
     if (disk->src->type == VIR_STORAGE_TYPE_NVME) {
fbe740
         /* NVMe namespaces start from 1 */
fbe740
-        if (disk->src->nvme->namespace == 0) {
fbe740
+        if (disk->src->nvme->namespc == 0) {
fbe740
             virReportError(VIR_ERR_XML_ERROR, "%s",
fbe740
                            _("NVMe namespace can't be zero"));
fbe740
             return -1;
fbe740
@@ -9433,7 +9433,7 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
fbe740
 {
fbe740
     g_autoptr(virStorageSourceNVMeDef) nvme = NULL;
fbe740
     g_autofree char *type = NULL;
fbe740
-    g_autofree char *namespace = NULL;
fbe740
+    g_autofree char *namespc = NULL;
fbe740
     g_autofree char *managed = NULL;
fbe740
     xmlNodePtr address;
fbe740
 
fbe740
@@ -9452,16 +9452,16 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
fbe740
         return -1;
fbe740
     }
fbe740
 
fbe740
-    if (!(namespace = virXMLPropString(node, "namespace"))) {
fbe740
+    if (!(namespc = virXMLPropString(node, "namespace"))) {
fbe740
         virReportError(VIR_ERR_XML_ERROR, "%s",
fbe740
                        _("missing 'namespace' attribute to disk source"));
fbe740
         return -1;
fbe740
     }
fbe740
 
fbe740
-    if (virStrToLong_ull(namespace, NULL, 10, &nvme->namespace) < 0) {
fbe740
+    if (virStrToLong_ull(namespc, NULL, 10, &nvme->namespc) < 0) {
fbe740
         virReportError(VIR_ERR_XML_ERROR,
fbe740
                        _("malformed namespace '%s'"),
fbe740
-                       namespace);
fbe740
+                       namespc);
fbe740
         return -1;
fbe740
     }
fbe740
 
fbe740
@@ -24444,7 +24444,7 @@ virDomainDiskSourceNVMeFormat(virBufferPtr attrBuf,
fbe740
     virBufferAddLit(attrBuf, " type='pci'");
fbe740
     virBufferAsprintf(attrBuf, " managed='%s'",
fbe740
                       virTristateBoolTypeToString(nvme->managed));
fbe740
-    virBufferAsprintf(attrBuf, " namespace='%llu'", nvme->namespace);
fbe740
+    virBufferAsprintf(attrBuf, " namespace='%llu'", nvme->namespc);
fbe740
     virPCIDeviceAddressFormat(childBuf, nvme->pciAddr, false);
fbe740
 }
fbe740
 
fbe740
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
fbe740
index 73cb5ba4bc..5697d4fc73 100644
fbe740
--- a/src/qemu/qemu_block.c
fbe740
+++ b/src/qemu/qemu_block.c
fbe740
@@ -1008,7 +1008,7 @@ qemuBlockStorageSourceGetNVMeProps(virStorageSourcePtr src)
fbe740
     ignore_value(virJSONValueObjectCreate(&ret,
fbe740
                                           "s:driver", "nvme",
fbe740
                                           "s:device", pciAddr,
fbe740
-                                          "U:namespace", nvme->namespace,
fbe740
+                                          "U:namespace", nvme->namespc,
fbe740
                                           NULL));
fbe740
     return ret;
fbe740
 }
fbe740
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
fbe740
index 9b4ea30216..9596482146 100644
fbe740
--- a/src/util/virhostdev.c
fbe740
+++ b/src/util/virhostdev.c
fbe740
@@ -2256,7 +2256,7 @@ virHostdevGetNVMeDeviceList(virNVMeDeviceListPtr nvmeDevices,
fbe740
             continue;
fbe740
 
fbe740
         if (!(dev = virNVMeDeviceNew(&srcNVMe->pciAddr,
fbe740
-                                     srcNVMe->namespace,
fbe740
+                                     srcNVMe->namespc,
fbe740
                                      srcNVMe->managed)))
fbe740
             return -1;
fbe740
 
fbe740
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
fbe740
index fa37840532..2e54620139 100644
fbe740
--- a/src/util/virstoragefile.c
fbe740
+++ b/src/util/virstoragefile.c
fbe740
@@ -2052,7 +2052,7 @@ virStorageSourceNVMeDefCopy(const virStorageSourceNVMeDef *src)
fbe740
 
fbe740
     ret = g_new0(virStorageSourceNVMeDef, 1);
fbe740
 
fbe740
-    ret->namespace = src->namespace;
fbe740
+    ret->namespc = src->namespc;
fbe740
     ret->managed = src->managed;
fbe740
     virPCIDeviceAddressCopy(&ret->pciAddr, &src->pciAddr);
fbe740
     return ret;
fbe740
@@ -2069,7 +2069,7 @@ virStorageSourceNVMeDefIsEqual(const virStorageSourceNVMeDef *a,
fbe740
     if (!a || !b)
fbe740
         return false;
fbe740
 
fbe740
-    if (a->namespace != b->namespace ||
fbe740
+    if (a->namespc != b->namespc ||
fbe740
         a->managed != b->managed ||
fbe740
         !virPCIDeviceAddressEqual(&a->pciAddr, &b->pciAddr))
fbe740
         return false;
fbe740
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
fbe740
index c1430cadd1..0230f44652 100644
fbe740
--- a/src/util/virstoragefile.h
fbe740
+++ b/src/util/virstoragefile.h
fbe740
@@ -246,7 +246,7 @@ struct _virStorageSourceInitiatorDef {
fbe740
 typedef struct _virStorageSourceNVMeDef virStorageSourceNVMeDef;
fbe740
 typedef virStorageSourceNVMeDef *virStorageSourceNVMeDefPtr;
fbe740
 struct _virStorageSourceNVMeDef {
fbe740
-    unsigned long long namespace;
fbe740
+    unsigned long long namespc;
fbe740
     int managed; /* enum virTristateBool */
fbe740
     virPCIDeviceAddress pciAddr;
fbe740
 
fbe740
-- 
fbe740
2.26.0
fbe740