From patchwork Tue Feb 23 10:09:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 8390131 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 05765C0553 for ; Tue, 23 Feb 2016 10:12:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 316D9201DD for ; Tue, 23 Feb 2016 10:12:01 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48E99201B9 for ; Tue, 23 Feb 2016 10:12:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aY9ug-0003lK-4x; Tue, 23 Feb 2016 10:09:50 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aY9ue-0003kz-DP for xen-devel@lists.xen.org; Tue, 23 Feb 2016 10:09:48 +0000 Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id D5/83-02992-BEF2CC65; Tue, 23 Feb 2016 10:09:47 +0000 X-Env-Sender: jgross@suse.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1456222186!24052296!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4792 invoked from network); 23 Feb 2016 10:09:46 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-13.tower-206.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 23 Feb 2016 10:09:46 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AEDF5AB9B; Tue, 23 Feb 2016 10:09:44 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xen.org Date: Tue, 23 Feb 2016 11:09:41 +0100 Message-Id: <1456222181-12105-1-git-send-email-jgross@suse.com> X-Mailer: git-send-email 2.6.2 Cc: george.dunlap@eu.citrix.com, Juergen Gross , dgdegra@tycho.nsa.gov, dario.faggioli@citrix.com Subject: [Xen-devel] [PATCH v2] xen: use XEN_SYSCTL_SCHEDOP_* for sysctl operation checks X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: George Dunlap --- 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; } }