diff mbox

[v2] xen: use XEN_SYSCTL_SCHEDOP_* for sysctl operation checks

Message ID 1456222181-12105-1-git-send-email-jgross@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jürgen Groß Feb. 23, 2016, 10:09 a.m. UTC
In flask_sysctl_scheduler_op() and sched_adjust_global() the test for
the desired operation is done with the wrong constants. While the
values are correct, the names are not.

Correct the error message for the case of an unknown operation in
flask_sysctl_scheduler_op(), too.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2: correct sched_adjust_global(), too as requested by Jan Beulich
---
 xen/common/schedule.c | 4 ++--
 xen/xsm/flask/hooks.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

George Dunlap Feb. 23, 2016, 10:44 a.m. UTC | #1
On 23/02/16 10:09, Juergen Gross wrote:
> In flask_sysctl_scheduler_op() and sched_adjust_global() the test for
> the desired operation is done with the wrong constants. While the
> values are correct, the names are not.
> 
> Correct the error message for the case of an unknown operation in
> flask_sysctl_scheduler_op(), too.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Good catch.

Reviewed-by: George Dunlap <george.dunlap@citrix.com>

> ---
> V2: correct sched_adjust_global(), too as requested by Jan Beulich
> ---
>  xen/common/schedule.c | 4 ++--
>  xen/xsm/flask/hooks.c | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index 27695e3..434dcfc 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -1171,8 +1171,8 @@ long sched_adjust_global(struct xen_sysctl_scheduler_op *op)
>      if ( rc )
>          return rc;
>  
> -    if ( (op->cmd != XEN_DOMCTL_SCHEDOP_putinfo) &&
> -         (op->cmd != XEN_DOMCTL_SCHEDOP_getinfo) )
> +    if ( (op->cmd != XEN_SYSCTL_SCHEDOP_putinfo) &&
> +         (op->cmd != XEN_SYSCTL_SCHEDOP_getinfo) )
>          return -EINVAL;
>  
>      pool = cpupool_get_by_id(op->cpupool_id);
> diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
> index f63c3e2..4813623 100644
> --- a/xen/xsm/flask/hooks.c
> +++ b/xen/xsm/flask/hooks.c
> @@ -529,14 +529,14 @@ static int flask_sysctl_scheduler_op(int op)
>  {
>      switch ( op )
>      {
> -    case XEN_DOMCTL_SCHEDOP_putinfo:
> +    case XEN_SYSCTL_SCHEDOP_putinfo:
>          return domain_has_xen(current->domain, XEN__SETSCHEDULER);
>  
> -    case XEN_DOMCTL_SCHEDOP_getinfo:
> +    case XEN_SYSCTL_SCHEDOP_getinfo:
>          return domain_has_xen(current->domain, XEN__GETSCHEDULER);
>  
>      default:
> -        printk("flask_domctl_scheduler_op: Unknown op %d\n", op);
> +        printk("flask_sysctl_scheduler_op: Unknown op %d\n", op);
>          return -EPERM;
>      }
>  }
>
diff mbox

Patch

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 27695e3..434dcfc 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1171,8 +1171,8 @@  long sched_adjust_global(struct xen_sysctl_scheduler_op *op)
     if ( rc )
         return rc;
 
-    if ( (op->cmd != XEN_DOMCTL_SCHEDOP_putinfo) &&
-         (op->cmd != XEN_DOMCTL_SCHEDOP_getinfo) )
+    if ( (op->cmd != XEN_SYSCTL_SCHEDOP_putinfo) &&
+         (op->cmd != XEN_SYSCTL_SCHEDOP_getinfo) )
         return -EINVAL;
 
     pool = cpupool_get_by_id(op->cpupool_id);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f63c3e2..4813623 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -529,14 +529,14 @@  static int flask_sysctl_scheduler_op(int op)
 {
     switch ( op )
     {
-    case XEN_DOMCTL_SCHEDOP_putinfo:
+    case XEN_SYSCTL_SCHEDOP_putinfo:
         return domain_has_xen(current->domain, XEN__SETSCHEDULER);
 
-    case XEN_DOMCTL_SCHEDOP_getinfo:
+    case XEN_SYSCTL_SCHEDOP_getinfo:
         return domain_has_xen(current->domain, XEN__GETSCHEDULER);
 
     default:
-        printk("flask_domctl_scheduler_op: Unknown op %d\n", op);
+        printk("flask_sysctl_scheduler_op: Unknown op %d\n", op);
         return -EPERM;
     }
 }