All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-block@nongnu.org, xiecl.fnst@cn.fujitsu.com,
	wency@cn.fujitsu.com, jcody@redhat.com, qemu-devel@nongnu.org,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/7] blockjobs: hide internal jobs from management API
Date: Fri, 14 Oct 2016 14:58:36 +0200	[thread overview]
Message-ID: <20161014125836.GC4473@noname.redhat.com> (raw)
In-Reply-To: <1476399422-8028-2-git-send-email-jsnow@redhat.com>

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 <jsnow@redhat.com>

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	other threads:[~2016-10-14 12:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13 22:56 [Qemu-devel] [PATCH 0/7] blockjobs: preliminary refactoring work, Pt 1 John Snow
2016-10-13 22:56 ` [Qemu-devel] [PATCH 1/7] blockjobs: hide internal jobs from management API John Snow
2016-10-14 12:58   ` Kevin Wolf [this message]
2016-10-14 17:32     ` John Snow
2016-10-13 22:56 ` [Qemu-devel] [PATCH 2/7] blockjobs: Allow creating internal jobs John Snow
2016-10-14 14:40   ` Kevin Wolf
2016-10-26  4:48   ` Jeff Cody
2016-10-13 22:56 ` [Qemu-devel] [PATCH 3/7] Replication/Blockjobs: Create replication jobs as internal John Snow
2016-10-14 14:40   ` Kevin Wolf
2016-10-26  4:48   ` Jeff Cody
2016-10-13 22:56 ` [Qemu-devel] [PATCH 4/7] blockjob: centralize QMP event emissions John Snow
2016-10-14 15:45   ` Kevin Wolf
2016-10-26  4:49   ` Jeff Cody
2016-10-13 22:57 ` [Qemu-devel] [PATCH 5/7] Blockjobs: Internalize user_pause logic John Snow
2016-10-14 15:46   ` Kevin Wolf
2016-10-26  4:50   ` Jeff Cody
2016-10-13 22:57 ` [Qemu-devel] [PATCH 6/7] blockjobs: split interface into public/private, Part 1 John Snow
2016-10-14 15:46   ` Kevin Wolf
2016-10-26  4:51   ` Jeff Cody
2016-10-13 22:57 ` [Qemu-devel] [PATCH 7/7] blockjobs: fix documentation John Snow
2016-10-14 15:46   ` Kevin Wolf
2016-10-26  4:51   ` Jeff Cody
2016-10-14  5:33 ` [Qemu-devel] [PATCH 0/7] blockjobs: preliminary refactoring work, Pt 1 no-reply
2016-10-14 18:32 ` John Snow
2016-10-26  4:52   ` Jeff Cody
2016-10-26 16:09     ` John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161014125836.GC4473@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wency@cn.fujitsu.com \
    --cc=xiecl.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.