* [PATCH v2] xen: use XEN_SYSCTL_SCHEDOP_* for sysctl operation checks
@ 2016-02-23 10:09 Juergen Gross
2016-02-23 10:44 ` George Dunlap
0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2016-02-23 10:09 UTC (permalink / raw)
To: xen-devel; +Cc: george.dunlap, Juergen Gross, dgdegra, dario.faggioli
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(-)
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;
}
}
--
2.6.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] xen: use XEN_SYSCTL_SCHEDOP_* for sysctl operation checks
2016-02-23 10:09 [PATCH v2] xen: use XEN_SYSCTL_SCHEDOP_* for sysctl operation checks Juergen Gross
@ 2016-02-23 10:44 ` George Dunlap
0 siblings, 0 replies; 2+ messages in thread
From: George Dunlap @ 2016-02-23 10:44 UTC (permalink / raw)
To: Juergen Gross, xen-devel; +Cc: george.dunlap, dgdegra, dario.faggioli
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;
> }
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-23 10:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-23 10:09 [PATCH v2] xen: use XEN_SYSCTL_SCHEDOP_* for sysctl operation checks Juergen Gross
2016-02-23 10:44 ` George Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).