[libvirt PATCH v2 12/13] virstoragefile: use virStorageFile prefix for all functions

Pavel Hrdina posted 13 patches 5 years ago
[libvirt PATCH v2 12/13] virstoragefile: use virStorageFile prefix for all functions
Posted by Pavel Hrdina 5 years ago
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 src/libvirt_private.syms          | 4 ++--
 src/qemu/qemu_block.c             | 2 +-
 src/qemu/qemu_snapshot.c          | 2 +-
 src/storage_file/storage_source.c | 6 +++---
 src/util/virstoragefile.c         | 6 +++---
 src/util/virstoragefile.h         | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index e8fe8e6c12..088474d54b 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3216,10 +3216,10 @@ virSocketAddrSetPort;
 virStorageFileCanonicalizePath;
 virStorageFileGetNPIVKey;
 virStorageFileGetSCSIKey;
+virStorageFileIsFile;
+virStorageFileIsRelative;
 virStorageFileParseBackingStoreStr;
 virStorageFileParseChainIndex;
-virStorageIsFile;
-virStorageIsRelative;
 
 
 # util/virstring.h
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index ca23466b22..fafa35071c 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3439,7 +3439,7 @@ qemuBlockUpdateRelativeBacking(virDomainObjPtr vm,
         if (rc < 0)
             return rc;
 
-        if (backingStoreStr && virStorageIsRelative(backingStoreStr))
+        if (backingStoreStr && virStorageFileIsRelative(backingStoreStr))
             n->backingStore->relPath = g_steal_pointer(&backingStoreStr);
     }
 
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 994c7dc60b..699090ae40 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1094,7 +1094,7 @@ qemuSnapshotDiskPrepareOne(virDomainObjPtr vm,
                 if (virStorageFileGetBackingStoreStr(dd->src, &backingStoreStr) < 0)
                     return -1;
                 if (backingStoreStr != NULL) {
-                    if (virStorageIsRelative(backingStoreStr))
+                    if (virStorageFileIsRelative(backingStoreStr))
                         dd->relPath = g_steal_pointer(&backingStoreStr);
                 }
             }
diff --git a/src/storage_file/storage_source.c b/src/storage_file/storage_source.c
index d1e0aeb2c1..ffc7fe8ea5 100644
--- a/src/storage_file/storage_source.c
+++ b/src/storage_file/storage_source.c
@@ -185,7 +185,7 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
 {
     virStorageSourcePtr prev;
     const char *start = chain->path;
-    bool nameIsFile = virStorageIsFile(name);
+    bool nameIsFile = virStorageFileIsFile(name);
 
     if (!parent)
         parent = &prev;
@@ -1532,7 +1532,7 @@ virStorageSourceNewFromBackingAbsolute(const char *path,
 
     *src = NULL;
 
-    if (virStorageIsFile(path)) {
+    if (virStorageFileIsFile(path)) {
         def->type = VIR_STORAGE_TYPE_FILE;
 
         def->path = g_strdup(path);
@@ -1604,7 +1604,7 @@ virStorageSourceNewFromChild(virStorageSourcePtr parent,
 
     *child = NULL;
 
-    if (virStorageIsRelative(parentRaw)) {
+    if (virStorageFileIsRelative(parentRaw)) {
         if (!(def = virStorageSourceNewFromBackingRelative(parent, parentRaw)))
             return -1;
     } else {
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 85ccd9f52c..c9c735831d 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -38,7 +38,7 @@ VIR_LOG_INIT("util.storagefile");
 
 
 bool
-virStorageIsFile(const char *backing)
+virStorageFileIsFile(const char *backing)
 {
     char *colon;
     char *slash;
@@ -59,12 +59,12 @@ virStorageIsFile(const char *backing)
 
 
 bool
-virStorageIsRelative(const char *backing)
+virStorageFileIsRelative(const char *backing)
 {
     if (backing[0] == '/')
         return false;
 
-    if (!virStorageIsFile(backing))
+    if (!virStorageFileIsFile(backing))
         return false;
 
     return true;
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index 2c1a250f20..e56796ec95 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -33,8 +33,8 @@ int virStorageFileParseBackingStoreStr(const char *str,
                                        unsigned int *chainIndex)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
 
-bool virStorageIsFile(const char *path);
-bool virStorageIsRelative(const char *backing);
+bool virStorageFileIsFile(const char *path);
+bool virStorageFileIsRelative(const char *backing);
 
 int virStorageFileGetSCSIKey(const char *path,
                              char **key,
-- 
2.29.2

Re: [libvirt PATCH v2 12/13] virstoragefile: use virStorageFile prefix for all functions
Posted by Peter Krempa 5 years ago
On Thu, Jan 21, 2021 at 20:34:26 +0100, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---

I really hate that these functions are exported.

If this patch is necessary for the following, then commit it, otherwise
drop it. I'll follow up with patches for moving the two functions
appropriately and unexporting them.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Otherwise just drop it.

Re: [libvirt PATCH v2 12/13] virstoragefile: use virStorageFile prefix for all functions
Posted by Pavel Hrdina 5 years ago
On Fri, Jan 22, 2021 at 10:10:33AM +0100, Peter Krempa wrote:
> On Thu, Jan 21, 2021 at 20:34:26 +0100, Pavel Hrdina wrote:
> > Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> > ---
> 
> I really hate that these functions are exported.
> 
> If this patch is necessary for the following, then commit it, otherwise
> drop it. I'll follow up with patches for moving the two functions
> appropriately and unexporting them.
> 
> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
> 
> Otherwise just drop it.

I'll drop it then.