From nobody Wed Oct 29 17:30:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524841741330864.259770351475; Fri, 27 Apr 2018 08:09:01 -0700 (PDT) Received: from localhost ([::1]:48627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC4zc-0003vA-FQ for importer@patchew.org; Fri, 27 Apr 2018 11:09:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC4xF-0002Lq-8S for qemu-devel@nongnu.org; Fri, 27 Apr 2018 11:06:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fC4x9-0003Or-Uy for qemu-devel@nongnu.org; Fri, 27 Apr 2018 11:06:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57754 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fC4x9-0003OD-RF for qemu-devel@nongnu.org; Fri, 27 Apr 2018 11:06:27 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B12AEEC004 for ; Fri, 27 Apr 2018 15:06:26 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0CA6202323B; Fri, 27 Apr 2018 15:06:25 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Fri, 27 Apr 2018 17:05:16 +0200 Message-Id: <1524841523-95513-5-git-send-email-imammedo@redhat.com> In-Reply-To: <1524841523-95513-1-git-send-email-imammedo@redhat.com> References: <1524841523-95513-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 27 Apr 2018 15:06:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 27 Apr 2018 15:06:26 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'imammedo@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v6 04/11] hmp: disable monitor in preconfig state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pkrempa@redhat.com, ehabkost@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Eric Blake --- 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" ) --- 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 c= har *cmdline) =20 trace_handle_hmp_command(mon, cmdline); =20 + if (runstate_check(RUN_STATE_PRECONFIG)) { + monitor_printf(mon, "HMP not available in preconfig state, " + "use QMP instead\n"); + return; + } + cmd =3D monitor_parse_command(mon, cmdline, &cmdline, mon->cmd_table); if (!cmd) { return; --=20 2.7.4