@@ -4294,7 +4294,8 @@ bdrv_acct_done(BlockDriverState *bs, BlockAcctCookie *cookie)
int bdrv_img_create(const char *filename, const char *fmt,
const char *base_filename, const char *base_fmt,
- char *options, uint64_t img_size, int flags)
+ char *options, uint64_t img_size, int flags,
+ QEMUOptionParameter **param_ret)
{
QEMUOptionParameter *param = NULL, *create_options = NULL;
QEMUOptionParameter *backing_fmt, *backing_file, *size;
@@ -4430,6 +4431,10 @@ int bdrv_img_create(const char *filename, const char *fmt,
}
out:
+ if (param_ret) {
+ *param_ret = append_option_parameters(NULL, param);
+ }
+
free_option_parameters(create_options);
free_option_parameters(param);
@@ -341,7 +341,8 @@ int bdrv_load_vmstate(BlockDriverState *bs, uint8_t *buf,
int bdrv_img_create(const char *filename, const char *fmt,
const char *base_filename, const char *base_fmt,
- char *options, uint64_t img_size, int flags);
+ char *options, uint64_t img_size, int flags,
+ QEMUOptionParameter **param_ret);
void bdrv_set_buffer_alignment(BlockDriverState *bs, int align);
void *qemu_blockalign(BlockDriverState *bs, size_t size);
@@ -783,7 +783,7 @@ void qmp_transaction(BlockdevActionList *dev_list, Error **errp)
ret = bdrv_img_create(new_image_file, format,
states->old_bs->filename,
states->old_bs->drv->format_name,
- NULL, -1, flags);
+ NULL, -1, flags, NULL);
if (ret) {
error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file);
goto delete_and_fail;
@@ -362,7 +362,7 @@ static int img_create(int argc, char **argv)
}
ret = bdrv_img_create(filename, fmt, base_filename, base_fmt,
- options, img_size, BDRV_O_FLAGS);
+ options, img_size, BDRV_O_FLAGS, NULL);
out:
if (ret) {
return 1;
If set returns a copy of the parameter list used by the block driver to create the image. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> --- block.c | 7 ++++++- block.h | 3 ++- blockdev.c | 2 +- qemu-img.c | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-)