All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/Dom0: Don't allow dom0_max_vcpus to be zero
@ 2015-04-09 20:38 Boris Ostrovsky
  2015-04-09 20:59 ` Andrew Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Boris Ostrovsky @ 2015-04-09 20:38 UTC (permalink / raw)
  To: jbeulich, andrew.cooper3, keir; +Cc: boris.ostrovsky, xen-devel

In case dom0_max_vcpus is incorrectly specified on boot line make sure
we will still boot.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/domain_build.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index e5c845c..378e650 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -92,6 +92,8 @@ static void __init parse_dom0_max_vcpus(const char *s)
     else                               /* N, N-, or N-M */
     {
         opt_dom0_max_vcpus_min = simple_strtoul(s, &s, 0);
+        if ( opt_dom0_max_vcpus_min == 0 )
+            opt_dom0_max_vcpus_min = 1;
         if ( !*s )                    /* N */
             opt_dom0_max_vcpus_max = opt_dom0_max_vcpus_min;
         else if ( *s++ == '-' && *s ) /* N-M */
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/Dom0: Don't allow dom0_max_vcpus to be zero
  2015-04-09 20:38 [PATCH] x86/Dom0: Don't allow dom0_max_vcpus to be zero Boris Ostrovsky
@ 2015-04-09 20:59 ` Andrew Cooper
  2015-04-10 14:47   ` Konrad Rzeszutek Wilk
  2015-04-14  7:21   ` Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Cooper @ 2015-04-09 20:59 UTC (permalink / raw)
  To: Boris Ostrovsky, jbeulich, keir; +Cc: xen-devel

On 09/04/2015 21:38, Boris Ostrovsky wrote:
> In case dom0_max_vcpus is incorrectly specified on boot line make sure
> we will still boot.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Good catch - lets not do that.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

> ---
>  xen/arch/x86/domain_build.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
> index e5c845c..378e650 100644
> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -92,6 +92,8 @@ static void __init parse_dom0_max_vcpus(const char *s)
>      else                               /* N, N-, or N-M */
>      {
>          opt_dom0_max_vcpus_min = simple_strtoul(s, &s, 0);
> +        if ( opt_dom0_max_vcpus_min == 0 )
> +            opt_dom0_max_vcpus_min = 1;
>          if ( !*s )                    /* N */
>              opt_dom0_max_vcpus_max = opt_dom0_max_vcpus_min;
>          else if ( *s++ == '-' && *s ) /* N-M */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/Dom0: Don't allow dom0_max_vcpus to be zero
  2015-04-09 20:59 ` Andrew Cooper
@ 2015-04-10 14:47   ` Konrad Rzeszutek Wilk
  2015-04-14  7:21   ` Jan Beulich
  1 sibling, 0 replies; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-04-10 14:47 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Boris Ostrovsky, keir, jbeulich, xen-devel

On Thu, Apr 09, 2015 at 09:59:04PM +0100, Andrew Cooper wrote:
> On 09/04/2015 21:38, Boris Ostrovsky wrote:
> > In case dom0_max_vcpus is incorrectly specified on boot line make sure
> > we will still boot.
> >
> > Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> 
> Good catch - lets not do that.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Aye,

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> 
> > ---
> >  xen/arch/x86/domain_build.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
> > index e5c845c..378e650 100644
> > --- a/xen/arch/x86/domain_build.c
> > +++ b/xen/arch/x86/domain_build.c
> > @@ -92,6 +92,8 @@ static void __init parse_dom0_max_vcpus(const char *s)
> >      else                               /* N, N-, or N-M */
> >      {
> >          opt_dom0_max_vcpus_min = simple_strtoul(s, &s, 0);
> > +        if ( opt_dom0_max_vcpus_min == 0 )
> > +            opt_dom0_max_vcpus_min = 1;
> >          if ( !*s )                    /* N */
> >              opt_dom0_max_vcpus_max = opt_dom0_max_vcpus_min;
> >          else if ( *s++ == '-' && *s ) /* N-M */
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/Dom0: Don't allow dom0_max_vcpus to be zero
  2015-04-09 20:59 ` Andrew Cooper
  2015-04-10 14:47   ` Konrad Rzeszutek Wilk
@ 2015-04-14  7:21   ` Jan Beulich
  2015-04-14 13:52     ` Boris Ostrovsky
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2015-04-14  7:21 UTC (permalink / raw)
  To: Andrew Cooper, Boris Ostrovsky; +Cc: keir, xen-devel

>>> On 09.04.15 at 22:59, <andrew.cooper3@citrix.com> wrote:
> On 09/04/2015 21:38, Boris Ostrovsky wrote:
>> In case dom0_max_vcpus is incorrectly specified on boot line make sure
>> we will still boot.
>>
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> 
> Good catch - lets not do that.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

I see it got committed already, and I don't really mind the change,
but - are we really in need of this? I.e. are we really rejecting bad
or insane command line option values everywhere else? I very
much doubt that, and it very much looks like a "then don't do this"
thing to me...

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/Dom0: Don't allow dom0_max_vcpus to be zero
  2015-04-14  7:21   ` Jan Beulich
@ 2015-04-14 13:52     ` Boris Ostrovsky
  0 siblings, 0 replies; 5+ messages in thread
From: Boris Ostrovsky @ 2015-04-14 13:52 UTC (permalink / raw)
  To: Jan Beulich, Andrew Cooper; +Cc: keir, xen-devel

On 04/14/2015 03:21 AM, Jan Beulich wrote:
>>>> On 09.04.15 at 22:59, <andrew.cooper3@citrix.com> wrote:
>> On 09/04/2015 21:38, Boris Ostrovsky wrote:
>>> In case dom0_max_vcpus is incorrectly specified on boot line make sure
>>> we will still boot.
>>>
>>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Good catch - lets not do that.
>>
>> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> I see it got committed already, and I don't really mind the change,
> but - are we really in need of this? I.e. are we really rejecting bad
> or insane command line option values everywhere else? I very
> much doubt that, and it very much looks like a "then don't do this"
> thing to me...

This actually happened to me (something happened with our installer). I 
agree that we can't predict how every option can go bad but we do try to 
prevent obvious errors so I figured this was worth a patch, especially 
given that it was pretty trivial.

-boris

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-14 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-09 20:38 [PATCH] x86/Dom0: Don't allow dom0_max_vcpus to be zero Boris Ostrovsky
2015-04-09 20:59 ` Andrew Cooper
2015-04-10 14:47   ` Konrad Rzeszutek Wilk
2015-04-14  7:21   ` Jan Beulich
2015-04-14 13:52     ` Boris Ostrovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.