aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2017-04-21 20:27:01 +0800
committerMarkus Armbruster <armbru@redhat.com>2017-04-24 09:12:59 +0200
commit9217283dc8ce48688ea0556763574c0333faf79c (patch)
tree73e7cbbf55c08c5c2d9daed8952d701770ef604b
parent1a9a7f25a0a4a3cc0a3ac1dc984c2dcde1b09c67 (diff)
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>
-rw-r--r--block.c4
-rw-r--r--blockdev.c10
-rw-r--r--include/block/block.h2
-rw-r--r--qemu-img.c2
-rw-r--r--tests/test-replication.c8
5 files changed, 13 insertions, 13 deletions
diff --git a/block.c b/block.c
index 1fbbb8d606..7eda9a42b3 100644
--- a/block.c
+++ b/block.c
@@ -4161,8 +4161,8 @@ bool bdrv_op_blocker_is_empty(BlockDriverState *bs)
void 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,
- Error **errp, bool quiet)
+ char *options, uint64_t img_size, int flags, bool quiet,
+ Error **errp)
{
QemuOptsList *create_opts = NULL;
QemuOpts *opts = NULL;
diff --git a/blockdev.c b/blockdev.c
index 4927914ce3..94726ed4ac 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1728,7 +1728,7 @@ static void external_snapshot_prepare(BlkActionState *common,
bdrv_img_create(new_image_file, format,
state->old_bs->filename,
state->old_bs->drv->format_name,
- NULL, size, flags, &local_err, false);
+ NULL, size, flags, false, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -3237,10 +3237,10 @@ static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn,
if (source) {
bdrv_img_create(backup->target, backup->format, source->filename,
source->drv->format_name, NULL,
- size, flags, &local_err, false);
+ size, flags, false, &local_err);
} else {
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 */
assert(format);
bdrv_img_create(arg->target, format,
- NULL, NULL, NULL, size, flags, &local_err, false);
+ NULL, NULL, NULL, size, flags, false, &local_err);
} else {
switch (arg->mode) {
case NEW_IMAGE_MODE_EXISTING:
@@ -3541,7 +3541,7 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
bdrv_img_create(arg->target, format,
source->filename,
source->drv->format_name,
- NULL, size, flags, &local_err, false);
+ NULL, size, flags, false, &local_err);
break;
default:
abort();
diff --git a/include/block/block.h b/include/block/block.h
index 5ddc0cf21b..466de49b48 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -509,7 +509,7 @@ int bdrv_load_vmstate(BlockDriverState *bs, uint8_t *buf,
void 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,
- Error **errp, bool quiet);
+ bool quiet, Error **errp);
/* Returns the alignment in bytes that is required so that no bounce buffer
* is required throughout the stack */
diff --git a/qemu-img.c b/qemu-img.c
index b220cf71d7..2c090532e9 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -516,7 +516,7 @@ static int img_create(int argc, char **argv)
}
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) {
error_reportf_err(local_err, "%s: ", filename);
goto fail;
diff --git a/tests/test-replication.c b/tests/test-replication.c
index fac2da3f58..3016c6f2e0 100644
--- a/tests/test-replication.c
+++ b/tests/test-replication.c
@@ -144,18 +144,18 @@ static void prepare_imgs(void)
/* Primary */
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);
/* Secondary */
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);
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);
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);
}