Re: [PATCH v2 1/3] util: Add virProcessSetScheduler() function for scheduler settings

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

 



On Tue, Feb 10, 2015 at 16:35:19 +0100, Martin Kletzander wrote:
> This function uses sched_setscheduler() function so it works with
> processes and threads as well (even threads not created by us, which is
> what we'll need in the future).
> 
> Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
> ---
>  configure.ac             |   4 +-
>  src/libvirt_private.syms |   1 +
>  src/util/virprocess.c    | 104 ++++++++++++++++++++++++++++++++++++++++++++++-
>  src/util/virprocess.h    |  20 ++++++++-
>  4 files changed, 124 insertions(+), 5 deletions(-)
> 

...

> +#if HAVE_SCHED_SETSCHEDULER
> +
> +static int
> +virProcessSchedTranslatePolicy(virProcessSchedPolicy policy)
> +{
> +    switch (policy) {
> +    case VIR_PROC_POLICY_NONE:
> +        return SCHED_OTHER;
> +
> +    case VIR_PROC_POLICY_BATCH:
> +        return SCHED_BATCH;
> +
> +    case VIR_PROC_POLICY_IDLE:
> +        return SCHED_IDLE;
> +
> +    case VIR_PROC_POLICY_FIFO:
> +        return SCHED_FIFO;
> +
> +    case VIR_PROC_POLICY_RR:
> +        return SCHED_RR;
> +
> +    case VIR_PROC_POLICY_LAST:
> +        /* nada */

I know I'm late with this comment, but:

I don't think the _LAST case is so obscure that we would need to comment
it with such an insightful comment.

> +        break;
> +    }
> +
> +    return -1;
> +}
> +

Peter

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]