[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 07/14] qemu-io: Don't print NULL when open without
From: |
Markus Armbruster |
Subject: |
[Qemu-stable] [PATCH 07/14] qemu-io: Don't print NULL when open without non-option arg fails |
Date: |
Mon, 26 May 2014 19:37:08 +0200 |
Reproducer: "open -o a=b". Broken in commit fd0fee3.
Signed-off-by: Markus Armbruster <address@hidden>
---
qemu-io.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index ffbad25..0daf413 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -61,7 +61,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;
@@ -72,7 +73,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);
--
1.9.3