Re: [libvirt PATCH v2 08/13] util: move virStorageFileBackend code into storage_file

2021-01-22 Thread Peter Krempa
On Fri, Jan 22, 2021 at 10:13:02 +0100, Pavel Hrdina wrote:
> On Fri, Jan 22, 2021 at 09:54:06AM +0100, Peter Krempa wrote:
> > On Thu, Jan 21, 2021 at 20:34:22 +0100, Pavel Hrdina wrote:
> > > It's used only by storage file code so it doesn't make sense to have
> > > it in util directory.
> > > 
> > > Signed-off-by: Pavel Hrdina 
> > > ---
> > >  po/POTFILES.in| 2 +-
> > >  src/libvirt_private.syms  | 8 
> > >  src/storage_file/meson.build  | 1 +
> > >  .../storage_file_backend.c}   | 4 ++--
> > >  .../storage_file_backend.h}   | 2 +-
> > >  src/storage_file/storage_file_fs.c| 2 +-
> > >  src/storage_file/storage_file_gluster.c   | 2 +-
> > >  src/storage_file/storage_source.c | 2 +-
> > >  src/util/meson.build  | 1 -
> > >  9 files changed, 12 insertions(+), 12 deletions(-)
> > >  rename src/{util/virstoragefilebackend.c => 
> > > storage_file/storage_file_backend.c} (97%)
> > >  rename src/{util/virstoragefilebackend.h => 
> > > storage_file/storage_file_backend.h} (97%)
> > 
> > Reviewed-by: Peter Krempa 
> > 
> > although I'm probably more inclined to keep the original name without
> > underscores and with vir prefix.
> 
> I personally don't have any preference. The only motivation was not to
> mix two different naming styles withing one directory.
> 
> We should eventually unify the file naming style across the whole
> project as we use underscores, dash and nothing all over the place.

Yes, it can be done separately.



Re: [libvirt PATCH v2 08/13] util: move virStorageFileBackend code into storage_file

2021-01-22 Thread Pavel Hrdina
On Fri, Jan 22, 2021 at 09:54:06AM +0100, Peter Krempa wrote:
> On Thu, Jan 21, 2021 at 20:34:22 +0100, Pavel Hrdina wrote:
> > It's used only by storage file code so it doesn't make sense to have
> > it in util directory.
> > 
> > Signed-off-by: Pavel Hrdina 
> > ---
> >  po/POTFILES.in| 2 +-
> >  src/libvirt_private.syms  | 8 
> >  src/storage_file/meson.build  | 1 +
> >  .../storage_file_backend.c}   | 4 ++--
> >  .../storage_file_backend.h}   | 2 +-
> >  src/storage_file/storage_file_fs.c| 2 +-
> >  src/storage_file/storage_file_gluster.c   | 2 +-
> >  src/storage_file/storage_source.c | 2 +-
> >  src/util/meson.build  | 1 -
> >  9 files changed, 12 insertions(+), 12 deletions(-)
> >  rename src/{util/virstoragefilebackend.c => 
> > storage_file/storage_file_backend.c} (97%)
> >  rename src/{util/virstoragefilebackend.h => 
> > storage_file/storage_file_backend.h} (97%)
> 
> Reviewed-by: Peter Krempa 
> 
> although I'm probably more inclined to keep the original name without
> underscores and with vir prefix.

I personally don't have any preference. The only motivation was not to
mix two different naming styles withing one directory.

We should eventually unify the file naming style across the whole
project as we use underscores, dash and nothing all over the place.

Pavel


signature.asc
Description: PGP signature


Re: [libvirt PATCH v2 08/13] util: move virStorageFileBackend code into storage_file

2021-01-22 Thread Peter Krempa
On Thu, Jan 21, 2021 at 20:34:22 +0100, Pavel Hrdina wrote:
> It's used only by storage file code so it doesn't make sense to have
> it in util directory.
> 
> Signed-off-by: Pavel Hrdina 
> ---
>  po/POTFILES.in| 2 +-
>  src/libvirt_private.syms  | 8 
>  src/storage_file/meson.build  | 1 +
>  .../storage_file_backend.c}   | 4 ++--
>  .../storage_file_backend.h}   | 2 +-
>  src/storage_file/storage_file_fs.c| 2 +-
>  src/storage_file/storage_file_gluster.c   | 2 +-
>  src/storage_file/storage_source.c | 2 +-
>  src/util/meson.build  | 1 -
>  9 files changed, 12 insertions(+), 12 deletions(-)
>  rename src/{util/virstoragefilebackend.c => 
> storage_file/storage_file_backend.c} (97%)
>  rename src/{util/virstoragefilebackend.h => 
> storage_file/storage_file_backend.h} (97%)

Reviewed-by: Peter Krempa 

although I'm probably more inclined to keep the original name without
underscores and with vir prefix.



[libvirt PATCH v2 08/13] util: move virStorageFileBackend code into storage_file

2021-01-21 Thread Pavel Hrdina
It's used only by storage file code so it doesn't make sense to have
it in util directory.

