Skip to contentSkip to conversation

block jobs: Improve error message for missing job ID

PATCH Applied Kevin Wolf 4 participants 5 messages Aug 16, 2016 – Aug 17, 2016

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 block jobs: Improve error message for missing job ID

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.

---
 blockjob.c | 4 ++++
 1 file changed, 4 insertions(+)
blockjob.c +4 -0
index a5ba3be..a167f96 100644
@@ -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)) {
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Kevin Wolf

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.

---
 blockjob.c | 4 ++++
 1 file changed, 4 insertions(+)
blockjob.c +4 -0
index a5ba3be..a167f96 100644
@@ -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)) {
Signature · 1 line
1.8.3.1
author Applied
#4 lore raw
In reply to Kevin Wolf

Am 16.08.2016 um 16:02 hat Kevin Wolf geschrieben:

Quoted 6 lines

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.

Applied to block-next.

Kevin