Commit c282e1fd authored by Chunyan Liu's avatar Chunyan Liu Committed by Stefan Hajnoczi

cleanup QEMUOptionParameter

Now that all backend drivers are using QemuOpts, remove all
QEMUOptionParameter related codes.
Signed-off-by: default avatarDong Xu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: default avatarChunyan Liu <cyliu@suse.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent fec9921f
...@@ -329,13 +329,6 @@ void bdrv_register(BlockDriver *bdrv) ...@@ -329,13 +329,6 @@ void bdrv_register(BlockDriver *bdrv)
} }
} }
if (bdrv->bdrv_create) {
assert(!bdrv->bdrv_create2 && !bdrv->create_opts);
assert(!bdrv->bdrv_amend_options2);
} else if (bdrv->bdrv_create2) {
assert(!bdrv->bdrv_create && !bdrv->create_options);
assert(!bdrv->bdrv_amend_options);
}
QLIST_INSERT_HEAD(&bdrv_drivers, bdrv, list); QLIST_INSERT_HEAD(&bdrv_drivers, bdrv, list);
} }
...@@ -431,7 +424,6 @@ BlockDriver *bdrv_find_whitelisted_format(const char *format_name, ...@@ -431,7 +424,6 @@ BlockDriver *bdrv_find_whitelisted_format(const char *format_name,
typedef struct CreateCo { typedef struct CreateCo {
BlockDriver *drv; BlockDriver *drv;
char *filename; char *filename;
QEMUOptionParameter *options;
QemuOpts *opts; QemuOpts *opts;
int ret; int ret;
Error *err; Error *err;
...@@ -444,28 +436,8 @@ static void coroutine_fn bdrv_create_co_entry(void *opaque) ...@@ -444,28 +436,8 @@ static void coroutine_fn bdrv_create_co_entry(void *opaque)
CreateCo *cco = opaque; CreateCo *cco = opaque;
assert(cco->drv); assert(cco->drv);
assert(!(cco->options && cco->opts));
if (cco->drv->bdrv_create2) { ret = cco->drv->bdrv_create(cco->filename, cco->opts, &local_err);
QemuOptsList *opts_list = NULL;
if (cco->options) {
opts_list = params_to_opts(cco->options);
cco->opts = qemu_opts_create(opts_list, NULL, 0, &error_abort);
}
ret = cco->drv->bdrv_create2(cco->filename, cco->opts, &local_err);
if (cco->options) {
qemu_opts_del(cco->opts);
qemu_opts_free(opts_list);
}
} else {
if (cco->opts) {
cco->options = opts_to_params(cco->opts);
}
ret = cco->drv->bdrv_create(cco->filename, cco->options, &local_err);
if (cco->opts) {
free_option_parameters(cco->options);
}
}
if (local_err) { if (local_err) {
error_propagate(&cco->err, local_err); error_propagate(&cco->err, local_err);
} }
...@@ -473,7 +445,6 @@ static void coroutine_fn bdrv_create_co_entry(void *opaque) ...@@ -473,7 +445,6 @@ static void coroutine_fn bdrv_create_co_entry(void *opaque)
} }
int bdrv_create(BlockDriver *drv, const char* filename, int bdrv_create(BlockDriver *drv, const char* filename,
QEMUOptionParameter *options,
QemuOpts *opts, Error **errp) QemuOpts *opts, Error **errp)
{ {
int ret; int ret;
...@@ -482,13 +453,12 @@ int bdrv_create(BlockDriver *drv, const char* filename, ...@@ -482,13 +453,12 @@ int bdrv_create(BlockDriver *drv, const char* filename,
CreateCo cco = { CreateCo cco = {
.drv = drv, .drv = drv,
.filename = g_strdup(filename), .filename = g_strdup(filename),
.options = options,
.opts = opts, .opts = opts,
.ret = NOT_DONE, .ret = NOT_DONE,
.err = NULL, .err = NULL,
}; };
if (!drv->bdrv_create && !drv->bdrv_create2) { if (!drv->bdrv_create) {
error_setg(errp, "Driver '%s' does not support image creation", drv->format_name); error_setg(errp, "Driver '%s' does not support image creation", drv->format_name);
ret = -ENOTSUP; ret = -ENOTSUP;
goto out; goto out;
...@@ -519,8 +489,7 @@ out: ...@@ -519,8 +489,7 @@ out:
return ret; return ret;
} }
int bdrv_create_file(const char* filename, QEMUOptionParameter *options, int bdrv_create_file(const char *filename, QemuOpts *opts, Error **errp)
QemuOpts *opts, Error **errp)
{ {
BlockDriver *drv; BlockDriver *drv;
Error *local_err = NULL; Error *local_err = NULL;
...@@ -532,7 +501,7 @@ int bdrv_create_file(const char* filename, QEMUOptionParameter *options, ...@@ -532,7 +501,7 @@ int bdrv_create_file(const char* filename, QEMUOptionParameter *options,
return -ENOENT; return -ENOENT;
} }
ret = bdrv_create(drv, filename, options, opts, &local_err); ret = bdrv_create(drv, filename, opts, &local_err);
if (local_err) { if (local_err) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
} }
...@@ -1277,7 +1246,6 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp) ...@@ -1277,7 +1246,6 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
char *tmp_filename = g_malloc0(PATH_MAX + 1); char *tmp_filename = g_malloc0(PATH_MAX + 1);
int64_t total_size; int64_t total_size;
BlockDriver *bdrv_qcow2; BlockDriver *bdrv_qcow2;
QemuOptsList *create_opts = NULL;
QemuOpts *opts = NULL; QemuOpts *opts = NULL;
QDict *snapshot_options; QDict *snapshot_options;
BlockDriverState *bs_snapshot; BlockDriverState *bs_snapshot;
...@@ -1303,20 +1271,11 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp) ...@@ -1303,20 +1271,11 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
} }
bdrv_qcow2 = bdrv_find_format("qcow2"); bdrv_qcow2 = bdrv_find_format("qcow2");
opts = qemu_opts_create(bdrv_qcow2->create_opts, NULL, 0,
assert(!(bdrv_qcow2->create_options && bdrv_qcow2->create_opts)); &error_abort);
if (bdrv_qcow2->create_options) {
create_opts = params_to_opts(bdrv_qcow2->create_options);
} else {
create_opts = bdrv_qcow2->create_opts;
}
opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
qemu_opt_set_number(opts, BLOCK_OPT_SIZE, total_size); qemu_opt_set_number(opts, BLOCK_OPT_SIZE, total_size);
ret = bdrv_create(bdrv_qcow2, tmp_filename, NULL, opts, &local_err); ret = bdrv_create(bdrv_qcow2, tmp_filename, opts, &local_err);
qemu_opts_del(opts); qemu_opts_del(opts);
if (bdrv_qcow2->create_options) {
qemu_opts_free(create_opts);
}
if (ret < 0) { if (ret < 0) {
error_setg_errno(errp, -ret, "Could not create temporary overlay " error_setg_errno(errp, -ret, "Could not create temporary overlay "
"'%s': %s", tmp_filename, "'%s': %s", tmp_filename,
...@@ -5579,10 +5538,8 @@ void bdrv_img_create(const char *filename, const char *fmt, ...@@ -5579,10 +5538,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
return; return;
} }
create_opts = qemu_opts_append(create_opts, drv->create_opts, create_opts = qemu_opts_append(create_opts, drv->create_opts);
drv->create_options); create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
create_opts = qemu_opts_append(create_opts, proto_drv->create_opts,
proto_drv->create_options);
/* Create parameter list with default values */ /* Create parameter list with default values */
opts = qemu_opts_create(create_opts, NULL, 0, &error_abort); opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
...@@ -5675,7 +5632,7 @@ void bdrv_img_create(const char *filename, const char *fmt, ...@@ -5675,7 +5632,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
puts(""); puts("");
} }
ret = bdrv_create(drv, filename, NULL, opts, &local_err); ret = bdrv_create(drv, filename, opts, &local_err);
if (ret == -EFBIG) { if (ret == -EFBIG) {
/* This is generally a better message than whatever the driver would /* This is generally a better message than whatever the driver would
...@@ -5769,36 +5726,12 @@ void bdrv_add_before_write_notifier(BlockDriverState *bs, ...@@ -5769,36 +5726,12 @@ void bdrv_add_before_write_notifier(BlockDriverState *bs,
notifier_with_return_list_add(&bs->before_write_notifiers, notifier); notifier_with_return_list_add(&bs->before_write_notifiers, notifier);
} }
int bdrv_amend_options(BlockDriverState *bs, QEMUOptionParameter *options, int bdrv_amend_options(BlockDriverState *bs, QemuOpts *opts)
QemuOpts *opts)
{ {
int ret; if (!bs->drv->bdrv_amend_options) {
assert(!(options && opts));
if (!bs->drv->bdrv_amend_options && !bs->drv->bdrv_amend_options2) {
return -ENOTSUP; return -ENOTSUP;
} }
if (bs->drv->bdrv_amend_options2) { return bs->drv->bdrv_amend_options(bs, opts);
QemuOptsList *opts_list = NULL;
if (options) {
opts_list = params_to_opts(options);
opts = qemu_opts_create(opts_list, NULL, 0, &error_abort);
}
ret = bs->drv->bdrv_amend_options2(bs, opts);
if (options) {
qemu_opts_del(opts);
qemu_opts_free(opts_list);
}
} else {
if (opts) {
options = opts_to_params(opts);
}
ret = bs->drv->bdrv_amend_options(bs, options);
if (opts) {
free_option_parameters(options);
}
}
return ret;
} }
/* This function will be called by the bdrv_recurse_is_first_non_filter method /* This function will be called by the bdrv_recurse_is_first_non_filter method
......
...@@ -338,7 +338,7 @@ static int cow_create(const char *filename, QemuOpts *opts, Error **errp) ...@@ -338,7 +338,7 @@ static int cow_create(const char *filename, QemuOpts *opts, Error **errp)
image_sectors = qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0) / 512; image_sectors = qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0) / 512;
image_filename = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FILE); image_filename = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FILE);
ret = bdrv_create_file(filename, NULL, opts, &local_err); ret = bdrv_create_file(filename, opts, &local_err);
if (ret < 0) { if (ret < 0) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
goto exit; goto exit;
...@@ -412,7 +412,7 @@ static BlockDriver bdrv_cow = { ...@@ -412,7 +412,7 @@ static BlockDriver bdrv_cow = {
.bdrv_probe = cow_probe, .bdrv_probe = cow_probe,
.bdrv_open = cow_open, .bdrv_open = cow_open,
.bdrv_close = cow_close, .bdrv_close = cow_close,
.bdrv_create2 = cow_create, .bdrv_create = cow_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_read = cow_co_read, .bdrv_read = cow_co_read,
......
...@@ -725,7 +725,7 @@ static BlockDriver bdrv_gluster = { ...@@ -725,7 +725,7 @@ static BlockDriver bdrv_gluster = {
.bdrv_reopen_commit = qemu_gluster_reopen_commit, .bdrv_reopen_commit = qemu_gluster_reopen_commit,
.bdrv_reopen_abort = qemu_gluster_reopen_abort, .bdrv_reopen_abort = qemu_gluster_reopen_abort,
.bdrv_close = qemu_gluster_close, .bdrv_close = qemu_gluster_close,
.bdrv_create2 = qemu_gluster_create, .bdrv_create = qemu_gluster_create,
.bdrv_getlength = qemu_gluster_getlength, .bdrv_getlength = qemu_gluster_getlength,
.bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size, .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
.bdrv_truncate = qemu_gluster_truncate, .bdrv_truncate = qemu_gluster_truncate,
...@@ -752,7 +752,7 @@ static BlockDriver bdrv_gluster_tcp = { ...@@ -752,7 +752,7 @@ static BlockDriver bdrv_gluster_tcp = {
.bdrv_reopen_commit = qemu_gluster_reopen_commit, .bdrv_reopen_commit = qemu_gluster_reopen_commit,
.bdrv_reopen_abort = qemu_gluster_reopen_abort, .bdrv_reopen_abort = qemu_gluster_reopen_abort,
.bdrv_close = qemu_gluster_close, .bdrv_close = qemu_gluster_close,
.bdrv_create2 = qemu_gluster_create, .bdrv_create = qemu_gluster_create,
.bdrv_getlength = qemu_gluster_getlength, .bdrv_getlength = qemu_gluster_getlength,
.bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size, .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
.bdrv_truncate = qemu_gluster_truncate, .bdrv_truncate = qemu_gluster_truncate,
...@@ -779,7 +779,7 @@ static BlockDriver bdrv_gluster_unix = { ...@@ -779,7 +779,7 @@ static BlockDriver bdrv_gluster_unix = {
.bdrv_reopen_commit = qemu_gluster_reopen_commit, .bdrv_reopen_commit = qemu_gluster_reopen_commit,
.bdrv_reopen_abort = qemu_gluster_reopen_abort, .bdrv_reopen_abort = qemu_gluster_reopen_abort,
.bdrv_close = qemu_gluster_close, .bdrv_close = qemu_gluster_close,
.bdrv_create2 = qemu_gluster_create, .bdrv_create = qemu_gluster_create,
.bdrv_getlength = qemu_gluster_getlength, .bdrv_getlength = qemu_gluster_getlength,
.bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size, .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
.bdrv_truncate = qemu_gluster_truncate, .bdrv_truncate = qemu_gluster_truncate,
...@@ -806,7 +806,7 @@ static BlockDriver bdrv_gluster_rdma = { ...@@ -806,7 +806,7 @@ static BlockDriver bdrv_gluster_rdma = {
.bdrv_reopen_commit = qemu_gluster_reopen_commit, .bdrv_reopen_commit = qemu_gluster_reopen_commit,
.bdrv_reopen_abort = qemu_gluster_reopen_abort, .bdrv_reopen_abort = qemu_gluster_reopen_abort,
.bdrv_close = qemu_gluster_close, .bdrv_close = qemu_gluster_close,
.bdrv_create2 = qemu_gluster_create, .bdrv_create = qemu_gluster_create,
.bdrv_getlength = qemu_gluster_getlength, .bdrv_getlength = qemu_gluster_getlength,
.bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size, .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
.bdrv_truncate = qemu_gluster_truncate, .bdrv_truncate = qemu_gluster_truncate,
......
...@@ -1605,7 +1605,7 @@ static BlockDriver bdrv_iscsi = { ...@@ -1605,7 +1605,7 @@ static BlockDriver bdrv_iscsi = {
.bdrv_needs_filename = true, .bdrv_needs_filename = true,
.bdrv_file_open = iscsi_open, .bdrv_file_open = iscsi_open,
.bdrv_close = iscsi_close, .bdrv_close = iscsi_close,
.bdrv_create2 = iscsi_create, .bdrv_create = iscsi_create,
.create_opts = &iscsi_create_opts, .create_opts = &iscsi_create_opts,
.bdrv_reopen_prepare = iscsi_reopen_prepare, .bdrv_reopen_prepare = iscsi_reopen_prepare,
......
...@@ -457,7 +457,7 @@ static BlockDriver bdrv_nfs = { ...@@ -457,7 +457,7 @@ static BlockDriver bdrv_nfs = {
.bdrv_file_open = nfs_file_open, .bdrv_file_open = nfs_file_open,
.bdrv_close = nfs_file_close, .bdrv_close = nfs_file_close,
.bdrv_create2 = nfs_file_create, .bdrv_create = nfs_file_create,
.bdrv_co_readv = nfs_co_readv, .bdrv_co_readv = nfs_co_readv,
.bdrv_co_writev = nfs_co_writev, .bdrv_co_writev = nfs_co_writev,
......
...@@ -712,7 +712,7 @@ static int qcow_create(const char *filename, QemuOpts *opts, Error **errp) ...@@ -712,7 +712,7 @@ static int qcow_create(const char *filename, QemuOpts *opts, Error **errp)
flags |= BLOCK_FLAG_ENCRYPT; flags |= BLOCK_FLAG_ENCRYPT;
} }
ret = bdrv_create_file(filename, NULL, opts, &local_err); ret = bdrv_create_file(filename, opts, &local_err);
if (ret < 0) { if (ret < 0) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
goto cleanup; goto cleanup;
...@@ -939,7 +939,7 @@ static BlockDriver bdrv_qcow = { ...@@ -939,7 +939,7 @@ static BlockDriver bdrv_qcow = {
.bdrv_open = qcow_open, .bdrv_open = qcow_open,
.bdrv_close = qcow_close, .bdrv_close = qcow_close,
.bdrv_reopen_prepare = qcow_reopen_prepare, .bdrv_reopen_prepare = qcow_reopen_prepare,
.bdrv_create2 = qcow_create, .bdrv_create = qcow_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_co_readv = qcow_co_readv, .bdrv_co_readv = qcow_co_readv,
......
...@@ -1627,7 +1627,7 @@ static int qcow2_create2(const char *filename, int64_t total_size, ...@@ -1627,7 +1627,7 @@ static int qcow2_create2(const char *filename, int64_t total_size,
Error *local_err = NULL; Error *local_err = NULL;
int ret; int ret;
ret = bdrv_create_file(filename, NULL, opts, &local_err); ret = bdrv_create_file(filename, opts, &local_err);
if (ret < 0) { if (ret < 0) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
return ret; return ret;
...@@ -2393,7 +2393,7 @@ static BlockDriver bdrv_qcow2 = { ...@@ -2393,7 +2393,7 @@ static BlockDriver bdrv_qcow2 = {
.bdrv_open = qcow2_open, .bdrv_open = qcow2_open,
.bdrv_close = qcow2_close, .bdrv_close = qcow2_close,
.bdrv_reopen_prepare = qcow2_reopen_prepare, .bdrv_reopen_prepare = qcow2_reopen_prepare,
.bdrv_create2 = qcow2_create, .bdrv_create = qcow2_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_co_get_block_status = qcow2_co_get_block_status, .bdrv_co_get_block_status = qcow2_co_get_block_status,
.bdrv_set_key = qcow2_set_key, .bdrv_set_key = qcow2_set_key,
...@@ -2425,7 +2425,7 @@ static BlockDriver bdrv_qcow2 = { ...@@ -2425,7 +2425,7 @@ static BlockDriver bdrv_qcow2 = {
.create_opts = &qcow2_create_opts, .create_opts = &qcow2_create_opts,
.bdrv_check = qcow2_check, .bdrv_check = qcow2_check,
.bdrv_amend_options2 = qcow2_amend_options, .bdrv_amend_options = qcow2_amend_options,
}; };
static void bdrv_qcow2_init(void) static void bdrv_qcow2_init(void)
......
...@@ -586,7 +586,7 @@ static int qed_create(const char *filename, uint32_t cluster_size, ...@@ -586,7 +586,7 @@ static int qed_create(const char *filename, uint32_t cluster_size,
int ret = 0; int ret = 0;
BlockDriverState *bs; BlockDriverState *bs;
ret = bdrv_create_file(filename, NULL, NULL, &local_err); ret = bdrv_create_file(filename, NULL, &local_err);
if (ret < 0) { if (ret < 0) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
return ret; return ret;
...@@ -1658,7 +1658,7 @@ static BlockDriver bdrv_qed = { ...@@ -1658,7 +1658,7 @@ static BlockDriver bdrv_qed = {
.bdrv_open = bdrv_qed_open, .bdrv_open = bdrv_qed_open,
.bdrv_close = bdrv_qed_close, .bdrv_close = bdrv_qed_close,
.bdrv_reopen_prepare = bdrv_qed_reopen_prepare, .bdrv_reopen_prepare = bdrv_qed_reopen_prepare,
.bdrv_create2 = bdrv_qed_create, .bdrv_create = bdrv_qed_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_co_get_block_status = bdrv_qed_co_get_block_status, .bdrv_co_get_block_status = bdrv_qed_co_get_block_status,
.bdrv_aio_readv = bdrv_qed_aio_readv, .bdrv_aio_readv = bdrv_qed_aio_readv,
......
...@@ -1493,7 +1493,7 @@ static BlockDriver bdrv_file = { ...@@ -1493,7 +1493,7 @@ static BlockDriver bdrv_file = {
.bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_commit = raw_reopen_commit,
.bdrv_reopen_abort = raw_reopen_abort, .bdrv_reopen_abort = raw_reopen_abort,
.bdrv_close = raw_close, .bdrv_close = raw_close,
.bdrv_create2 = raw_create, .bdrv_create = raw_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_co_get_block_status = raw_co_get_block_status, .bdrv_co_get_block_status = raw_co_get_block_status,
.bdrv_co_write_zeroes = raw_co_write_zeroes, .bdrv_co_write_zeroes = raw_co_write_zeroes,
...@@ -1893,7 +1893,7 @@ static BlockDriver bdrv_host_device = { ...@@ -1893,7 +1893,7 @@ static BlockDriver bdrv_host_device = {
.bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_prepare = raw_reopen_prepare,
.bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_commit = raw_reopen_commit,
.bdrv_reopen_abort = raw_reopen_abort, .bdrv_reopen_abort = raw_reopen_abort,
.bdrv_create2 = hdev_create, .bdrv_create = hdev_create,
.create_opts = &raw_create_opts, .create_opts = &raw_create_opts,
.bdrv_co_write_zeroes = hdev_co_write_zeroes, .bdrv_co_write_zeroes = hdev_co_write_zeroes,
...@@ -2040,7 +2040,7 @@ static BlockDriver bdrv_host_floppy = { ...@@ -2040,7 +2040,7 @@ static BlockDriver bdrv_host_floppy = {
.bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_prepare = raw_reopen_prepare,
.bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_commit = raw_reopen_commit,
.bdrv_reopen_abort = raw_reopen_abort, .bdrv_reopen_abort = raw_reopen_abort,
.bdrv_create2 = hdev_create, .bdrv_create = hdev_create,
.create_opts = &raw_create_opts, .create_opts = &raw_create_opts,
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
...@@ -2168,7 +2168,7 @@ static BlockDriver bdrv_host_cdrom = { ...@@ -2168,7 +2168,7 @@ static BlockDriver bdrv_host_cdrom = {
.bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_prepare = raw_reopen_prepare,
.bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_commit = raw_reopen_commit,
.bdrv_reopen_abort = raw_reopen_abort, .bdrv_reopen_abort = raw_reopen_abort,
.bdrv_create2 = hdev_create, .bdrv_create = hdev_create,
.create_opts = &raw_create_opts, .create_opts = &raw_create_opts,
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
...@@ -2302,7 +2302,7 @@ static BlockDriver bdrv_host_cdrom = { ...@@ -2302,7 +2302,7 @@ static BlockDriver bdrv_host_cdrom = {
.bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_prepare = raw_reopen_prepare,
.bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_commit = raw_reopen_commit,
.bdrv_reopen_abort = raw_reopen_abort, .bdrv_reopen_abort = raw_reopen_abort,
.bdrv_create2 = hdev_create, .bdrv_create = hdev_create,
.create_opts = &raw_create_opts, .create_opts = &raw_create_opts,
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
......
...@@ -548,7 +548,7 @@ static BlockDriver bdrv_file = { ...@@ -548,7 +548,7 @@ static BlockDriver bdrv_file = {
.bdrv_parse_filename = raw_parse_filename, .bdrv_parse_filename = raw_parse_filename,
.bdrv_file_open = raw_open, .bdrv_file_open = raw_open,
.bdrv_close = raw_close, .bdrv_close = raw_close,
.bdrv_create2 = raw_create, .bdrv_create = raw_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
......
...@@ -148,7 +148,7 @@ static int raw_create(const char *filename, QemuOpts *opts, Error **errp) ...@@ -148,7 +148,7 @@ static int raw_create(const char *filename, QemuOpts *opts, Error **errp)
Error *local_err = NULL; Error *local_err = NULL;
int ret; int ret;
ret = bdrv_create_file(filename, NULL, opts, &local_err); ret = bdrv_create_file(filename, opts, &local_err);
if (local_err) { if (local_err) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
} }
...@@ -180,7 +180,7 @@ static BlockDriver bdrv_raw = { ...@@ -180,7 +180,7 @@ static BlockDriver bdrv_raw = {
.bdrv_reopen_prepare = &raw_reopen_prepare, .bdrv_reopen_prepare = &raw_reopen_prepare,
.bdrv_open = &raw_open, .bdrv_open = &raw_open,
.bdrv_close = &raw_close, .bdrv_close = &raw_close,
.bdrv_create2 = &raw_create, .bdrv_create = &raw_create,
.bdrv_co_readv = &raw_co_readv, .bdrv_co_readv = &raw_co_readv,
.bdrv_co_writev = &raw_co_writev, .bdrv_co_writev = &raw_co_writev,
.bdrv_co_write_zeroes = &raw_co_write_zeroes, .bdrv_co_write_zeroes = &raw_co_write_zeroes,
......
...@@ -928,7 +928,7 @@ static BlockDriver bdrv_rbd = { ...@@ -928,7 +928,7 @@ static BlockDriver bdrv_rbd = {
.bdrv_needs_filename = true, .bdrv_needs_filename = true,
.bdrv_file_open = qemu_rbd_open, .bdrv_file_open = qemu_rbd_open,
.bdrv_close = qemu_rbd_close, .bdrv_close = qemu_rbd_close,
.bdrv_create2 = qemu_rbd_create, .bdrv_create = qemu_rbd_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_get_info = qemu_rbd_getinfo, .bdrv_get_info = qemu_rbd_getinfo,
.create_opts = &qemu_rbd_create_opts, .create_opts = &qemu_rbd_create_opts,
......
...@@ -2603,7 +2603,7 @@ static BlockDriver bdrv_sheepdog = { ...@@ -2603,7 +2603,7 @@ static BlockDriver bdrv_sheepdog = {
.bdrv_needs_filename = true, .bdrv_needs_filename = true,
.bdrv_file_open = sd_open, .bdrv_file_open = sd_open,
.bdrv_close = sd_close, .bdrv_close = sd_close,
.bdrv_create2 = sd_create, .bdrv_create = sd_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_getlength = sd_getlength, .bdrv_getlength = sd_getlength,
.bdrv_get_allocated_file_size = sd_get_allocated_file_size, .bdrv_get_allocated_file_size = sd_get_allocated_file_size,
...@@ -2636,7 +2636,7 @@ static BlockDriver bdrv_sheepdog_tcp = { ...@@ -2636,7 +2636,7 @@ static BlockDriver bdrv_sheepdog_tcp = {
.bdrv_needs_filename = true, .bdrv_needs_filename = true,
.bdrv_file_open = sd_open, .bdrv_file_open = sd_open,
.bdrv_close = sd_close, .bdrv_close = sd_close,
.bdrv_create2 = sd_create, .bdrv_create = sd_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_getlength = sd_getlength, .bdrv_getlength = sd_getlength,
.bdrv_get_allocated_file_size = sd_get_allocated_file_size, .bdrv_get_allocated_file_size = sd_get_allocated_file_size,
...@@ -2669,7 +2669,7 @@ static BlockDriver bdrv_sheepdog_unix = { ...@@ -2669,7 +2669,7 @@ static BlockDriver bdrv_sheepdog_unix = {
.bdrv_needs_filename = true, .bdrv_needs_filename = true,
.bdrv_file_open = sd_open, .bdrv_file_open = sd_open,
.bdrv_close = sd_close, .bdrv_close = sd_close,
.bdrv_create2 = sd_create, .bdrv_create = sd_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_getlength = sd_getlength, .bdrv_getlength = sd_getlength,
.bdrv_get_allocated_file_size = sd_get_allocated_file_size, .bdrv_get_allocated_file_size = sd_get_allocated_file_size,
......
...@@ -1075,7 +1075,7 @@ static BlockDriver bdrv_ssh = { ...@@ -1075,7 +1075,7 @@ static BlockDriver bdrv_ssh = {
.instance_size = sizeof(BDRVSSHState), .instance_size = sizeof(BDRVSSHState),
.bdrv_parse_filename = ssh_parse_filename, .bdrv_parse_filename = ssh_parse_filename,
.bdrv_file_open = ssh_file_open, .bdrv_file_open = ssh_file_open,
.bdrv_create2 = ssh_create, .bdrv_create = ssh_create,
.bdrv_close = ssh_close, .bdrv_close = ssh_close,
.bdrv_has_zero_init = ssh_has_zero_init, .bdrv_has_zero_init = ssh_has_zero_init,
.bdrv_co_readv = ssh_co_readv, .bdrv_co_readv = ssh_co_readv,
......
...@@ -830,7 +830,7 @@ static BlockDriver bdrv_vdi = { ...@@ -830,7 +830,7 @@ static BlockDriver bdrv_vdi = {
.bdrv_open = vdi_open, .bdrv_open = vdi_open,
.bdrv_close = vdi_close, .bdrv_close = vdi_close,
.bdrv_reopen_prepare = vdi_reopen_prepare, .bdrv_reopen_prepare = vdi_reopen_prepare,
.bdrv_create2 = vdi_create, .bdrv_create = vdi_create,
.bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_co_get_block_status = vdi_co_get_block_status, .bdrv_co_get_block_status = vdi_co_get_block_status,
.bdrv_make_empty = vdi_make_empty, .bdrv_make_empty = vdi_make_empty,
......
...@@ -1793,7 +1793,7 @@ static int vhdx_create(const char *filename, QemuOpts *opts, Error **errp) ...@@ -1793,7 +1793,7 @@ static int vhdx_create(const char *filename, QemuOpts *opts, Error **errp)
block_size = block_size > VHDX_BLOCK_SIZE_MAX ? VHDX_BLOCK_SIZE_MAX : block_size = block_size > VHDX_BLOCK_SIZE_MAX ? VHDX_BLOCK_SIZE_MAX :
block_size; block_size;
ret = bdrv_create_file(filename, NULL, opts, &local_err); ret = bdrv_create_file(filename, opts, &local_err);
if (ret < 0) { if (ret < 0) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
goto exit; goto exit;
...@@ -1922,7 +1922,7 @@ static BlockDriver bdrv_vhdx = { ...@@ -1922,7 +1922,7 @@ static BlockDriver bdrv_vhdx = {
.bdrv_reopen_prepare = vhdx_reopen_prepare, .bdrv_reopen_prepare = vhdx_reopen_prepare,
.bdrv_co_readv = vhdx_co_readv, .bdrv_co_readv = vhdx_co_readv,
.bdrv_co_writev = vhdx_co_writev, .bdrv_co_writev = vhdx_co_writev,
.bdrv_create2 = vhdx_create, .bdrv_create = vhdx_create,
.bdrv_get_info = vhdx_get_info, .bdrv_get_info = vhdx_get_info,
.bdrv_check = vhdx_check, .bdrv_check = vhdx_check,
......
...@@ -1539,7 +1539,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize, ...@@ -1539,7 +1539,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
uint32_t *gd_buf = NULL; uint32_t *gd_buf = NULL;
int gd_buf_size; int gd_buf_size;
ret = bdrv_create_file(filename, NULL, NULL, &local_err); ret = bdrv_create_file(filename, NULL, &local_err);
if (ret < 0) { if (ret < 0) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
goto exit; goto exit;
...@@ -1873,7 +1873,7 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp) ...@@ -1873,7 +1873,7 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp)
if (!split && !flat) { if (!split && !flat) {
desc_offset = 0x200; desc_offset = 0x200;
} else { } else {
ret = bdrv_create_file(filename, NULL, opts, &local_err); ret = bdrv_create_file(filename, opts, &local_err);
if (ret < 0) { if (ret < 0) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
goto exit; goto exit;
...@@ -2169,7 +2169,7 @@ static BlockDriver bdrv_vmdk = { ...@@ -2169,7 +2169,7 @@ static BlockDriver bdrv_vmdk = {
.bdrv_write_compressed = vmdk_write_compressed, .bdrv_write_compressed = vmdk_write_compressed,
.bdrv_co_write_zeroes = vmdk_co_write_zeroes, .bdrv_co_write_zeroes = vmdk_co_write_zeroes,
.bdrv_close = vmdk_close, .bdrv_close = vmdk_close,
.bdrv_create2 = vmdk_create, .bdrv_create = vmdk_create,
.bdrv_co_flush_to_disk = vmdk_co_flush, .bdrv_co_flush_to_disk = vmdk_co_flush,
.bdrv_co_get_block_status = vmdk_co_get_block_status, .bdrv_co_get_block_status = vmdk_co_get_block_status,
.bdrv_get_allocated_file_size = vmdk_get_allocated_file_size, .bdrv_get_allocated_file_size = vmdk_get_allocated_file_size,
......
...@@ -896,7 +896,7 @@ static BlockDriver bdrv_vpc = { ...@@ -896,7 +896,7 @@ static BlockDriver bdrv_vpc = {
.bdrv_open = vpc_open, .bdrv_open = vpc_open,
.bdrv_close = vpc_close, .bdrv_close = vpc_close,
.bdrv_reopen_prepare = vpc_reopen_prepare, .bdrv_reopen_prepare = vpc_reopen_prepare,
.bdrv_create2 = vpc_create, .bdrv_create = vpc_create,
.bdrv_read = vpc_co_read, .bdrv_read = vpc_co_read,
.bdrv_write = vpc_co_write, .bdrv_write = vpc_co_write,
......
...@@ -2911,7 +2911,6 @@ static BlockDriver vvfat_write_target = { ...@@ -2911,7 +2911,6 @@ static BlockDriver vvfat_write_target = {
static int enable_write_target(BDRVVVFATState *s, Error **errp) static int enable_write_target(BDRVVVFATState *s, Error **errp)