aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChunyan Liu <cyliu@suse.com>2014-06-05 17:21:11 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2014-06-16 17:23:21 +0800
commitc282e1fdf7ec9659c7f320123be397477a359d01 (patch)
tree4e76122536c52b1093da8647839039627d1f596c /include
parentfec9921f0a331716c898d1f823682de2ecfa3d2a (diff)
cleanup QEMUOptionParameter
Now that all backend drivers are using QemuOpts, remove all QEMUOptionParameter related codes. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Chunyan Liu <cyliu@suse.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/block.h8
-rw-r--r--include/block/block_int.h18
-rw-r--r--include/qemu/option.h48
3 files changed, 6 insertions, 68 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 4312b8176e..f15b99b00b 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -204,9 +204,8 @@ BlockDriver *bdrv_find_format(const char *format_name);
BlockDriver *bdrv_find_whitelisted_format(const char *format_name,
bool readonly);
int bdrv_create(BlockDriver *drv, const char* filename,
- QEMUOptionParameter *options, QemuOpts *opts, Error **errp);
-int bdrv_create_file(const char* filename, QEMUOptionParameter *options,
- QemuOpts *opts, Error **errp);
+ QemuOpts *opts, Error **errp);
+int bdrv_create_file(const char *filename, QemuOpts *opts, Error **errp);
BlockDriverState *bdrv_new(const char *device_name, Error **errp);
void bdrv_make_anon(BlockDriverState *bs);
void bdrv_swap(BlockDriverState *bs_new, BlockDriverState *bs_old);
@@ -312,8 +311,7 @@ typedef enum {
int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res, BdrvCheckMode fix);
-int bdrv_amend_options(BlockDriverState *bs_new, QEMUOptionParameter *options,
- QemuOpts *opts);
+int bdrv_amend_options(BlockDriverState *bs_new, QemuOpts *opts);
/* external snapshots */
bool bdrv_recurse_is_first_non_filter(BlockDriverState *bs,
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 8a77d79f41..7aa2213f77 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -116,10 +116,7 @@ struct BlockDriver {
const uint8_t *buf, int nb_sectors);
void (*bdrv_close)(BlockDriverState *bs);
void (*bdrv_rebind)(BlockDriverState *bs);
- int (*bdrv_create)(const char *filename, QEMUOptionParameter *options,
- Error **errp);
- /* FIXME: will remove the duplicate and rename back to bdrv_create later */
- int (*bdrv_create2)(const char *filename, QemuOpts *opts, Error **errp);
+ int (*bdrv_create)(const char *filename, QemuOpts *opts, Error **errp);
int (*bdrv_set_key)(BlockDriverState *bs, const char *key);
int (*bdrv_make_empty)(BlockDriverState *bs);
/* aio */
@@ -218,12 +215,6 @@ struct BlockDriver {
BlockDriverCompletionFunc *cb, void *opaque);
/* List of options for creating images, terminated by name == NULL */
- QEMUOptionParameter *create_options;
- /* FIXME: will replace create_options.
- * These two fields are mutually exclusive. At most one is non-NULL.
- * create_options should only be set with bdrv_create, and create_opts
- * should only be set with bdrv_create2.
- */
QemuOptsList *create_opts;
/*
@@ -233,12 +224,7 @@ struct BlockDriver {
int (*bdrv_check)(BlockDriverState* bs, BdrvCheckResult *result,
BdrvCheckMode fix);
- int (*bdrv_amend_options)(BlockDriverState *bs,
- QEMUOptionParameter *options);
- /* FIXME: will remove the duplicate and rename back to
- * bdrv_amend_options later
- */
- int (*bdrv_amend_options2)(BlockDriverState *bs, QemuOpts *opts);
+ int (*bdrv_amend_options)(BlockDriverState *bs, QemuOpts *opts);
void (*bdrv_debug_event)(BlockDriverState *bs, BlkDebugEvent event);
diff --git a/include/qemu/option.h b/include/qemu/option.h
index 34552678c3..921eccdb38 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -31,25 +31,6 @@
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
-enum QEMUOptionParType {
- OPT_FLAG,
- OPT_NUMBER,
- OPT_SIZE,
- OPT_STRING,
-};
-
-typedef struct QEMUOptionParameter {
- const char *name;
- enum QEMUOptionParType type;
- union {
- uint64_t n;
- char* s;
- } value;
- const char *help;
- bool assigned;
-} QEMUOptionParameter;
-
-
const char *get_opt_name(char *buf, int buf_size, const char *p, char delim);
const char *get_opt_value(char *buf, int buf_size, const char *p);
int get_next_param_value(char *buf, int buf_size,
@@ -58,32 +39,11 @@ int get_param_value(char *buf, int buf_size,
const char *tag, const char *str);
-/*
- * The following functions take a parameter list as input. This is a pointer to
- * the first element of a QEMUOptionParameter array which is terminated by an
- * entry with entry->name == NULL.
- */
-
-QEMUOptionParameter *get_option_parameter(QEMUOptionParameter *list,
- const char *name);
-int set_option_parameter(QEMUOptionParameter *list, const char *name,
- const char *value);
-int set_option_parameter_int(QEMUOptionParameter *list, const char *name,
- uint64_t value);
-QEMUOptionParameter *append_option_parameters(QEMUOptionParameter *dest,
- QEMUOptionParameter *list);
-QEMUOptionParameter *parse_option_parameters(const char *param,
- QEMUOptionParameter *list, QEMUOptionParameter *dest);
void parse_option_size(const char *name, const char *value,
uint64_t *ret, Error **errp);
-void free_option_parameters(QEMUOptionParameter *list);
-void print_option_parameters(QEMUOptionParameter *list);
-void print_option_help(QEMUOptionParameter *list);
bool has_help_option(const char *param);
bool is_valid_option_list(const char *param);
-/* ------------------------------------------------------------------ */
-
typedef struct QemuOpt QemuOpt;
typedef struct QemuOpts QemuOpts;
typedef struct QemuOptsList QemuOptsList;
@@ -175,12 +135,6 @@ int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func, void *opaque,
int abort_on_failure);
void qemu_opts_print_help(QemuOptsList *list);
void qemu_opts_free(QemuOptsList *list);
-QEMUOptionParameter *opts_to_params(QemuOpts *opts);
-QemuOptsList *params_to_opts(QEMUOptionParameter *list);
-/* FIXME: will remove QEMUOptionParameter after all drivers switch to QemuOpts.
- */
-QemuOptsList *qemu_opts_append(QemuOptsList *dst,
- QemuOptsList *list,
- QEMUOptionParameter *param);
+QemuOptsList *qemu_opts_append(QemuOptsList *dst, QemuOptsList *list);
#endif