diff options
author | john.levon@sun.com <john.levon@sun.com> | 2007-02-19 20:44:42 -0800 |
---|---|---|
committer | john.levon@sun.com <john.levon@sun.com> | 2007-02-19 20:44:42 -0800 |
commit | ec08a094b2b6437406adab0f19cb89bf26c4f3ad (patch) | |
tree | 3a0a944eb764d758615842526e1b5c28bf29b56a /tools/libfsimage/common | |
parent | 5f855af62745d6def7f9a47a75fe3b83bf1aa2cb (diff) | |
download | xen-ec08a094b2b6437406adab0f19cb89bf26c4f3ad.tar.gz xen-ec08a094b2b6437406adab0f19cb89bf26c4f3ad.tar.bz2 xen-ec08a094b2b6437406adab0f19cb89bf26c4f3ad.zip |
Filesystem implementations may need optional arguments in terms of
what to mount. Add an options string to the libfsimage API.
Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'tools/libfsimage/common')
-rw-r--r-- | tools/libfsimage/common/fsimage.c | 4 | ||||
-rw-r--r-- | tools/libfsimage/common/fsimage.h | 2 | ||||
-rw-r--r-- | tools/libfsimage/common/fsimage_grub.c | 4 | ||||
-rw-r--r-- | tools/libfsimage/common/fsimage_grub.h | 2 | ||||
-rw-r--r-- | tools/libfsimage/common/fsimage_plugin.c | 4 | ||||
-rw-r--r-- | tools/libfsimage/common/fsimage_plugin.h | 2 | ||||
-rw-r--r-- | tools/libfsimage/common/fsimage_priv.h | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/tools/libfsimage/common/fsimage.c b/tools/libfsimage/common/fsimage.c index 08262f81ce..4a1431751d 100644 --- a/tools/libfsimage/common/fsimage.c +++ b/tools/libfsimage/common/fsimage.c @@ -36,7 +36,7 @@ static pthread_mutex_t fsi_lock = PTHREAD_MUTEX_INITIALIZER; -fsi_t *fsi_open_fsimage(const char *path, uint64_t off) +fsi_t *fsi_open_fsimage(const char *path, uint64_t off, const char *options) { fsi_t *fsi = NULL; int fd; @@ -53,7 +53,7 @@ fsi_t *fsi_open_fsimage(const char *path, uint64_t off) fsi->f_data = NULL; pthread_mutex_lock(&fsi_lock); - err = find_plugin(fsi, path); + err = find_plugin(fsi, path, options); pthread_mutex_unlock(&fsi_lock); if (err != 0) goto fail; diff --git a/tools/libfsimage/common/fsimage.h b/tools/libfsimage/common/fsimage.h index 28165ef29d..ad305b5dae 100644 --- a/tools/libfsimage/common/fsimage.h +++ b/tools/libfsimage/common/fsimage.h @@ -35,7 +35,7 @@ extern C { typedef struct fsi fsi_t; typedef struct fsi_file fsi_file_t; -fsi_t *fsi_open_fsimage(const char *, uint64_t); +fsi_t *fsi_open_fsimage(const char *, uint64_t, const char *); void fsi_close_fsimage(fsi_t *); int fsi_file_exists(fsi_t *, const char *); diff --git a/tools/libfsimage/common/fsimage_grub.c b/tools/libfsimage/common/fsimage_grub.c index 99481064a9..27a1481eb7 100644 --- a/tools/libfsimage/common/fsimage_grub.c +++ b/tools/libfsimage/common/fsimage_grub.c @@ -161,7 +161,7 @@ fsig_substring(const char *s1, const char *s2) } static int -fsig_mount(fsi_t *fsi, const char *path) +fsig_mount(fsi_t *fsi, const char *path, const char *options) { fsig_plugin_ops_t *ops = fsi->f_plugin->fp_data; fsi_file_t *ffi; @@ -178,7 +178,7 @@ fsig_mount(fsi_t *fsi, const char *path) bzero(fsi->f_data, sizeof (fsig_data_t)); - if (!ops->fpo_mount(ffi)) { + if (!ops->fpo_mount(ffi, options)) { fsip_file_free(ffi); free(fsi->f_data); fsi->f_data = NULL; diff --git a/tools/libfsimage/common/fsimage_grub.h b/tools/libfsimage/common/fsimage_grub.h index 38db2a219c..9fc8c467b2 100644 --- a/tools/libfsimage/common/fsimage_grub.h +++ b/tools/libfsimage/common/fsimage_grub.h @@ -38,7 +38,7 @@ extern C { typedef struct fsig_plugin_ops { int fpo_version; - int (*fpo_mount)(fsi_file_t *); + int (*fpo_mount)(fsi_file_t *, const char *); int (*fpo_dir)(fsi_file_t *, char *); int (*fpo_read)(fsi_file_t *, char *, int); } fsig_plugin_ops_t; diff --git a/tools/libfsimage/common/fsimage_plugin.c b/tools/libfsimage/common/fsimage_plugin.c index f961648164..ab35fb7d8f 100644 --- a/tools/libfsimage/common/fsimage_plugin.c +++ b/tools/libfsimage/common/fsimage_plugin.c @@ -185,7 +185,7 @@ fail: return (ret); } -int find_plugin(fsi_t *fsi, const char *path) +int find_plugin(fsi_t *fsi, const char *path, const char *options) { fsi_plugin_t *fp; int ret = 0; @@ -195,7 +195,7 @@ int find_plugin(fsi_t *fsi, const char *path) for (fp = plugins; fp != NULL; fp = fp->fp_next) { fsi->f_plugin = fp; - if (fp->fp_ops->fpo_mount(fsi, path) == 0) + if (fp->fp_ops->fpo_mount(fsi, path, options) == 0) goto out; } diff --git a/tools/libfsimage/common/fsimage_plugin.h b/tools/libfsimage/common/fsimage_plugin.h index f1c83fab95..a682719a63 100644 --- a/tools/libfsimage/common/fsimage_plugin.h +++ b/tools/libfsimage/common/fsimage_plugin.h @@ -38,7 +38,7 @@ typedef struct fsi_plugin fsi_plugin_t; typedef struct fsi_plugin_ops { int fpo_version; - int (*fpo_mount)(fsi_t *, const char *); + int (*fpo_mount)(fsi_t *, const char *, const char *); int (*fpo_umount)(fsi_t *); fsi_file_t *(*fpo_open)(fsi_t *, const char *); ssize_t (*fpo_read)(fsi_file_t *, void *, size_t); diff --git a/tools/libfsimage/common/fsimage_priv.h b/tools/libfsimage/common/fsimage_priv.h index cf0dfe6612..441b71930a 100644 --- a/tools/libfsimage/common/fsimage_priv.h +++ b/tools/libfsimage/common/fsimage_priv.h @@ -53,7 +53,7 @@ struct fsi_file { void *ff_data; }; -int find_plugin(fsi_t *, const char *); +int find_plugin(fsi_t *, const char *, const char *); #ifdef __cplusplus }; |