Skip to content

Commit

Permalink
fsdev: Move some types definition to qemu-fsdev.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
  • Loading branch information
gkurz committed May 17, 2019
1 parent 778f0fa commit 2023243
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
23 changes: 23 additions & 0 deletions fsdev/qemu-fsdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
24 changes: 0 additions & 24 deletions fsdev/qemu-fsdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2023243

Please sign in to comment.