[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 13/24] util: storagefile: rename 'nodebacking' to 'nodestorage' in virStorageSource



Make it less confusing by naming the field which refers to the storage
object as 'nodestorage'.
---
 src/qemu/qemu_block.c     | 10 +++++-----
 src/qemu/qemu_driver.c    | 10 +++++-----
 src/util/virstoragefile.c |  6 +++---
 src/util/virstoragefile.h |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 3afcbde94..dc96a43e1 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -305,7 +305,7 @@ qemuBlockDiskClearDetectedNodes(virDomainDiskDefPtr disk)

     while (next) {
         VIR_FREE(next->nodeformat);
-        VIR_FREE(next->nodebacking);
+        VIR_FREE(next->nodestorage);

         next = next->backingStore;
     }
@@ -321,22 +321,22 @@ qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk,
     virStorageSourcePtr src = disk->src;

     /* don't attempt the detection if the top level already has node names */
-    if (!parentnode || src->nodeformat || src->nodebacking)
+    if (!parentnode || src->nodeformat || src->nodestorage)
         return 0;

     while (src && parentnode) {
         if (!(entry = virHashLookup(table, parentnode)))
             break;

-        if (src->nodeformat || src->nodebacking) {
+        if (src->nodeformat || src->nodestorage) {
             if (STRNEQ_NULLABLE(src->nodeformat, entry->nodeformat) ||
-                STRNEQ_NULLABLE(src->nodebacking, entry->nodestorage))
+                STRNEQ_NULLABLE(src->nodestorage, entry->nodestorage))
                 goto error;

             break;
         } else {
             if (VIR_STRDUP(src->nodeformat, entry->nodeformat) < 0 ||
-                VIR_STRDUP(src->nodebacking, entry->nodestorage) < 0)
+                VIR_STRDUP(src->nodestorage, entry->nodestorage) < 0)
                 goto error;
         }

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9c54571cf..fe65b5776 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -19492,8 +19492,8 @@ qemuDomainGetStatsOneBlockNode(virDomainStatsRecordPtr record,
     unsigned long long tmp;
     int ret = -1;

-    if (src->nodebacking &&
-        (data = virHashLookup(nodedata, src->nodebacking))) {
+    if (src->nodestorage &&
+        (data = virHashLookup(nodedata, src->nodestorage))) {
         if (virJSONValueObjectGetNumberUlong(data, "write_threshold", &tmp) == 0 &&
             tmp > 0)
             QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx,
@@ -20676,18 +20676,18 @@ qemuDomainSetBlockThreshold(virDomainPtr dom,
     if (!(src = qemuDomainGetStorageSourceByDevstr(dev, vm->def)))
         goto endjob;

-    if (!src->nodebacking &&
+    if (!src->nodestorage &&
         qemuBlockNodeNamesDetect(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
         goto endjob;

-    if (!src->nodebacking) {
+    if (!src->nodestorage) {
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("threshold currently can't be set for block device '%s'"),
                        dev);
         goto endjob;
     }

-    if (VIR_STRDUP(nodename, src->nodebacking) < 0)
+    if (VIR_STRDUP(nodename, src->nodestorage) < 0)
         goto endjob;

     qemuDomainObjEnterMonitor(driver, vm);
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 0add4c146..fbc8245f3 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2050,7 +2050,7 @@ virStorageSourceCopy(const virStorageSource *src,
         VIR_STRDUP(ret->snapshot, src->snapshot) < 0 ||
         VIR_STRDUP(ret->configFile, src->configFile) < 0 ||
         VIR_STRDUP(ret->nodeformat, src->nodeformat) < 0 ||
-        VIR_STRDUP(ret->nodebacking, src->nodebacking) < 0 ||
+        VIR_STRDUP(ret->nodestorage, src->nodestorage) < 0 ||
         VIR_STRDUP(ret->compat, src->compat) < 0)
         goto error;

@@ -2271,7 +2271,7 @@ virStorageSourceClear(virStorageSourcePtr def)
     virStorageNetHostDefFree(def->nhosts, def->hosts);
     virStorageAuthDefFree(def->auth);

-    VIR_FREE(def->nodebacking);
+    VIR_FREE(def->nodestorage);
     VIR_FREE(def->nodeformat);

     virStorageSourceBackingStoreClear(def);
@@ -3941,7 +3941,7 @@ virStorageSourceFindByNodeName(virStorageSourcePtr top,

     for (tmp = top; tmp; tmp = tmp->backingStore) {
         if ((tmp->nodeformat && STREQ(tmp->nodeformat, nodeName)) ||
-            (tmp->nodebacking && STREQ(tmp->nodebacking, nodeName)))
+            (tmp->nodestorage && STREQ(tmp->nodestorage, nodeName)))
             return tmp;

         if (idx)
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index d1e8ffe07..6c388b1a5 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -279,7 +279,7 @@ struct _virStorageSource {

     /* metadata that allows identifying given storage source */
     char *nodeformat;  /* name of the format handler object */
-    char *nodebacking; /* name of the backing storage object */
+    char *nodestorage; /* name of the storage object */
 };


-- 
2.13.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]