Blame SOURCES/libvirt-conf-rename-namespace-property-of-struct-_virStorageSourceNVMeDef.patch

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