[PATCH 15/18] util: virstoragefile: Rename backingMeta to backingStore

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

 



To conform with the naming of the planed XML output rename the metadata
variable name.

s/backingMeta/backingStore/g
---
 src/conf/domain_conf.c    |  6 +++---
 src/qemu/qemu_driver.c    |  8 ++++----
 src/util/virstoragefile.c | 12 +++++------
 src/util/virstoragefile.h |  2 +-
 tests/virstoragetest.c    | 52 +++++++++++++++++++++++------------------------
 5 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 695d7ec..d9c4485 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -18567,9 +18567,9 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
         goto cleanup;
     /* XXX: temporarily we need to select the second element of the backing
      * chain to start as the first is the copy of the disk itself. */
-    tmp = disk->backingChain ? disk->backingChain->backingMeta : NULL;
+    tmp = disk->backingChain ? disk->backingChain->backingStore : NULL;
     while (tmp && virStorageIsFile(tmp->path)) {
-        if (!ignoreOpenFailure && tmp->backingStoreRaw && !tmp->backingMeta) {
+        if (!ignoreOpenFailure && tmp->backingStoreRaw && !tmp->backingStore) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("unable to visit backing chain file %s"),
                            tmp->backingStoreRaw);
@@ -18577,7 +18577,7 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
         }
         if (iter(disk, tmp->path, ++depth, opaque) < 0)
             goto cleanup;
-        tmp = tmp->backingMeta;
+        tmp = tmp->backingStore;
     }

     ret = 0;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8005213..339b231 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15134,7 +15134,7 @@ qemuDomainBlockCopy(virDomainObjPtr vm,

     if ((flags & VIR_DOMAIN_BLOCK_REBASE_SHALLOW) &&
         STREQ_NULLABLE(format, "raw") &&
-        disk->backingChain->backingMeta->path) {
+        disk->backingChain->backingStore->path) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("disk '%s' has backing file, so raw shallow copy "
                          "is not possible"),
@@ -15347,14 +15347,14 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
                                                        &top_parent))) {
         goto endjob;
     }
