From nobody Tue Feb 10 23:33:42 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620894717; cv=none; d=zohomail.com; s=zohoarc; b=cR4SFuNP7FMKXYPXtdtQ8iDgtKrPGhJI/xTeAEcIOx9gNm8WTBBoCey5V717LhBAPcXmlqR7uC5EaVXLmSJQ1kmlNa+H6yulFfnlYpa/jSFk949kYRYIbcJ0v7XJdvKMmSJiLsejxrzRe6BjiPnaer7N7VNSuxpikjwjNgGhPOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620894717; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A6fBhBS3b7o3WLpluUkd8tn+mi7/KDouKZJvPHu/ugo=; b=IX14xu+LiDl7pg9LuhCAm/Q6iORWd53yt97Vees4AAixrBAcBSbbD+eHW4BzVAW6urA171y9fdo5HUu5O1rGjxxei9LEkaiwasrldMS6X+/GVC+tpmyt7eenYu6IEusj2nuyHCdkmE6rjbgxyYRGMqR/u25t/RPzAVkWcpehGCU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620894717817130.66832869511313; Thu, 13 May 2021 01:31:57 -0700 (PDT) Received: from localhost ([::1]:51134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lh6lA-00015Z-KM for importer@patchew.org; Thu, 13 May 2021 04:31:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lh6gV-0005B7-Gd for qemu-devel@nongnu.org; Thu, 13 May 2021 04:27:07 -0400 Received: from beetle.greensocs.com ([5.135.226.135]:56732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lh6gT-0001Ni-Ki for qemu-devel@nongnu.org; Thu, 13 May 2021 04:27:07 -0400 Received: from localhost.localdomain (cable-24-135-22-90.dynamic.sbb.rs [24.135.22.90]) by beetle.greensocs.com (Postfix) with ESMTPSA id 093CB21EC1; Thu, 13 May 2021 08:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greensocs.com; s=mail; t=1620894424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A6fBhBS3b7o3WLpluUkd8tn+mi7/KDouKZJvPHu/ugo=; b=UaDR4nwW8dPHDuAD7C1U81Q8pEXmSiWeCoDVQ8bwC+IEexuU7/y8qCvHysjvPgo7COoAyj co/hZrTCk6jkCXNDFzwKnSfZuYL2poHY0ZdLLMMZCrsToeM4vYTbtuiJOc3sj9CCo+3cJv VaUf7dg+49ipz6e/baMsYBN8slb/Uw8= From: Mirela Grujic To: qemu-devel@nongnu.org Subject: [RFC PATCH 6/9] qapi: Implement 'advance-machine-phase' command Date: Thu, 13 May 2021 10:25:46 +0200 Message-Id: <20210513082549.114275-7-mirela.grujic@greensocs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210513082549.114275-1-mirela.grujic@greensocs.com> References: <20210513082549.114275-1-mirela.grujic@greensocs.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam: Yes Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.135.226.135; envelope-from=mirela.grujic@greensocs.com; helo=beetle.greensocs.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: damien.hedde@greensocs.com, edgar.iglesias@xilinx.com, Eduardo Habkost , mark.burton@greensocs.com, Markus Armbruster , Mirela Grujic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The command takes the target initialization phase as the argument and triggers QEMU to advance the machine to the target phase (i.e. execute all initialization steps required to enter the target phase). This command would be used as an alternative to 'next-machine-phase' if it's more convenient to jump to a target initialization phase than to single-step through phases. The command is used in combination with the -preconfig CLI option. Note: advancing the machine to the 'ready' phase has the same effect as executing the 'x-exit-preconfig' command when the machine is in 'accel-created' phase. Signed-off-by: Mirela Grujic --- qapi/machine.json | 26 ++++++++++++++++++++++++++ hw/core/machine-qmp-cmds.c | 10 ++++++++++ 2 files changed, 36 insertions(+) diff --git a/qapi/machine.json b/qapi/machine.json index 968d67dd95..31872aae72 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1352,3 +1352,29 @@ # ## { 'command': 'next-machine-phase', 'allow-preconfig': true } + +## +# @advance-machine-phase: +# +# Advance machine initialization phase to the target phase +# +# @phase: target machine initialization phase +# +# Since: #FIXME +# +# Returns: If successful, nothing +# +# Notes: This command will trigger QEMU to execute initialization steps +# that are required to enter the target machine initialization phas= e. +# If the target phase is the final initialization phase, the guest = will +# start running immediately unless the -S option is used. The comma= nd +# is available only if the -preconfig command line option was passe= d. +# +# Example: +# +# -> { "execute": "advance-machine-phase", "arguments": { "phase": "ready"= } } +# <- { "return": {} } +# +## +{ 'command': 'advance-machine-phase', 'data' : {'phase': 'MachineInitPhase= '}, + 'allow-preconfig': true } diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 8aa743d59b..6b21a3fdd5 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -219,3 +219,13 @@ void qmp_next_machine_phase(Error **errp) =20 qemu_machine_enter_phase(target_phase, errp); } + +void qmp_advance_machine_phase(MachineInitPhase phase, Error **errp) +{ + if (phase_get() =3D=3D phase) { + error_setg(errp, "Machine is already in the target phase"); + return; + } + + qemu_machine_enter_phase(phase, errp); +} --=20 2.25.1