qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block jobs: Improve error message for missing job ID
@ 2016-08-16 14:02 Kevin Wolf
  2016-08-16 14:10 ` [Qemu-devel] [Qemu-block] " Jeff Cody
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kevin Wolf @ 2016-08-16 14:02 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

If a block job is started with a node name rather than a device name and
no explicit job ID is passed, it was reported that '' isn't a
well-formed ID. Which is correct, but we can make the message a little
bit nicer.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 blockjob.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/blockjob.c b/blockjob.c
index a5ba3be..a167f96 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -132,6 +132,10 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
 
     if (job_id == NULL) {
         job_id = bdrv_get_device_name(bs);
+        if (!*job_id) {
+            error_setg(errp, "An explicit job ID is required for this node");
+            return NULL;
+        }
     }
 
     if (!id_wellformed(job_id)) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-17  9:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-16 14:02 [Qemu-devel] [PATCH] block jobs: Improve error message for missing job ID Kevin Wolf
2016-08-16 14:10 ` [Qemu-devel] [Qemu-block] " Jeff Cody
2016-08-16 14:11 ` Alberto Garcia
2016-08-17  8:28 ` Stefan Hajnoczi
2016-08-17  9:08 ` [Qemu-devel] " Kevin Wolf

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).