qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC 4/5] Introduce iothread-group


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH RFC 4/5] Introduce iothread-group
Date: Tue, 11 Jul 2017 14:48:29 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

On Mon, Jul 10, 2017 at 03:20:26PM +0800, Fam Zheng wrote:
> +static void iothread_group_complete(UserCreatable *obj, Error **errp)
> +{
> +    Error *local_err = NULL;
> +    IOThreadGroup *group = IOTHREAD_GROUP(obj);
> +    char *name, *thread_name;
> +    int i;
> +
> +    group->ctx = aio_context_new(&local_err);
> +    if (!group->ctx) {
> +        error_propagate(errp, local_err);
> +        return;
> +    }
> +
> +    aio_context_set_poll_params(group->ctx, group->poll_params,
> +                                &local_err);
> +    if (local_err) {
> +        error_propagate(errp, local_err);
> +        aio_context_unref(group->ctx);
> +        group->ctx = NULL;
> +        return;
> +    }
> +
> +    /* This assumes we are called from a thread with useful CPU affinity for 
> us
> +     * to inherit.
> +     */
> +    name = object_get_canonical_path_component(OBJECT(obj));
> +    group->iothreads = g_new0(IOThread *, group->size);
> +    for (i = 0; i < group->size; ++i) {

group->size > INT_MAX must be rejected.  The error message below is
wrong for this property:

  if (value < 0) {
    error_setg(&local_err, "%s value must be in range [0, %"PRId64"]",
               info->name, INT64_MAX);

Attachment: signature.asc
Description: PGP signature


reply via email to

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