diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/cow.c | 4 | ||||
-rw-r--r-- | block/gluster.c | 8 | ||||
-rw-r--r-- | block/iscsi.c | 2 | ||||
-rw-r--r-- | block/nfs.c | 2 | ||||
-rw-r--r-- | block/qcow.c | 4 | ||||
-rw-r--r-- | block/qcow2.c | 6 | ||||
-rw-r--r-- | block/qed.c | 4 | ||||
-rw-r--r-- | block/raw-posix.c | 10 | ||||
-rw-r--r-- | block/raw-win32.c | 2 | ||||
-rw-r--r-- | block/raw_bsd.c | 4 | ||||
-rw-r--r-- | block/rbd.c | 2 | ||||
-rw-r--r-- | block/sheepdog.c | 6 | ||||
-rw-r--r-- | block/ssh.c | 2 | ||||
-rw-r--r-- | block/vdi.c | 2 | ||||
-rw-r--r-- | block/vhdx.c | 4 | ||||
-rw-r--r-- | block/vmdk.c | 6 | ||||
-rw-r--r-- | block/vpc.c | 2 | ||||
-rw-r--r-- | block/vvfat.c | 14 |
18 files changed, 37 insertions, 47 deletions
diff --git a/block/cow.c b/block/cow.c index af8575334a..a05a92cada 100644 --- a/block/cow.c +++ b/block/cow.c @@ -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_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) { error_propagate(errp, local_err); goto exit; @@ -412,7 +412,7 @@ static BlockDriver bdrv_cow = { .bdrv_probe = cow_probe, .bdrv_open = cow_open, .bdrv_close = cow_close, - .bdrv_create2 = cow_create, + .bdrv_create = cow_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_read = cow_co_read, diff --git a/block/gluster.c b/block/gluster.c index 5ff282bd74..9274dead7d 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -725,7 +725,7 @@ static BlockDriver bdrv_gluster = { .bdrv_reopen_commit = qemu_gluster_reopen_commit, .bdrv_reopen_abort = qemu_gluster_reopen_abort, .bdrv_close = qemu_gluster_close, - .bdrv_create2 = qemu_gluster_create, + .bdrv_create = qemu_gluster_create, .bdrv_getlength = qemu_gluster_getlength, .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size, .bdrv_truncate = qemu_gluster_truncate, @@ -752,7 +752,7 @@ static BlockDriver bdrv_gluster_tcp = { .bdrv_reopen_commit = qemu_gluster_reopen_commit, .bdrv_reopen_abort = qemu_gluster_reopen_abort, .bdrv_close = qemu_gluster_close, - .bdrv_create2 = qemu_gluster_create, + .bdrv_create = qemu_gluster_create, .bdrv_getlength = qemu_gluster_getlength, .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size, .bdrv_truncate = qemu_gluster_truncate, @@ -779,7 +779,7 @@ static BlockDriver bdrv_gluster_unix = { .bdrv_reopen_commit = qemu_gluster_reopen_commit, .bdrv_reopen_abort = qemu_gluster_reopen_abort, .bdrv_close = qemu_gluster_close, - .bdrv_create2 = qemu_gluster_create, + .bdrv_create = qemu_gluster_create, .bdrv_getlength = qemu_gluster_getlength, .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size, .bdrv_truncate = qemu_gluster_truncate, @@ -806,7 +806,7 @@ static BlockDriver bdrv_gluster_rdma = { .bdrv_reopen_commit = qemu_gluster_reopen_commit, .bdrv_reopen_abort = qemu_gluster_reopen_abort, .bdrv_close = qemu_gluster_close, - .bdrv_create2 = qemu_gluster_create, + .bdrv_create = qemu_gluster_create, .bdrv_getlength = qemu_gluster_getlength, .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size, .bdrv_truncate = qemu_gluster_truncate, diff --git a/block/iscsi.c b/block/iscsi.c index 626b7df7fd..6f87605e72 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1605,7 +1605,7 @@ static BlockDriver bdrv_iscsi = { .bdrv_needs_filename = true, .bdrv_file_open = iscsi_open, .bdrv_close = iscsi_close, - .bdrv_create2 = iscsi_create, + .bdrv_create = iscsi_create, .create_opts = &iscsi_create_opts, .bdrv_reopen_prepare = iscsi_reopen_prepare, diff --git a/block/nfs.c b/block/nfs.c index 35e5008ead..ec43201817 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -457,7 +457,7 @@ static BlockDriver bdrv_nfs = { .bdrv_file_open = nfs_file_open, .bdrv_close = nfs_file_close, - .bdrv_create2 = nfs_file_create, + .bdrv_create = nfs_file_create, .bdrv_co_readv = nfs_co_readv, .bdrv_co_writev = nfs_co_writev, diff --git a/block/qcow.c b/block/qcow.c index bcacfb852f..1f2bac8a5f 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -712,7 +712,7 @@ static int qcow_create(const char *filename, QemuOpts *opts, Error **errp) flags |= BLOCK_FLAG_ENCRYPT; } - ret = bdrv_create_file(filename, NULL, opts, &local_err); + ret = bdrv_create_file(filename, opts, &local_err); if (ret < 0) { error_propagate(errp, local_err); goto cleanup; @@ -939,7 +939,7 @@ static BlockDriver bdrv_qcow = { .bdrv_open = qcow_open, .bdrv_close = qcow_close, .bdrv_reopen_prepare = qcow_reopen_prepare, - .bdrv_create2 = qcow_create, + .bdrv_create = qcow_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_co_readv = qcow_co_readv, diff --git a/block/qcow2.c b/block/qcow2.c index 7150df66d6..b9d2fa6632 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1627,7 +1627,7 @@ static int qcow2_create2(const char *filename, int64_t total_size, Error *local_err = NULL; int ret; - ret = bdrv_create_file(filename, NULL, opts, &local_err); + ret = bdrv_create_file(filename, opts, &local_err); if (ret < 0) { error_propagate(errp, local_err); return ret; @@ -2393,7 +2393,7 @@ static BlockDriver bdrv_qcow2 = { .bdrv_open = qcow2_open, .bdrv_close = qcow2_close, .bdrv_reopen_prepare = qcow2_reopen_prepare, - .bdrv_create2 = qcow2_create, + .bdrv_create = qcow2_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_co_get_block_status = qcow2_co_get_block_status, .bdrv_set_key = qcow2_set_key, @@ -2425,7 +2425,7 @@ static BlockDriver bdrv_qcow2 = { .create_opts = &qcow2_create_opts, .bdrv_check = qcow2_check, - .bdrv_amend_options2 = qcow2_amend_options, + .bdrv_amend_options = qcow2_amend_options, }; static void bdrv_qcow2_init(void) diff --git a/block/qed.c b/block/qed.c index 7c4276e97c..092e6fb1d2 100644 --- a/block/qed.c +++ b/block/qed.c @@ -586,7 +586,7 @@ static int qed_create(const char *filename, uint32_t cluster_size, int ret = 0; BlockDriverState *bs; - ret = bdrv_create_file(filename, NULL, NULL, &local_err); + ret = bdrv_create_file(filename, NULL, &local_err); if (ret < 0) { error_propagate(errp, local_err); return ret; @@ -1658,7 +1658,7 @@ static BlockDriver bdrv_qed = { .bdrv_open = bdrv_qed_open, .bdrv_close = bdrv_qed_close, .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_co_get_block_status = bdrv_qed_co_get_block_status, .bdrv_aio_readv = bdrv_qed_aio_readv, diff --git a/block/raw-posix.c b/block/raw-posix.c index c718e49d84..dacf4fbbc8 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -1493,7 +1493,7 @@ static BlockDriver bdrv_file = { .bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_abort = raw_reopen_abort, .bdrv_close = raw_close, - .bdrv_create2 = raw_create, + .bdrv_create = raw_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_co_get_block_status = raw_co_get_block_status, .bdrv_co_write_zeroes = raw_co_write_zeroes, @@ -1893,7 +1893,7 @@ static BlockDriver bdrv_host_device = { .bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_abort = raw_reopen_abort, - .bdrv_create2 = hdev_create, + .bdrv_create = hdev_create, .create_opts = &raw_create_opts, .bdrv_co_write_zeroes = hdev_co_write_zeroes, @@ -2040,7 +2040,7 @@ static BlockDriver bdrv_host_floppy = { .bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_abort = raw_reopen_abort, - .bdrv_create2 = hdev_create, + .bdrv_create = hdev_create, .create_opts = &raw_create_opts, .bdrv_aio_readv = raw_aio_readv, @@ -2168,7 +2168,7 @@ static BlockDriver bdrv_host_cdrom = { .bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_abort = raw_reopen_abort, - .bdrv_create2 = hdev_create, + .bdrv_create = hdev_create, .create_opts = &raw_create_opts, .bdrv_aio_readv = raw_aio_readv, @@ -2302,7 +2302,7 @@ static BlockDriver bdrv_host_cdrom = { .bdrv_reopen_prepare = raw_reopen_prepare, .bdrv_reopen_commit = raw_reopen_commit, .bdrv_reopen_abort = raw_reopen_abort, - .bdrv_create2 = hdev_create, + .bdrv_create = hdev_create, .create_opts = &raw_create_opts, .bdrv_aio_readv = raw_aio_readv, diff --git a/block/raw-win32.c b/block/raw-win32.c index a71de70f68..902eab6100 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -548,7 +548,7 @@ static BlockDriver bdrv_file = { .bdrv_parse_filename = raw_parse_filename, .bdrv_file_open = raw_open, .bdrv_close = raw_close, - .bdrv_create2 = raw_create, + .bdrv_create = raw_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_aio_readv = raw_aio_readv, diff --git a/block/raw_bsd.c b/block/raw_bsd.c index ee797fd877..492f58de69 100644 --- a/block/raw_bsd.c +++ b/block/raw_bsd.c @@ -148,7 +148,7 @@ static int raw_create(const char *filename, QemuOpts *opts, Error **errp) Error *local_err = NULL; int ret; - ret = bdrv_create_file(filename, NULL, opts, &local_err); + ret = bdrv_create_file(filename, opts, &local_err); if (local_err) { error_propagate(errp, local_err); } @@ -180,7 +180,7 @@ static BlockDriver bdrv_raw = { .bdrv_reopen_prepare = &raw_reopen_prepare, .bdrv_open = &raw_open, .bdrv_close = &raw_close, - .bdrv_create2 = &raw_create, + .bdrv_create = &raw_create, .bdrv_co_readv = &raw_co_readv, .bdrv_co_writev = &raw_co_writev, .bdrv_co_write_zeroes = &raw_co_write_zeroes, diff --git a/block/rbd.c b/block/rbd.c index e15d3129a5..2b797d3e8b 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -928,7 +928,7 @@ static BlockDriver bdrv_rbd = { .bdrv_needs_filename = true, .bdrv_file_open = qemu_rbd_open, .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_get_info = qemu_rbd_getinfo, .create_opts = &qemu_rbd_create_opts, diff --git a/block/sheepdog.c b/block/sheepdog.c index 07c467d010..2dcc5959f4 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2603,7 +2603,7 @@ static BlockDriver bdrv_sheepdog = { .bdrv_needs_filename = true, .bdrv_file_open = sd_open, .bdrv_close = sd_close, - .bdrv_create2 = sd_create, + .bdrv_create = sd_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_getlength = sd_getlength, .bdrv_get_allocated_file_size = sd_get_allocated_file_size, @@ -2636,7 +2636,7 @@ static BlockDriver bdrv_sheepdog_tcp = { .bdrv_needs_filename = true, .bdrv_file_open = sd_open, .bdrv_close = sd_close, - .bdrv_create2 = sd_create, + .bdrv_create = sd_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_getlength = sd_getlength, .bdrv_get_allocated_file_size = sd_get_allocated_file_size, @@ -2669,7 +2669,7 @@ static BlockDriver bdrv_sheepdog_unix = { .bdrv_needs_filename = true, .bdrv_file_open = sd_open, .bdrv_close = sd_close, - .bdrv_create2 = sd_create, + .bdrv_create = sd_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_getlength = sd_getlength, .bdrv_get_allocated_file_size = sd_get_allocated_file_size, diff --git a/block/ssh.c b/block/ssh.c index 9696c2bc1f..cd2fd751fe 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -1075,7 +1075,7 @@ static BlockDriver bdrv_ssh = { .instance_size = sizeof(BDRVSSHState), .bdrv_parse_filename = ssh_parse_filename, .bdrv_file_open = ssh_file_open, - .bdrv_create2 = ssh_create, + .bdrv_create = ssh_create, .bdrv_close = ssh_close, .bdrv_has_zero_init = ssh_has_zero_init, .bdrv_co_readv = ssh_co_readv, diff --git a/block/vdi.c b/block/vdi.c index 31d9b3ce44..01fe22ebe8 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -830,7 +830,7 @@ static BlockDriver bdrv_vdi = { .bdrv_open = vdi_open, .bdrv_close = vdi_close, .bdrv_reopen_prepare = vdi_reopen_prepare, - .bdrv_create2 = vdi_create, + .bdrv_create = vdi_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, .bdrv_co_get_block_status = vdi_co_get_block_status, .bdrv_make_empty = vdi_make_empty, diff --git a/block/vhdx.c b/block/vhdx.c index e36f897953..fedcf9f9ca 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -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; - ret = bdrv_create_file(filename, NULL, opts, &local_err); + ret = bdrv_create_file(filename, opts, &local_err); if (ret < 0) { error_propagate(errp, local_err); goto exit; @@ -1922,7 +1922,7 @@ static BlockDriver bdrv_vhdx = { .bdrv_reopen_prepare = vhdx_reopen_prepare, .bdrv_co_readv = vhdx_co_readv, .bdrv_co_writev = vhdx_co_writev, - .bdrv_create2 = vhdx_create, + .bdrv_create = vhdx_create, .bdrv_get_info = vhdx_get_info, .bdrv_check = vhdx_check, diff --git a/block/vmdk.c b/block/vmdk.c index d19f15b7da..83dd6fe4fb 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1539,7 +1539,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize, uint32_t *gd_buf = NULL; int gd_buf_size; - ret = bdrv_create_file(filename, NULL, NULL, &local_err); + ret = bdrv_create_file(filename, NULL, &local_err); if (ret < 0) { error_propagate(errp, local_err); goto exit; @@ -1873,7 +1873,7 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp) if (!split && !flat) { desc_offset = 0x200; } else { - ret = bdrv_create_file(filename, NULL, opts, &local_err); + ret = bdrv_create_file(filename, opts, &local_err); if (ret < 0) { error_propagate(errp, local_err); goto exit; @@ -2169,7 +2169,7 @@ static BlockDriver bdrv_vmdk = { .bdrv_write_compressed = vmdk_write_compressed, .bdrv_co_write_zeroes = vmdk_co_write_zeroes, .bdrv_close = vmdk_close, - .bdrv_create2 = vmdk_create, + .bdrv_create = vmdk_create, .bdrv_co_flush_to_disk = vmdk_co_flush, .bdrv_co_get_block_status = vmdk_co_get_block_status, .bdrv_get_allocated_file_size = vmdk_get_allocated_file_size, diff --git a/block/vpc.c b/block/vpc.c index 8ebf424037..798d8540db 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -896,7 +896,7 @@ static BlockDriver bdrv_vpc = { .bdrv_open = vpc_open, .bdrv_close = vpc_close, .bdrv_reopen_prepare = vpc_reopen_prepare, - .bdrv_create2 = vpc_create, + .bdrv_create = vpc_create, .bdrv_read = vpc_co_read, .bdrv_write = vpc_co_write, diff --git a/block/vvfat.c b/block/vvfat.c index b1ab195334..70176b1619 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2911,7 +2911,6 @@ static BlockDriver vvfat_write_target = { static int enable_write_target(BDRVVVFATState *s, Error **errp) { BlockDriver *bdrv_qcow = NULL; - QemuOptsList *create_opts = NULL; QemuOpts *opts = NULL; int ret; int size = sector2cluster(s, s->sector_count); @@ -2927,21 +2926,12 @@ static int enable_write_target(BDRVVVFATState *s, Error **errp) } bdrv_qcow = bdrv_find_format("qcow"); - assert(!(bdrv_qcow->create_opts && bdrv_qcow->create_options)); - if (bdrv_qcow->create_options) { - create_opts = params_to_opts(bdrv_qcow->create_options); - } else { - create_opts = bdrv_qcow->create_opts; - } - opts = qemu_opts_create(create_opts, NULL, 0, &error_abort); + opts = qemu_opts_create(bdrv_qcow->create_opts, NULL, 0, &error_abort); qemu_opt_set_number(opts, BLOCK_OPT_SIZE, s->sector_count * 512); qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, "fat:"); - ret = bdrv_create(bdrv_qcow, s->qcow_filename, NULL, opts, errp); + ret = bdrv_create(bdrv_qcow, s->qcow_filename, opts, errp); qemu_opts_del(opts); - if (bdrv_qcow->create_options) { - qemu_opts_free(create_opts); - } if (ret < 0) { goto err; } |