From nobody Mon Feb 9 17:22:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601645981; cv=none; d=zohomail.com; s=zohoarc; b=bj788NXaOfdMaeuvM7T83FecMbR1NufM7hKUm92FV6E79EXPTRy/rq5g9wX3GHMO4fTnIqaib6ez+sw5UJb5BnH6bmFi2EljlyD2PFvZn1gkS4jebMPEuXputpc1Nd96v46R2lGYHU8L1TwEmkIGKtLSgV54BVvKXqfra6q7LvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601645981; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=kbK1m63mIh7G9YoSTt+lY9Rt1IngmCv52ys5F1Xv+Ck=; b=P0c5o7BWycuYc175UIAEcgr08FMc8E4ocsLHhrGxSO2C72JJa8aitMrt6peVnepfihI6iUlG3GyTtw1CL6fMvvd+QzYvL4In/ogEZdETEUmgELo4D2JQU0bD90LCxfPRa+NeoMwxnmoqq6VVcmj1/rvxGQ+ipjcPRmWJFOadpMY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601645981463578.2844226102136; Fri, 2 Oct 2020 06:39:41 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-484-HL8WkiTePaG-cAcbhd93Xg-1; Fri, 02 Oct 2020 09:39:38 -0400 Received: by mail-wm1-f70.google.com with SMTP id y6so539166wmi.7 for ; Fri, 02 Oct 2020 06:39:38 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id r19sm1784306wmh.7.2020.10.02.06.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 06:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kbK1m63mIh7G9YoSTt+lY9Rt1IngmCv52ys5F1Xv+Ck=; b=Uu3UBB/eBIZLRBxr/GKPc14VcSn2csCaxmXks06WflkrmIpYV2LU+DmKnQ+akzhTI+nipx QuR9bXjyODJjqrv8WyqmIQw0oopDoIHWDh/3k5bJcmDoTSjvROhQFa82GfXqqxp+Vhecey Cff8hZKjnDACwarcTk8YZGmgaNWQclc= X-MC-Unique: HL8WkiTePaG-cAcbhd93Xg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kbK1m63mIh7G9YoSTt+lY9Rt1IngmCv52ys5F1Xv+Ck=; b=bePfh8T4n161TXYM8PW6gYLbR0i9GbmADHmY+E+RLLlXqwA+y7cstr/tGWopYSXeD2 WJR7y7H3luwUWU2PIqZfDkQ96nwFtx/uDCabnC/TEGAyyy4/egF9PQZd5ZCE02JD1Bdw uLnxj7sGYjkrqg/vsCnYxhjEkMPnK+WhTPyJ8oigktzsajWWt9Mf6xEU/C0Vr2fYDyfq ekJs3xegxMB5AEFrlxQWRp/FkX/LONfofHT9hwl5JhZFtIlzcvu4j2SWWFkiadcnKo0z ldZkIAMelxTx55CPOFtnx0xw92aKIexAwfX4E0YzeAyB4bHJbr+KHcsdjDwz5zcG3BTw PI4w== X-Gm-Message-State: AOAM532Z6pmuTcTD+ntxTdJ60Mv7jSQcdg4j8akR7+03Ef3eeTZYJ76o NFAwqbxWZGiLTLozRUWvTg8lE5H6gT3U1umN4ap4ryIqWDEymKKsPsgF5TJW07r64aonXDg6bNP LwEQTZ6iHteGjpA== X-Received: by 2002:a1c:63c1:: with SMTP id x184mr3042783wmb.138.1601645977324; Fri, 02 Oct 2020 06:39:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD/heYmqaLVMQtumsMQOWyseI2hOgaXTBn2HXZs+0th/9VfQZ/6fqWSoQPr8a9Q2Va+FrerA== X-Received: by 2002:a1c:63c1:: with SMTP id x184mr3042765wmb.138.1601645977099; Fri, 02 Oct 2020 06:39:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Marcel Apfelbaum , "Dr. David Alan Gilbert" , xen-devel@lists.xenproject.org, Gerd Hoffmann , Markus Armbruster , Paolo Bonzini , Juan Quintela , Stefano Stabellini , Anthony Perard , Eric Blake , Paul Durrant , Peter Maydell , "Michael S. Tsirkin" , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] qapi: Restrict 'system wakeup/reset/powerdown' commands to machine.json Date: Fri, 2 Oct 2020 15:39:20 +0200 Message-Id: <20201002133923.1716645-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201002133923.1716645-1-philmd@redhat.com> References: <20201002133923.1716645-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Restricting system_wakeup/system_reset/system_powerdown to machine.json pulls slightly less QAPI-generated code into user-mode and tools. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine.json | 57 +++++++++++++++++++++++++++++++++++++++++++++++ qapi/misc.json | 57 ----------------------------------------------- ui/gtk.c | 1 + ui/cocoa.m | 1 + 4 files changed, 59 insertions(+), 57 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 073b1c98b2..55328d4f3c 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -452,6 +452,63 @@ ## { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } =20 +## +# @system_reset: +# +# Performs a hard reset of a guest. +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "system_reset" } +# <- { "return": {} } +# +## +{ 'command': 'system_reset' } + +## +# @system_powerdown: +# +# Requests that a guest perform a powerdown operation. +# +# Since: 0.14.0 +# +# Notes: A guest may or may not respond to this command. This command +# returning does not indicate that a guest has accepted the request= or +# that it has shut down. Many guests will respond to this command = by +# prompting the user in some way. +# Example: +# +# -> { "execute": "system_powerdown" } +# <- { "return": {} } +# +## +{ 'command': 'system_powerdown' } + +## +# @system_wakeup: +# +# Wake up guest from suspend. If the guest has wake-up from suspend +# support enabled (wakeup-suspend-support flag from +# query-current-machine), wake-up guest from suspend if the guest is +# in SUSPENDED state. Return an error otherwise. +# +# Since: 1.1 +# +# Returns: nothing. +# +# Note: prior to 4.0, this command does nothing in case the guest +# isn't suspended. +# +# Example: +# +# -> { "execute": "system_wakeup" } +# <- { "return": {} } +# +## +{ 'command': 'system_wakeup' } + ## # @LostTickPolicy: # diff --git a/qapi/misc.json b/qapi/misc.json index 37b3e04cec..cce2e71e9c 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -177,40 +177,6 @@ ## { 'command': 'stop' } =20 -## -# @system_reset: -# -# Performs a hard reset of a guest. -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "system_reset" } -# <- { "return": {} } -# -## -{ 'command': 'system_reset' } - -## -# @system_powerdown: -# -# Requests that a guest perform a powerdown operation. -# -# Since: 0.14.0 -# -# Notes: A guest may or may not respond to this command. This command -# returning does not indicate that a guest has accepted the request= or -# that it has shut down. Many guests will respond to this command = by -# prompting the user in some way. -# Example: -# -# -> { "execute": "system_powerdown" } -# <- { "return": {} } -# -## -{ 'command': 'system_powerdown' } - ## # @memsave: # @@ -318,29 +284,6 @@ ## { 'command': 'x-exit-preconfig', 'allow-preconfig': true } =20 -## -# @system_wakeup: -# -# Wake up guest from suspend. If the guest has wake-up from suspend -# support enabled (wakeup-suspend-support flag from -# query-current-machine), wake-up guest from suspend if the guest is -# in SUSPENDED state. Return an error otherwise. -# -# Since: 1.1 -# -# Returns: nothing. -# -# Note: prior to 4.0, this command does nothing in case the guest -# isn't suspended. -# -# Example: -# -# -> { "execute": "system_wakeup" } -# <- { "return": {} } -# -## -{ 'command': 'system_wakeup' } - ## # @human-monitor-command: # diff --git a/ui/gtk.c b/ui/gtk.c index b11594d817..a752aa22be 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -33,6 +33,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qapi-commands-control.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "qemu/cutils.h" =20 diff --git a/ui/cocoa.m b/ui/cocoa.m index 0910b4a716..f32adc3074 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -35,6 +35,7 @@ #include "sysemu/cpu-throttle.h" #include "qapi/error.h" #include "qapi/qapi-commands-block.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "sysemu/blockdev.h" #include "qemu-version.h" --=20 2.26.2