qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com, armbru@redhat.com
Subject: [Qemu-devel] [PATCH 5/6] qmp: qmp_transaction(): pass Error object to bdrv_img_create()
Date: Fri, 19 Oct 2012 11:28:04 -0300	[thread overview]
Message-ID: <1350656885-6485-6-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1350656885-6485-1-git-send-email-lcapitulino@redhat.com>

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 blockdev.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 9dddefd..f2ec780 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -701,6 +701,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);
@@ -780,12 +781,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;
             }
         }
-- 
1.7.12.315.g682ce8b

  parent reply	other threads:[~2012-10-19 14:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 14:27 [Qemu-devel] [PATCH v2 0/6] block: bdrv_img_create(): propagate errors Luiz Capitulino
2012-10-19 14:28 ` [Qemu-devel] [PATCH 1/6] error: add error_set_errno and error_setg_errno Luiz Capitulino
2012-10-19 14:28 ` [Qemu-devel] [PATCH 2/6] block: bdrv_img_create(): add Error ** argument Luiz Capitulino
2012-10-19 14:28 ` [Qemu-devel] [PATCH 3/6] qemu-img: img_create(): pass Error object to bdrv_img_create() Luiz Capitulino
2012-10-19 14:28 ` [Qemu-devel] [PATCH 4/6] qemu-img: img_create(): drop unneeded goto and ret variable Luiz Capitulino
2012-10-19 14:28 ` Luiz Capitulino [this message]
2012-10-19 14:28 ` [Qemu-devel] [PATCH 6/6] block: bdrv_img_create(): drop unused error handling code Luiz Capitulino
2012-11-02 13:25 ` [Qemu-devel] [PATCH v2 0/6] block: bdrv_img_create(): propagate errors Luiz Capitulino
2012-11-02 13:40   ` Kevin Wolf
2012-11-02 13:42     ` Luiz Capitulino
2012-11-29 16:34       ` Luiz Capitulino
2012-11-30 11:39         ` Kevin Wolf
2012-11-30 11:44           ` Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350656885-6485-6-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).