diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2012-11-30 10:52:07 -0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-12-11 11:05:10 +0100 |
commit | 43e17041156ddecac8a7500648e71287ba270c0a (patch) | |
tree | b9756f8420168a1a9a273ff34f7780b069aa59a6 /blockdev.c | |
parent | a930091189cedcc0023dd38f705e2a46e530f4a4 (diff) | |
download | qemu-43e17041156ddecac8a7500648e71287ba270c0a.tar.gz qemu-43e17041156ddecac8a7500648e71287ba270c0a.tar.bz2 qemu-43e17041156ddecac8a7500648e71287ba270c0a.zip |
qmp: qmp_transaction(): 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.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/blockdev.c b/blockdev.c index 500f09116a..6fb336294c 100644 --- a/blockdev.c +++ b/blockdev.c @@ -707,6 +707,7 @@ void qmp_transaction(BlockdevActionList *dev_list, Error **errp) int ret = 0; BlockdevActionList *dev_entry = dev_list; BlkTransactionStates *states, *next; + Error *local_err = NULL; QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionStates) snap_bdrv_states; QSIMPLEQ_INIT(&snap_bdrv_states); @@ -786,12 +787,12 @@ void qmp_transaction(BlockdevActionList *dev_list, Error **errp) /* create new image w/backing file */ if (mode != NEW_IMAGE_MODE_EXISTING) { - ret = bdrv_img_create(new_image_file, format, - states->old_bs->filename, - states->old_bs->drv->format_name, - NULL, -1, flags, NULL); - if (ret) { - error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file); + bdrv_img_create(new_image_file, format, + states->old_bs->filename, + states->old_bs->drv->format_name, + NULL, -1, flags, &local_err); + if (error_is_set(&local_err)) { + error_propagate(errp, local_err); goto delete_and_fail; } } |