[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 04/11] hmp: disable monitor in preconfig stat
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v7 04/11] hmp: disable monitor in preconfig state |
Date: |
Thu, 24 May 2018 20:16:20 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Markus Armbruster <address@hidden> writes:
> Igor Mammedov <address@hidden> writes:
>
>> 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 <address@hidden>
>> Reviewed-by: Eric Blake <address@hidden>
>> ---
>> v5:
>> * add 'use QMP instead" to error message, suggesting user
>> the right interface to use
>> v4:
>> * v3 was only printing error but not preventing command execution,
>> Fix it by returning after printing error message.
>> ("Dr. David Alan Gilbert" <address@hidden>)
>> ---
>> monitor.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/monitor.c b/monitor.c
>> index 39f8ee1..0ffdf1d 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -3374,6 +3374,12 @@ 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 preconfig state, "
>> + "use QMP instead\n");
>> + return;
>> + }
>> +
>> cmd = monitor_parse_command(mon, cmdline, &cmdline, mon->cmd_table);
>> if (!cmd) {
>> return;
>
> So we offer the user an HMP monitor, but we summarily fail all commands.
> I'm sorry, but that's... searching for polite word... embarrassing. We
> should accept HMP output only when we're ready to accept it. Yes, that
> would involve a bit more surgery rather than this cheap hack. The whole
> preconfig thing smells like a cheap hack to me, but let's not overdo it.
Clarification: I don't think we need to hold the series because of
this. I do think you should investigate delaying HMP until it can work.
[Qemu-devel] [PATCH v7 06/11] tests: qapi-schema tests for allow-preconfig, Igor Mammedov, 2018/05/04
[Qemu-devel] [PATCH v7 05/11] qapi: introduce new cmd option "allowed-in-preconfig", Igor Mammedov, 2018/05/04