summaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-05-28 11:17:00 +0200
committerKevin Wolf <kwolf@redhat.com>2014-05-30 14:26:54 +0200
commit543f7bef1353be4b30543aa1888048a7b6abb2e9 (patch)
treec2aaa4da1dd4618ddc4b0f4cc7af03f164397f09 /qemu-io.c
parent29f2601aa605f0af0cba8eedcff7812c6c8532e9 (diff)
downloadqemu-543f7bef1353be4b30543aa1888048a7b6abb2e9.tar.gz
qemu-543f7bef1353be4b30543aa1888048a7b6abb2e9.tar.bz2
qemu-543f7bef1353be4b30543aa1888048a7b6abb2e9.zip
qemu-io: Don't print NULL when open without non-option arg fails
Reproducer: "open -o a=b". Broken in commit fd0fee3. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/qemu-io.c b/qemu-io.c
index f63e771d98..795cf46c6e 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -62,7 +62,8 @@ static int openfile(char *name, int flags, int growable, QDict *opts)
if (bdrv_open(&qemuio_bs, name, NULL, opts, flags | BDRV_O_PROTOCOL,
NULL, &local_err))
{
- fprintf(stderr, "%s: can't open device %s: %s\n", progname, name,
+ fprintf(stderr, "%s: can't open%s%s: %s\n", progname,
+ name ? " device " : "", name ?: "",
error_get_pretty(local_err));
error_free(local_err);
return 1;
@@ -73,7 +74,8 @@ static int openfile(char *name, int flags, int growable, QDict *opts)
if (bdrv_open(&qemuio_bs, name, NULL, opts, flags, NULL, &local_err)
< 0)
{
- fprintf(stderr, "%s: can't open device %s: %s\n", progname, name,
+ fprintf(stderr, "%s: can't open%s%s: %s\n", progname,
+ name ? " device " : "", name ?: "",
error_get_pretty(local_err));
error_free(local_err);
bdrv_unref(qemuio_bs);