x86/Dom0: Don't allow dom0_max_vcpus to be zero
PATCH 1/1 x86/Dom0: Don't allow dom0_max_vcpus to be zero
In case dom0_max_vcpus is incorrectly specified on boot line make sure we will still boot.
--- xen/arch/x86/domain_build.c | 2 ++ 1 file changed, 2 insertions(+)
xen/arch/x86/domain_build.c +2 -0
@@ -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 */
Signature · 1 line
1.8.1.4
Quoted 4 lines · Boris Ostrovsky
In case
dom0_max_vcpusis incorrectly specified on boot line make sure we will still boot.Signed-off-by Boris Ostrovsky <[email protected]>
Good catch - lets not do that.
Quoted 17 lines
--- xen/arch/x86/domain_build.c | 2 ++ 1 file changed, 2 insertions(+)xen/arch/x86/domain_build.c +2
-0@@ -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 */
Konrad Rzeszutek Wilk
Reviewed-byQuoted 9 lines · Andrew Cooper
Quoted 4 lines · Boris Ostrovsky
In case
dom0_max_vcpusis incorrectly specified on boot line make sure we will still boot.Signed-off-by Boris Ostrovsky <[email protected]>Good catch - lets not do that.
Reviewed-by Andrew Cooper <[email protected]>
Aye,
Quoted 19 lines
Quoted 18 lines
--- xen/arch/x86/domain_build.c | 2 ++ 1 file changed, 2 insertions(+)xen/arch/x86/domain_build.c +2
-0@@ -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 */
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 09.04.15 at 22:59, <[email protected]> wrote:
Quoted 4 lines · Boris Ostrovsky
In case
dom0_max_vcpusis incorrectly specified on boot line make sure we will still boot.Signed-off-by Boris Ostrovsky <[email protected]>Good catch - lets not do that.
Reviewed-by Andrew Cooper <[email protected]>
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
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 09.04.15 at 22:59, <[email protected]> wrote:
Quoted 4 lines · Boris Ostrovsky
In case
dom0_max_vcpusis incorrectly specified on boot line make sure we will still boot.Signed-off-by Boris Ostrovsky <[email protected]>
Quoted 8 lines
Quoted 3 lines
Good catch - lets not do that.
Reviewed-by Andrew Cooper <[email protected]>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