aboutsummaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-12-18 16:35:18 +0100
committerMarkus Armbruster <armbru@redhat.com>2016-01-13 15:16:18 +0100
commitb9884681491fbe8b3fa32d58f35bcc5f725c5258 (patch)
tree03d35de6c707603c611dc095383f7810cba1dd43 /qemu-io.c
parentd410fe145446968055f3807b0d41ae8150eb0926 (diff)
downloadqemu-b9884681491fbe8b3fa32d58f35bcc5f725c5258.zip
qemu-b9884681491fbe8b3fa32d58f35bcc5f725c5258.tar.gz
qemu-b9884681491fbe8b3fa32d58f35bcc5f725c5258.tar.bz2
qemu-io qemu-nbd: Use error_report() etc. instead of fprintf()
Just three instances left. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-16-git-send-email-armbru@redhat.com>
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/qemu-io.c b/qemu-io.c
index 269f17c..d47228a 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -57,17 +57,15 @@ static int openfile(char *name, int flags, QDict *opts)
BlockDriverState *bs;
if (qemuio_blk) {
- fprintf(stderr, "file open already, try 'help close'\n");
+ error_report("file open already, try 'help close'");
QDECREF(opts);
return 1;
}
qemuio_blk = blk_new_open("hda", name, NULL, opts, flags, &local_err);
if (!qemuio_blk) {
- fprintf(stderr, "%s: can't open%s%s: %s\n", progname,
- name ? " device " : "", name ?: "",
- error_get_pretty(local_err));
- error_free(local_err);
+ error_reportf_err(local_err, "can't open%s%s: ",
+ name ? " device " : "", name ?: "");
return 1;
}