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>
diff --git a/block.c b/block.c
index 1fbbb8d..7eda9a4 100644
--- a/block.c
+++ b/block.c
@@ -4161,8 +4161,8 @@
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 4927914..94726ed 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1728,7 +1728,7 @@
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 @@
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 @@
/* 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 @@
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 5ddc0cf..466de49 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -509,7 +509,7 @@
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 b220cf7..2c09053 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -516,7 +516,7 @@
}
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 fac2da3..3016c6f 100644
--- a/tests/test-replication.c
+++ b/tests/test-replication.c
@@ -144,18 +144,18 @@
/* 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);
}