block: Make errp the last parameter of bdrv_img_create

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-6-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Fam Zheng 2017-04-21 20:27:01 +08:00 committed by Markus Armbruster
parent 1a9a7f25a0
commit 9217283dc8
5 changed files with 13 additions and 13 deletions

View File

@ -4161,8 +4161,8 @@ bool bdrv_op_blocker_is_empty(BlockDriverState *bs)
void bdrv_img_create(const char *filename, const char *fmt, void bdrv_img_create(const char *filename, const char *fmt,
const char *base_filename, const char *base_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, bool quiet,
Error **errp, bool quiet) Error **errp)
{ {
QemuOptsList *create_opts = NULL; QemuOptsList *create_opts = NULL;
QemuOpts *opts = NULL; QemuOpts *opts = NULL;

View File

@ -1728,7 +1728,7 @@ static void external_snapshot_prepare(BlkActionState *common,
bdrv_img_create(new_image_file, format, bdrv_img_create(new_image_file, format,
state->old_bs->filename, state->old_bs->filename,
state->old_bs->drv->format_name, state->old_bs->drv->format_name,
NULL, size, flags, &local_err, false); NULL, size, flags, false, &local_err);
if (local_err) { if (local_err) {
error_propagate(errp, local_err); error_propagate(errp, local_err);
return; return;
@ -3237,10 +3237,10 @@ static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn,
if (source) { if (source) {
bdrv_img_create(backup->target, backup->format, source->filename, bdrv_img_create(backup->target, backup->format, source->filename,
source->drv->format_name, NULL, source->drv->format_name, NULL,
size, flags, &local_err, false); size, flags, false, &local_err);
} else { } else {
bdrv_img_create(backup->target, backup->format, NULL, NULL, NULL, bdrv_img_create(backup->target, backup->format, NULL, NULL, NULL,
size, flags, &local_err, false); size, flags, false, &local_err);
} }
} }
@ -3531,7 +3531,7 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
/* create new image w/o backing file */ /* create new image w/o backing file */
assert(format); assert(format);
bdrv_img_create(arg->target, format, bdrv_img_create(arg->target, format,
NULL, NULL, NULL, size, flags, &local_err, false); NULL, NULL, NULL, size, flags, false, &local_err);
} else { } else {
switch (arg->mode) { switch (arg->mode) {
case NEW_IMAGE_MODE_EXISTING: case NEW_IMAGE_MODE_EXISTING:
@ -3541,7 +3541,7 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
bdrv_img_create(arg->target, format, bdrv_img_create(arg->target, format,
source->filename, source->filename,
source->drv->format_name, source->drv->format_name,
NULL, size, flags, &local_err, false); NULL, size, flags, false, &local_err);
break; break;
default: default:
abort(); abort();

View File

@ -509,7 +509,7 @@ int bdrv_load_vmstate(BlockDriverState *bs, uint8_t *buf,
void bdrv_img_create(const char *filename, const char *fmt, void bdrv_img_create(const char *filename, const char *fmt,
const char *base_filename, const char *base_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,
Error **errp, bool quiet); bool quiet, Error **errp);
/* Returns the alignment in bytes that is required so that no bounce buffer /* Returns the alignment in bytes that is required so that no bounce buffer
* is required throughout the stack */ * is required throughout the stack */

View File

@ -516,7 +516,7 @@ static int img_create(int argc, char **argv)
} }
bdrv_img_create(filename, fmt, base_filename, base_fmt, bdrv_img_create(filename, fmt, base_filename, base_fmt,
options, img_size, 0, &local_err, quiet); options, img_size, 0, quiet, &local_err);
if (local_err) { if (local_err) {
error_reportf_err(local_err, "%s: ", filename); error_reportf_err(local_err, "%s: ", filename);
goto fail; goto fail;

View File

@ -144,18 +144,18 @@ static void prepare_imgs(void)
/* Primary */ /* Primary */
bdrv_img_create(p_local_disk, "qcow2", NULL, NULL, NULL, IMG_SIZE, bdrv_img_create(p_local_disk, "qcow2", NULL, NULL, NULL, IMG_SIZE,
BDRV_O_RDWR, &local_err, true); BDRV_O_RDWR, true, &local_err);
g_assert(!local_err); g_assert(!local_err);
/* Secondary */ /* Secondary */
bdrv_img_create(s_local_disk, "qcow2", NULL, NULL, NULL, IMG_SIZE, bdrv_img_create(s_local_disk, "qcow2", NULL, NULL, NULL, IMG_SIZE,
BDRV_O_RDWR, &local_err, true); BDRV_O_RDWR, true, &local_err);
g_assert(!local_err); g_assert(!local_err);
bdrv_img_create(s_active_disk, "qcow2", NULL, NULL, NULL, IMG_SIZE, bdrv_img_create(s_active_disk, "qcow2", NULL, NULL, NULL, IMG_SIZE,
BDRV_O_RDWR, &local_err, true); BDRV_O_RDWR, true, &local_err);
g_assert(!local_err); g_assert(!local_err);
bdrv_img_create(s_hidden_disk, "qcow2", NULL, NULL, NULL, IMG_SIZE, bdrv_img_create(s_hidden_disk, "qcow2", NULL, NULL, NULL, IMG_SIZE,
BDRV_O_RDWR, &local_err, true); BDRV_O_RDWR, true, &local_err);
g_assert(!local_err); g_assert(!local_err);
} }