qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/7] blockjobs: hide internal jobs from manageme


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 1/7] blockjobs: hide internal jobs from management API
Date: Fri, 14 Oct 2016 14:58:36 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 14.10.2016 um 00:56 hat John Snow geschrieben:
> If jobs are not created directly by the user, do not allow them to be
> seen by the user/management utility. At the moment, 'internal' jobs are
> those that do not have an ID. As of this patch it is impossible to
> create such jobs.
> 
> Signed-off-by: John Snow <address@hidden>

block_job_get() still has a strcmp(id, job->id) for all block jobs
without checking job->id != NULL first.

job->id is also used in the error message in block_job_complete(),
though you could argue that we have a bug if this is ever triggered for
internal jobs. Still, there are platform on which this would crash, so
maybe better catch it.

> -BlockJobInfo *block_job_query(BlockJob *job)
> +BlockJobInfo *block_job_query(BlockJob *job, Error **errp)
>  {
> -    BlockJobInfo *info = g_new0(BlockJobInfo, 1);
> +    BlockJobInfo *info;
> +
> +    if (block_job_is_internal(job)) {
> +        error_setg(errp, "Cannot query QEMU internal Jobs");

You definitely have Potential for being a good Student of German. I
agree that a Text is easier to read if you capitalise all Nouns in it,
but I'm afraid this is not Part of the current english Orthography.

> +        return NULL;
> +    }
> +    info = g_new0(BlockJobInfo, 1);
>      info->type      = g_strdup(BlockJobType_lookup[job->driver->job_type]);
>      info->device    = g_strdup(job->id);
>      info->len       = job->len;

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]