diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-07-12 18:15:49 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-09-05 19:06:48 +0200 |
commit | 1562047c899ccecdf8af9645ce7fd35fcd2fdb31 (patch) | |
tree | d3d6cfffd698faa8031318ba8af6574e1e6bcd18 /blockjob.c | |
parent | 1b7f01d966f97b7820f3cdd471461cf0799a93cc (diff) |
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.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'blockjob.c')
-rw-r--r-- | blockjob.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/blockjob.c b/blockjob.c index a5ba3bee52..a167f96fd4 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)) { |