From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZf4T-0007Nj-3o for qemu-devel@nongnu.org; Tue, 16 Aug 2016 10:10:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZf4O-0002SM-8q for qemu-devel@nongnu.org; Tue, 16 Aug 2016 10:10:24 -0400 Date: Tue, 16 Aug 2016 10:10:11 -0400 From: Jeff Cody Message-ID: <20160816141011.GE2950@localhost.localdomain> References: <1471356130-9551-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471356130-9551-1-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block jobs: Improve error message for missing job ID List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org On Tue, Aug 16, 2016 at 04:02:10PM +0200, Kevin Wolf wrote: > 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 > --- > 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 > > Reviewed-by: Jeff Cody