[Qemu-devel] [PATCH 3/6] fsdev: Move some types definition to qemu-fsdev.c

Greg Kurz posted 6 patches 6 years, 9 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Greg Kurz <groug@kaod.org>
There is a newer version of this series
[Qemu-devel] [PATCH 3/6] fsdev: Move some types definition to qemu-fsdev.c
Posted by Greg Kurz 6 years, 9 months ago
It would make sense for these types to be defined in a header file if
we had an API for fsdrivers to register themselves. In practice, we
only have three of them and it is very unlikely we add new ones since
the future of file sharing between host and guest is the upcoming
virtio-fs.

Move the types to qemu-fsdev.c instead since they are only used there.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 fsdev/qemu-fsdev.c |   23 +++++++++++++++++++++++
 fsdev/qemu-fsdev.h |   24 ------------------------
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index 54cb36a2124b..e972bd698cf5 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -18,6 +18,29 @@
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 
+/*
+ * A table to store the various file systems and their callback operations.
+ * -----------------
+ * fstype | ops
+ * -----------------
+ *  local | local_ops
+ *  .     |
+ *  .     |
+ *  .     |
+ *  .     |
+ * -----------------
+ *  etc
+ */
+typedef struct FsDriverTable {
+    const char *name;
+    FileOperations *ops;
+} FsDriverTable;
+
+typedef struct FsDriverListEntry {
+    FsDriverEntry fse;
+    QTAILQ_ENTRY(FsDriverListEntry) next;
+} FsDriverListEntry;
+
 static QTAILQ_HEAD(, FsDriverListEntry) fsdriver_entries =
     QTAILQ_HEAD_INITIALIZER(fsdriver_entries);
 
diff --git a/fsdev/qemu-fsdev.h b/fsdev/qemu-fsdev.h
index 844159d1e1ff..52a53977701a 100644
--- a/fsdev/qemu-fsdev.h
+++ b/fsdev/qemu-fsdev.h
@@ -14,30 +14,6 @@
 #define QEMU_FSDEV_H
 #include "file-op-9p.h"
 
-
-/*
- * A table to store the various file systems and their callback operations.
- * -----------------
- * fstype | ops
- * -----------------
- *  local | local_ops
- *  .     |
- *  .     |
- *  .     |
- *  .     |
- * -----------------
- *  etc
- */
-typedef struct FsDriverTable {
-    const char *name;
-    FileOperations *ops;
-} FsDriverTable;
-
-typedef struct FsDriverListEntry {
-    FsDriverEntry fse;
-    QTAILQ_ENTRY(FsDriverListEntry) next;
-} FsDriverListEntry;
-
 int qemu_fsdev_add(QemuOpts *opts, Error **errp);
 FsDriverEntry *get_fsdev_fsentry(char *id);
 extern FileOperations local_ops;


Re: [Qemu-devel] [PATCH 3/6] fsdev: Move some types definition to qemu-fsdev.c
Posted by Thomas Huth 6 years, 9 months ago
On 07/05/2019 10.45, Greg Kurz wrote:
> It would make sense for these types to be defined in a header file if
> we had an API for fsdrivers to register themselves. In practice, we
> only have three of them and it is very unlikely we add new ones since
> the future of file sharing between host and guest is the upcoming
> virtio-fs.
> 
> Move the types to qemu-fsdev.c instead since they are only used there.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>  fsdev/qemu-fsdev.c |   23 +++++++++++++++++++++++
>  fsdev/qemu-fsdev.h |   24 ------------------------
>  2 files changed, 23 insertions(+), 24 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

Re: [Qemu-devel] [PATCH 3/6] fsdev: Move some types definition to qemu-fsdev.c
Posted by Greg Kurz 6 years, 9 months ago
On Wed, 8 May 2019 10:28:03 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 07/05/2019 10.45, Greg Kurz wrote:
> > It would make sense for these types to be defined in a header file if
> > we had an API for fsdrivers to register themselves. In practice, we
> > only have three of them and it is very unlikely we add new ones since
> > the future of file sharing between host and guest is the upcoming
> > virtio-fs.
> > 
> > Move the types to qemu-fsdev.c instead since they are only used there.
> > 
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> >  fsdev/qemu-fsdev.c |   23 +++++++++++++++++++++++
> >  fsdev/qemu-fsdev.h |   24 ------------------------
> >  2 files changed, 23 insertions(+), 24 deletions(-)  
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Applied to https://github.com/gkurz/qemu/commits/9p-next 

Cheers,

--
Greg