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 2/6] qemu-img: img_create(): pass Error object to bdrv_img_create()
Date: Fri, 30 Nov 2012 10:52:05 -0200 [thread overview]
Message-ID: <1354279929-568-3-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1354279929-568-1-git-send-email-lcapitulino@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
qemu-img.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 3896689..595b6f5 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -301,6 +301,7 @@ static int img_create(int argc, char **argv)
const char *filename;
const char *base_filename = NULL;
char *options = NULL;
+ Error *local_err = NULL;
for(;;) {
c = getopt(argc, argv, "F:b:f:he6o:");
@@ -361,8 +362,14 @@ static int img_create(int argc, char **argv)
goto out;
}
- ret = bdrv_img_create(filename, fmt, base_filename, base_fmt,
- options, img_size, BDRV_O_FLAGS, NULL);
+ bdrv_img_create(filename, fmt, base_filename, base_fmt,
+ options, img_size, BDRV_O_FLAGS, &local_err);
+ if (error_is_set(&local_err)) {
+ error_report("%s", error_get_pretty(local_err));
+ error_free(local_err);
+ ret = -1;
+ }
+
out:
if (ret) {
return 1;
--
1.8.0
next prev parent reply other threads:[~2012-11-30 12:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 12:52 [Qemu-devel] [PATCH v3 0/6] block: bdrv_img_create(): propagate errors Luiz Capitulino
2012-11-30 12:52 ` [Qemu-devel] [PATCH 1/6] block: bdrv_img_create(): add Error ** argument Luiz Capitulino
2012-11-30 12:52 ` Luiz Capitulino [this message]
2012-11-30 12:52 ` [Qemu-devel] [PATCH 3/6] qemu-img: img_create(): drop unneeded goto and ret variable Luiz Capitulino
2012-11-30 12:52 ` [Qemu-devel] [PATCH 4/6] qmp: qmp_transaction(): pass Error object to bdrv_img_create() Luiz Capitulino
2012-11-30 12:52 ` [Qemu-devel] [PATCH 5/6] qmp: qmp_drive_mirror(): " Luiz Capitulino
2012-11-30 12:52 ` [Qemu-devel] [PATCH 6/6] block: bdrv_img_create(): drop unused error handling code Luiz Capitulino
2012-11-30 13:19 ` [Qemu-devel] [PATCH v3 0/6] block: bdrv_img_create(): propagate errors Kevin Wolf
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=1354279929-568-3-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).