Signed-off-by: Pavel Hrdina 
---
 po/POTFILES.in| 2 +-
 src/libvirt_private.syms  | 8 
 src/storage_file/meson.build  | 1 +
 .../storage_file_backend.c}   | 4 ++--
 .../storage_file_backend.h}   | 2 +-
 src/storage_file/storage_file_fs.c| 2 +-
 src/storage_file/storage_file_gluster.c   | 2 +-
 src/storage_file/storage_source.c | 2 +-
 src/util/meson.build  | 1 -
 9 files changed, 12 insertions(+), 12 deletions(-)
 rename src/{util/virstoragefilebackend.c => 
storage_file/storage_file_backend.c} (97%)
 rename src/{util/virstoragefilebackend.h => 
storage_file/storage_file_backend.h} (97%)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1e47af987d..4da22ede8f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -223,6 +223,7 @@
 @SRCDIR@src/storage/storage_backend_zfs.c
 @SRCDIR@src/storage/storage_driver.c
 @SRCDIR@src/storage/storage_util.c
+@SRCDIR@src/storage_file/storage_file_backend.c
 @SRCDIR@src/storage_file/storage_file_fs.c
 @SRCDIR@src/storage_file/storage_file_gluster.c
 @SRCDIR@src/storage_file/storage_source.c
@@ -306,7 +307,6 @@
 @SRCDIR@src/util/virsocketaddr.c
 @SRCDIR@src/util/virstorageencryption.c
 @SRCDIR@src/util/virstoragefile.c
-@SRCDIR@src/util/virstoragefilebackend.c
 @SRCDIR@src/util/virstoragefileprobe.c
 @SRCDIR@src/util/virstring.c
 @SRCDIR@src/util/virsysinfo.c
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 67a863467d..e7af8f0599 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1618,6 +1618,10 @@ virSecurityManagerVerify;
 virSecurityXATTRNamespaceDefined;
 
 
+# storage_file/storage_file_backend.h
+virStorageFileBackendRegister;
+
+
 # storage_file/storage_source.h
 virStorageFileAccess;
 virStorageFileChainLookup;
@@ -3210,10 +3214,6 @@ virStorageTypeFromString;
 virStorageTypeToString;
 
 
-# util/virstoragefilebackend.h
-virStorageFileBackendRegister;
-
-
 # util/virstoragefileprobe.h
 virStorageFileProbeFormat;
 virStorageFileProbeGetMetadata;
diff --git a/src/storage_file/meson.build b/src/storage_file/meson.build
index bae018feac..bcd6f01906 100644
--- a/src/storage_file/meson.build
+++ b/src/storage_file/meson.build
@@ -1,5 +1,6 @@
 storage_file_sources = [
   'storage_source.c',
+  'storage_file_backend.c',
 ]
 
 stoarge_file_fs_sources = [
diff --git a/src/util/virstoragefilebackend.c 
b/src/storage_file/storage_file_backend.c
similarity index 97%
rename from src/util/virstoragefilebackend.c
rename to src/storage_file/storage_file_backend.c
index 55c62b0212..6e4b2f408b 100644
--- a/src/util/virstoragefilebackend.c
+++ b/src/storage_file/storage_file_backend.c
@@ -1,5 +1,5 @@
 /*
- * virstoragefilebackend.c: internal storage source backend contract
+ * storage_file_backend.c: internal storage source backend contract
  *
  * Copyright (C) 2007-2018 Red Hat, Inc.
  * Copyright (C) 2007-2008 Daniel P. Berrange
@@ -27,7 +27,7 @@
 #include "virerror.h"
 #include "viralloc.h"
 #include "internal.h"
-#include "virstoragefilebackend.h"
+#include "storage_file_backend.h"
 #include "virlog.h"
 #include "virmodule.h"
 #include "virfile.h"
diff --git a/src/util/virstoragefilebackend.h 
b/src/storage_file/storage_file_backend.h
similarity index 97%
rename from src/util/virstoragefilebackend.h
rename to src/storage_file/storage_file_backend.h
index 43b36e95bc..ad0f66212c 100644
--- a/src/util/virstoragefilebackend.h
+++ b/src/storage_file/storage_file_backend.h
@@ -1,5 +1,5 @@
 /*
- * virstoragefilebackend.h: internal storage source backend contract
+ * storage_file_backend.h: internal storage source backend contract
  *
  * Copyright (C) 2007-2018 Red Hat, Inc.
  *
diff --git a/src/storage_file/storage_file_fs.c 
b/src/storage_file/storage_file_fs.c
index 5a44ef8c2d..1cc9233512 100644
--- a/src/storage_file/storage_file_fs.c
+++ b/src/storage_file/storage_file_fs.c
@@ -25,9 +25,9 @@
 #include 
 
 #include "virerror.h"
+#include "storage_file_backend.h"
 #include "storage_file_fs.h"
 #include "storage_util.h"
-#include "virstoragefilebackend.h"
 #include "vircommand.h"
 #include "viralloc.h"
 #include "virfile.h"
diff --git a/src/storage_file/storage_file_gluster.c 
b/src/storage_file/storage_file_gluster.c
index 2560e10d37..0828088c2c 100644
--- a/src/storage_file/storage_file_gluster.c
+++ b/src/storage_file/storage_file_gluster.c
@@ -23,12 +23,12 @@
 
 #include 
 
+#include "storage_file_backend.h"
 #include "storage_file_gluster.h"
 #include "viralloc.h"
 #include "virerror.h"
 #include "virlog.h"
 #include "virstoragefile.h"
-#include "virstoragefilebackend.h"
 #include "virstring.h"
 
 #define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/storage_file/storage_source.c