aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-11-30 10:52:08 -0200
committerKevin Wolf <kwolf@redhat.com>2012-12-11 11:05:10 +0100
commitcf8f2426c55245f437a91f2fdabbed4ea24e7786 (patch)
treeb52bd04cb4f4e19e912904f319bdea085e234391 /blockdev.c
parent43e17041156ddecac8a7500648e71287ba270c0a (diff)
downloadqemu-cf8f2426c55245f437a91f2fdabbed4ea24e7786.zip
qemu-cf8f2426c55245f437a91f2fdabbed4ea24e7786.tar.gz
qemu-cf8f2426c55245f437a91f2fdabbed4ea24e7786.tar.bz2
qmp: qmp_drive_mirror(): pass Error object to bdrv_img_create()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/blockdev.c b/blockdev.c
index 6fb3362..463f4c2 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1264,8 +1264,8 @@ void qmp_drive_mirror(const char *device, const char *target,
assert(format && drv);
bdrv_get_geometry(bs, &size);
size *= 512;
- ret = bdrv_img_create(target, format,
- NULL, NULL, NULL, size, flags, NULL);
+ bdrv_img_create(target, format,
+ NULL, NULL, NULL, size, flags, &local_err);
} else {
switch (mode) {
case NEW_IMAGE_MODE_EXISTING:
@@ -1273,18 +1273,18 @@ void qmp_drive_mirror(const char *device, const char *target,
break;
case NEW_IMAGE_MODE_ABSOLUTE_PATHS:
/* create new image with backing file */
- ret = bdrv_img_create(target, format,
- source->filename,
- source->drv->format_name,
- NULL, -1, flags, NULL);
+ bdrv_img_create(target, format,
+ source->filename,
+ source->drv->format_name,
+ NULL, -1, flags, &local_err);
break;
default:
abort();
}
}
- if (ret) {
- error_set(errp, QERR_OPEN_FILE_FAILED, target);
+ if (error_is_set(&local_err)) {
+ error_propagate(errp, local_err);
return;
}