From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v3 12/52] xen/arch/x86/irq.c: let custom parameter parsing routines return errno
Date: Wed, 16 Aug 2017 14:51:39 +0200 [thread overview]
Message-ID: <20170816125219.5255-13-jgross@suse.com> (raw)
In-Reply-To: <20170816125219.5255-1-jgross@suse.com>
Modify the custom parameter parsing routines in:
xen/arch/x86/irq.c
to indicate whether the parameter value was parsed successfully.
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
xen/arch/x86/irq.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 57e6c18970..77ca181985 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -26,7 +26,7 @@
#include <asm/mach-generic/mach_apic.h>
#include <public/physdev.h>
-static void parse_irq_vector_map_param(char *s);
+static int parse_irq_vector_map_param(const char *s);
/* opt_noirqbalance: If true, software IRQ balancing/affinity is disabled. */
bool __read_mostly opt_noirqbalance;
@@ -60,24 +60,29 @@ static struct timer irq_ratelimit_timer;
static unsigned int __read_mostly irq_ratelimit_threshold = 10000;
integer_param("irq_ratelimit", irq_ratelimit_threshold);
-static void __init parse_irq_vector_map_param(char *s)
+static int __init parse_irq_vector_map_param(const char *s)
{
- char *ss;
+ const char *ss;
+ int rc = 0;
do {
ss = strchr(s, ',');
- if ( ss )
- *ss = '\0';
+ if ( !ss )
+ ss = strchr(s, '\0');
- if ( !strcmp(s, "none"))
+ if ( !strncmp(s, "none", ss - s))
opt_irq_vector_map=OPT_IRQ_VECTOR_MAP_NONE;
- else if ( !strcmp(s, "global"))
+ else if ( !strncmp(s, "global", ss - s))
opt_irq_vector_map=OPT_IRQ_VECTOR_MAP_GLOBAL;
- else if ( !strcmp(s, "per-device"))
+ else if ( !strncmp(s, "per-device", ss - s))
opt_irq_vector_map=OPT_IRQ_VECTOR_MAP_PERDEV;
+ else
+ rc = -EINVAL;
s = ss + 1;
- } while ( ss );
+ } while ( *ss );
+
+ return rc;
}
/* Must be called when irq disabled */
--
2.12.3
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-08-16 12:52 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 12:51 [PATCH v3 00/52] Support for modifying parameters at runtime Juergen Gross
2017-08-16 12:51 ` [PATCH v3 01/52] xen/arch/arm/acpi/boot.c: let custom parameter parsing routines return errno Juergen Gross
2017-08-16 12:51 ` [PATCH v3 02/52] xen/arch/arm/domain_build.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 03/52] xen/arch/arm/traps.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 04/52] xen/arch/x86/apic.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 05/52] xen/arch/x86/cpu/mcheck/mce.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 06/52] xen/arch/x86/cpu/vpmu.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 07/52] xen/arch/x86/dom0_build.c: " Juergen Gross
2017-08-16 13:58 ` Jan Beulich
2017-08-16 12:51 ` [PATCH v3 08/52] xen/arch/x86/genapic/probe.c: " Juergen Gross
2017-08-16 13:59 ` Jan Beulich
2017-08-16 12:51 ` [PATCH v3 09/52] xen/arch/x86/hvm/viridian.c: " Juergen Gross
2017-08-21 8:33 ` Paul Durrant
2017-08-21 11:02 ` Juergen Gross
2017-08-21 11:45 ` Paul Durrant
2017-08-16 12:51 ` [PATCH v3 10/52] xen/arch/x86/hvm/vmx/vmcs.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 11/52] xen/arch/x86/io_apic.c: " Juergen Gross
2017-08-16 12:51 ` Juergen Gross [this message]
2017-08-16 12:51 ` [PATCH v3 13/52] xen/arch/x86/microcode.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 14/52] xen/arch/x86/mm.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 15/52] xen/arch/x86/nmi.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 16/52] xen/arch/x86/numa.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 17/52] xen/arch/x86/oprofile/nmi_int.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 18/52] xen/arch/x86/psr.c: " Juergen Gross
2017-08-22 9:51 ` Jan Beulich
2017-08-23 11:30 ` Juergen Gross
2017-08-16 12:51 ` [PATCH v3 19/52] xen/arch/x86/setup.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 20/52] xen/arch/x86/shutdown.c: " Juergen Gross
2017-08-22 9:53 ` Jan Beulich
[not found] ` <599C1B340200007800171DD1@suse.com>
2017-08-23 8:40 ` Juergen Gross
2017-08-23 8:48 ` Jan Beulich
2017-08-16 12:51 ` [PATCH v3 21/52] xen/arch/x86/time.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 22/52] xen/arch/x86/x86_64/mmconfig-shared.c: " Juergen Gross
2017-08-22 9:55 ` Jan Beulich
2017-08-23 11:49 ` Juergen Gross
2017-08-16 12:51 ` [PATCH v3 23/52] xen/common/core_parking.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 24/52] xen/common/domain.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 25/52] xen/common/efi/boot.c: " Juergen Gross
2017-08-22 9:56 ` Jan Beulich
2017-08-16 12:51 ` [PATCH v3 26/52] xen/common/kexec.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 27/52] xen/common/memory.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 28/52] xen/common/sched_credit2.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 29/52] xen/drivers/acpi/tables.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 30/52] xen/drivers/char/console.c: " Juergen Gross
2017-08-16 12:51 ` [PATCH v3 31/52] xen/drivers/cpufreq/cpufreq.c: " Juergen Gross
2017-08-22 10:01 ` Jan Beulich
2017-08-16 12:51 ` [PATCH v3 32/52] xen/drivers/passthrough/amd/iommu_acpi.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 33/52] xen/drivers/passthrough/iommu.c: " Juergen Gross
2017-08-22 10:04 ` Jan Beulich
[not found] ` <599C1DC70200007800171E22@suse.com>
2017-08-23 9:27 ` Juergen Gross
2017-08-23 9:37 ` Jan Beulich
[not found] ` <599D68F302000078001726B9@suse.com>
2017-08-23 9:49 ` Juergen Gross
2017-08-16 12:52 ` [PATCH v3 34/52] xen/drivers/passthrough/pci.c: " Juergen Gross
2017-08-22 10:07 ` Jan Beulich
[not found] ` <599C1E770200007800171E25@suse.com>
2017-08-23 9:28 ` Juergen Gross
2017-08-16 12:52 ` [PATCH v3 35/52] xen/drivers/passthrough/vtd/dmar.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 36/52] xen/drivers/passthrough/vtd/quirks.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 37/52] xen/drivers/video/vesa.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 38/52] xen/xsm/flask/flask_op.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 39/52] xen: check parameter validity when parsing command line Juergen Gross
2017-08-22 11:24 ` Jan Beulich
[not found] ` <599C307A0200007800171EFF@suse.com>
2017-08-23 9:30 ` Juergen Gross
2017-08-23 9:38 ` Jan Beulich
2017-08-23 12:42 ` Juergen Gross
2017-08-23 13:18 ` Jan Beulich
[not found] ` <599D9CC10200007800172970@suse.com>
2017-08-23 14:21 ` Juergen Gross
2017-08-23 14:38 ` Jan Beulich
2017-08-16 12:52 ` [PATCH v3 40/52] xen/arch/x86/apic.c: remove custom_param() error messages Juergen Gross
2017-08-16 12:52 ` [PATCH v3 41/52] xen/arch/x86/cpu/mcheck/mce.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 42/52] xen/arch/x86/hvm/viridian.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 43/52] xen/arch/x86/io_apic.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 44/52] xen/common/kexec.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 45/52] xen/common/sched_credit2.c: " Juergen Gross
2017-08-16 12:52 ` [PATCH v3 46/52] xen: carve out a generic parsing function from _cmdline_parse() Juergen Gross
2017-08-16 12:52 ` [PATCH v3 47/52] xen: add basic support for runtime parameter changing Juergen Gross
2017-08-22 11:27 ` Jan Beulich
2017-08-16 12:52 ` [PATCH v3 48/52] xen: add hypercall for setting parameters at runtime Juergen Gross
2017-08-22 11:31 ` Jan Beulich
[not found] ` <599C32330200007800171F47@suse.com>
2017-08-23 9:52 ` Juergen Gross
2017-08-23 10:02 ` Jan Beulich
2017-08-16 12:52 ` [PATCH v3 49/52] libxc: add function to set hypervisor parameters Juergen Gross
2017-08-22 14:15 ` Wei Liu
2017-08-16 12:52 ` [PATCH v3 50/52] libxl: add libxl_set_parameters() function Juergen Gross
2017-08-22 14:15 ` Wei Liu
2017-08-16 12:52 ` [PATCH v3 51/52] xl: add new xl command set-parameters Juergen Gross
2017-08-16 12:52 ` [PATCH v3 52/52] xen: make some console related parameters settable at runtime Juergen Gross
2017-08-22 11:33 ` Jan Beulich
2017-08-22 14:16 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170816125219.5255-13-jgross@suse.com \
--to=jgross@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).