-    if (!top_meta || !top_meta->backingMeta) {
+    if (!top_meta || !top_meta->backingStore) {
         virReportError(VIR_ERR_INVALID_ARG,
                        _("top '%s' in chain for '%s' has no backing file"),
                        top_canon, path);
         goto endjob;
     }
     if (!base && (flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW))
-        base_canon = top_meta->backingMeta->path;
+        base_canon = top_meta->backingStore->path;
     else if (!(base_canon = virStorageFileChainLookup(top_meta,
                                                       base, NULL, NULL)))
         goto endjob;
@@ -15363,7 +15363,7 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
      * virStorageFileChainLookup guarantees a simple pointer
      * comparison will work, rather than needing full-blown STREQ.  */
     if ((flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) &&
-        base_canon != top_meta->backingMeta->path) {
+        base_canon != top_meta->backingStore->path) {
         virReportError(VIR_ERR_INVALID_ARG,
                        _("base '%s' is not immediately below '%s' in chain "
                          "for '%s'"),
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index db6b02c..37cda8e 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1197,7 +1197,7 @@ virStorageFileGetMetadataRecurse(const char *path, const char *canonPath,
             /* If we failed to get backing data, mark the chain broken */
             virStorageSourceFree(backing);
         } else {
-            meta->backingMeta = backing;
+            meta->backingStore = backing;
         }
     }

@@ -1291,10 +1291,10 @@ virStorageFileChainGetBroken(virStorageSourcePtr chain,
     if (!chain)
         return 0;

-    for (tmp = chain; tmp; tmp = tmp->backingMeta) {
+    for (tmp = chain; tmp; tmp = tmp->backingStore) {
         /* Break when we hit end of chain; report error if we detected
          * a missing backing file, infinite loop, or other error */
-        if (!tmp->backingMeta && tmp->backingStoreRaw) {
+        if (!tmp->backingStore && tmp->backingStoreRaw) {
             if (VIR_STRDUP(*brokenFile, tmp->backingStoreRaw) < 0)
                 return -1;

@@ -1522,7 +1522,7 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
     *parent = NULL;
     while (chain) {
         if (!name) {
-            if (!chain->backingMeta)
+            if (!chain->backingStore)
                 break;
         } else {
             if (STREQ(name, chain->relPath))
@@ -1539,7 +1539,7 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
         }
         *parent = chain->path;
         parentDir = chain->relDir;
-        chain = chain->backingMeta;
+        chain = chain->backingStore;
     }
     if (!chain)
         goto error;
@@ -1694,7 +1694,7 @@ virStorageSourceClear(virStorageSourcePtr def)
     VIR_FREE(def->backingStoreRaw);

     /* recursively free backing chain */
-    virStorageSourceFree(def->backingMeta);
+    virStorageSourceFree(def->backingStore);
 }


diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index fa9ae44..e60befe 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -237,7 +237,7 @@ struct _virStorageSource {
     virSecurityDeviceLabelDefPtr *seclabels;

     /* backing chain of the storage source */
-    virStorageSourcePtr backingMeta;
+    virStorageSourcePtr backingStore;

     /* metadata for storage driver access to remote and local volumes */
     virStorageDriverDataPtr drv;
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 90311af..19f3f58 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -336,7 +336,7 @@ testStorageChain(const void *args)
             virAsprintf(&actual,
                         "store:%s\nraw:%s\nother:%lld %d\n"
                         "relPath:%s\npath:%s\nrelDir:%s\ntype:%d %d\n",
-                        NULLSTR(elt->backingMeta ? elt->backingMeta->path : NULL),
+                        NULLSTR(elt->backingStore ? elt->backingStore->path : NULL),
                         NULLSTR(elt->backingStoreRaw),
                         elt->capacity, !!elt->encryption,
                         NULLSTR(elt->relPath),
@@ -356,7 +356,7 @@ testStorageChain(const void *args)
         }
         VIR_FREE(expect);
         VIR_FREE(actual);
-        elt = elt->backingMeta;
+        elt = elt->backingStore;
         i++;
     }
     if (i != data->nfiles) {
@@ -841,16 +841,16 @@ mymain(void)
     TEST_LOOKUP(0, "bogus", NULL, NULL, NULL);
     TEST_LOOKUP(1, "wrap", chain->path, chain, NULL);
     TEST_LOOKUP(2, abswrap, chain->path, chain, NULL);
-    TEST_LOOKUP(3, "qcow2", chain->backingMeta->path, chain->backingMeta,
+    TEST_LOOKUP(3, "qcow2", chain->backingStore->path, chain->backingStore,
                 chain->path);
-    TEST_LOOKUP(4, absqcow2, chain->backingMeta->path, chain->backingMeta,
+    TEST_LOOKUP(4, absqcow2, chain->backingStore->path, chain->backingStore,
                 chain->path);
-    TEST_LOOKUP(5, "raw", chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
-    TEST_LOOKUP(6, absraw, chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
-    TEST_LOOKUP(7, NULL, chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
+    TEST_LOOKUP(5, "raw", chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);
+    TEST_LOOKUP(6, absraw, chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);
+    TEST_LOOKUP(7, NULL, chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);

     /* Rewrite wrap and qcow2 back to 3-deep chain, relative backing */
     virCommandFree(cmd);
@@ -877,16 +877,16 @@ mymain(void)
     TEST_LOOKUP(8, "bogus", NULL, NULL, NULL);
     TEST_LOOKUP(9, "wrap", chain->path, chain, NULL);
     TEST_LOOKUP(10, abswrap, chain->path, chain, NULL);
-    TEST_LOOKUP(11, "qcow2", chain->backingMeta->path, chain->backingMeta,
+    TEST_LOOKUP(11, "qcow2", chain->backingStore->path, chain->backingStore,
                 chain->path);
-    TEST_LOOKUP(12, absqcow2, chain->backingMeta->path, chain->backingMeta,
+    TEST_LOOKUP(12, absqcow2, chain->backingStore->path, chain->backingStore,
                 chain->path);
-    TEST_LOOKUP(13, "raw", chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
-    TEST_LOOKUP(14, absraw, chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
-    TEST_LOOKUP(15, NULL, chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
+    TEST_LOOKUP(13, "raw", chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);
+    TEST_LOOKUP(14, absraw, chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);
+    TEST_LOOKUP(15, NULL, chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);

     /* Use link to wrap with cross-directory relative backing */
     virCommandFree(cmd);
@@ -908,17 +908,17 @@ mymain(void)
     TEST_LOOKUP(17, "sub/link2", chain->path, chain, NULL);
     TEST_LOOKUP(18, "wrap", chain->path, chain, NULL);
     TEST_LOOKUP(19, abswrap, chain->path, chain, NULL);
-    TEST_LOOKUP(20, "../qcow2", chain->backingMeta->path, chain->backingMeta,
+    TEST_LOOKUP(20, "../qcow2", chain->backingStore->path, chain->backingStore,
                 chain->path);
     TEST_LOOKUP(21, "qcow2", NULL, NULL, NULL);
-    TEST_LOOKUP(22, absqcow2, chain->backingMeta->path, chain->backingMeta,
+    TEST_LOOKUP(22, absqcow2, chain->backingStore->path, chain->backingStore,
                 chain->path);
-    TEST_LOOKUP(23, "raw", chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
-    TEST_LOOKUP(24, absraw, chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
-    TEST_LOOKUP(25, NULL, chain->backingMeta->backingMeta->path,
-                chain->backingMeta->backingMeta, chain->backingMeta->path);
+    TEST_LOOKUP(23, "raw", chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);
+    TEST_LOOKUP(24, absraw, chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);
+    TEST_LOOKUP(25, NULL, chain->backingStore->backingStore->path,
+                chain->backingStore->backingStore, chain->backingStore->path);

  cleanup:
     /* Final cleanup */
-- 
1.9.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]