diff mbox series

[v3,4/9] HMP: disable monitor in preconfig state

Message ID 1518784641-43151-5-git-send-email-imammedo@redhat.com
State New
Headers show
Series enable numa configuration before machine_init() from QMP | expand

Commit Message

Igor Mammedov Feb. 16, 2018, 12:37 p.m. UTC
Ban it for now, if someone would need it to work early,
one would have to implement checks if HMP command is valid
at preconfig state.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
---
 monitor.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Dr. David Alan Gilbert March 7, 2018, 2:01 p.m. UTC | #1
* Igor Mammedov (imammedo@redhat.com) wrote:
> Ban it for now, if someone would need it to work early,
> one would have to implement checks if HMP command is valid
> at preconfig state.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> ---
>  monitor.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/monitor.c b/monitor.c
> index f499250..fcb5386 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -3097,6 +3097,10 @@ static void handle_hmp_command(Monitor *mon, const char *cmdline)
>  
>      trace_handle_hmp_command(mon, cmdline);
>  
> +    if (runstate_check(RUN_STATE_PRECONFIG)) {
> +        monitor_printf(mon, "HMP not available in precofig state\n");
> +    }

But you've not returned, so the command will still get parsed?

Dave

>      cmd = monitor_parse_command(mon, cmdline, &cmdline, mon->cmd_table);
>      if (!cmd) {
>          return;
> -- 
> 2.7.4
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Igor Mammedov March 8, 2018, 3:47 p.m. UTC | #2
On Wed, 7 Mar 2018 14:01:27 +0000
"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:

> * Igor Mammedov (imammedo@redhat.com) wrote:
> > Ban it for now, if someone would need it to work early,
> > one would have to implement checks if HMP command is valid
> > at preconfig state.
> > 
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> > ---
> >  monitor.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/monitor.c b/monitor.c
> > index f499250..fcb5386 100644
> > --- a/monitor.c
> > +++ b/monitor.c
> > @@ -3097,6 +3097,10 @@ static void handle_hmp_command(Monitor *mon, const char *cmdline)
> >  
> >      trace_handle_hmp_command(mon, cmdline);
> >  
> > +    if (runstate_check(RUN_STATE_PRECONFIG)) {
> > +        monitor_printf(mon, "HMP not available in precofig state\n");
> > +    }  
> 
> But you've not returned, so the command will still get parsed?
yep, it's bug. I've already fixed in v4.
Plan to post simplified v4 this Friday if nothing goes south.

> 
> Dave
> 
> >      cmd = monitor_parse_command(mon, cmdline, &cmdline, mon->cmd_table);
> >      if (!cmd) {
> >          return;
> > -- 
> > 2.7.4
> > 
> >   
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox series

Patch

diff --git a/monitor.c b/monitor.c
index f499250..fcb5386 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3097,6 +3097,10 @@  static void handle_hmp_command(Monitor *mon, const char *cmdline)
 
     trace_handle_hmp_command(mon, cmdline);
 
+    if (runstate_check(RUN_STATE_PRECONFIG)) {
+        monitor_printf(mon, "HMP not available in precofig state\n");
+    }
+
     cmd = monitor_parse_command(mon, cmdline, &cmdline, mon->cmd_table);
     if (!cmd) {
         return;