Skip to contentSkip to conversation

qemu-img: fix formatting of error message

PATCH Applied Daniel P. Berrange 3 participants 3 messages Apr 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-img: fix formatting of error message

The error_reportf_err() will not automatically append a ': ' before adding its suffix, so we must include that in the message we pass it, otherwise we get a badly formatted message lacking whitespace:

qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=6666,tls-creds=tls0'Failed to connect socket: Connection refused

---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-img.c +1 -1
index 06264d9..17c5cfd 100644
@@ -256,7 +256,7 @@ static BlockBackend *img_open_opts(const char *optstr,
     options = qemu_opts_to_qdict(opts, NULL);
     blk = blk_new_open(NULL, NULL, options, flags, &local_err);
     if (!blk) {
-        error_reportf_err(local_err, "Could not open '%s'", optstr);
+        error_reportf_err(local_err, "Could not open '%s': ", optstr);
         return NULL;
     }
     blk_set_enable_write_cache(blk, !writethrough);
Signature · 1 line
2.5.5
Applied
#1 lore raw

Am 06.04.2016 um 11:16 hat Daniel P. Berrange geschrieben:

Quoted 8 lines

The error_reportf_err() will not automatically append a ': ' before adding its suffix, so we must include that in the message we pass it, otherwise we get a badly formatted message lacking whitespace:

qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=6666,tls-creds=tls0'Failed to connect socket: Connection refused

Thanks, applied to the block branch.

Kevin

Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel P. Berrange
Quoted 11 lines · Daniel P. Berrange

The error_reportf_err() will not automatically append a ': ' before adding its suffix, so we must include that in the message we pass it, otherwise we get a badly formatted message lacking whitespace:

qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=6666,tls-creds=tls0'Failed to connect socket: Connection refused

---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
qemu-img.c +1 -1
index 06264d9..17c5cfd 100644
@@ -256,7 +256,7 @@ static BlockBackend *img_open_opts(const char *optstr,
     options = qemu_opts_to_qdict(opts, NULL);
     blk = blk_new_open(NULL, NULL, options, flags, &local_err);
     if (!blk) {
-        error_reportf_err(local_err, "Could not open '%s'", optstr);
+        error_reportf_err(local_err, "Could not open '%s': ", optstr);
         return NULL;
     }
     blk_set_enable_write_cache(blk, !writethrough);
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org