From patchwork Fri Oct 2 13:39:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 303844 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9F05C4727D for ; Fri, 2 Oct 2020 13:41:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3CC72206C3 for ; Fri, 2 Oct 2020 13:41:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TCRe4bWA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CC72206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOLJM-0000ep-1d for qemu-devel@archiver.kernel.org; Fri, 02 Oct 2020 09:41:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOLHg-0007PV-OK for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:39:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kOLHf-0005Qf-0r for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:39:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645977; 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=iLAVKEu0s8buMQigPSDDQRm3nwhcH7vFMDI5aBMruk4=; b=TCRe4bWA5D5qk4tZZo92tIW2337mdbCQMDIbiw/HZoeo8ACP5OnbstRiur8Kw/V1qDrCj6 ohemv/Z+U+XBTvnFQTMKdxfmlXTyI1rseMlSUVn1b7fx2CZ3OeWHGdjFKBXxUctB82rjEP 7m8luwKF+Te0VpQfNytYnroRB2iExiY= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-DIxfOHCXOYC663QpVHt77w-1; Fri, 02 Oct 2020 09:39:33 -0400 X-MC-Unique: DIxfOHCXOYC663QpVHt77w-1 Received: by mail-wr1-f70.google.com with SMTP id v5so571553wrr.0 for ; Fri, 02 Oct 2020 06:39:33 -0700 (PDT) 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=iLAVKEu0s8buMQigPSDDQRm3nwhcH7vFMDI5aBMruk4=; b=WUbe9eaOO3zF2+MJLemGrQXAYWG4UNP0y1LBl8qDJw19GUwzzJ7806HO+XCBvYrA4s VAgFGn3YKrzDOPhVYyeQuSEWiRh8en7/zQi6feFSk+4iqdU7dV+I1zFHJ29/TAhxpV9q nZrFunFzZdwbS/C1xSoCZzveHkKfhfTKD0ituZ3BnqE21rSmIL0/TQQi6Y8CbbbBP8JV qA6lK8uKmWJyOPzHr9FumAQWGQbYFEZ2u/kKiSgn2qWPsjOFtAlI+XoTGvbXJnUjcf7s yKdGGnDrtKmn2EeG3hK2Y302TDrnCDIqtsNvNvG+AGqX/exGNVeyGI7zbliKEpUnUCTK W+KQ== X-Gm-Message-State: AOAM53372yPjDQlG2iVa8laB2uXZsLDlXSAuyi/rq90+2AIB21kKOOJm PdGoGziQpW2Io2V4WfhuFYkPc8PGLCqQwzsGXdOlOke5/IkRxKmO/iMCnRqV55G59Z2gOY3Lros 0kFAABmOKKB5qilA= X-Received: by 2002:a7b:cc02:: with SMTP id f2mr2894074wmh.1.1601645972125; Fri, 02 Oct 2020 06:39:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqQv1qlyQpjgjGTEtLJvUYyUltyIpiDUFPSX1enMbbtlK6dt49SmY4VWfHBJPv80MAhGkeEw== X-Received: by 2002:a7b:cc02:: with SMTP id f2mr2894034wmh.1.1601645971831; Fri, 02 Oct 2020 06:39:31 -0700 (PDT) Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id 91sm1979455wrq.9.2020.10.02.06.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 06:39:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/5] qapi: Restrict 'inject-nmi' command to machine code Date: Fri, 2 Oct 2020 15:39:19 +0200 Message-Id: <20201002133923.1716645-2-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 Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/02 01:13:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: Peter Maydell , Stefano Stabellini , Eduardo Habkost , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Paul Durrant , Markus Armbruster , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , Gerd Hoffmann , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Restricting 'inject-nmi' to machine.json pulls slightly less QAPI-generated code into user-mode and tools. Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 20 ++++++++++++++++++++ qapi/misc.json | 20 -------------------- softmmu/cpus.c | 1 + 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 756dacb06f..073b1c98b2 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -484,6 +484,26 @@ { 'enum': 'LostTickPolicy', 'data': ['discard', 'delay', 'slew' ] } +## +# @inject-nmi: +# +# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64). +# The command fails when the guest doesn't support injecting. +# +# Returns: If successful, nothing +# +# Since: 0.14.0 +# +# Note: prior to 2.1, this command was only supported for x86 and s390 VMs +# +# Example: +# +# -> { "execute": "inject-nmi" } +# <- { "return": {} } +# +## +{ 'command': 'inject-nmi' } + ## # @NumaOptionsType: # diff --git a/qapi/misc.json b/qapi/misc.json index 694d2142f3..37b3e04cec 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -341,26 +341,6 @@ ## { 'command': 'system_wakeup' } -## -# @inject-nmi: -# -# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64). -# The command fails when the guest doesn't support injecting. -# -# Returns: If successful, nothing -# -# Since: 0.14.0 -# -# Note: prior to 2.1, this command was only supported for x86 and s390 VMs -# -# Example: -# -# -> { "execute": "inject-nmi" } -# <- { "return": {} } -# -## -{ 'command': 'inject-nmi' } - ## # @human-monitor-command: # diff --git a/softmmu/cpus.c b/softmmu/cpus.c index ac8940d52e..bd040d6cdd 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -29,6 +29,7 @@ #include "migration/vmstate.h" #include "monitor/monitor.h" #include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-events-run-state.h" #include "qapi/qmp/qerror.h" From patchwork Fri Oct 2 13:39:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 272214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25909C47423 for ; Fri, 2 Oct 2020 13:41:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD25921D24 for ; Fri, 2 Oct 2020 13:41:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Uu3UBB/e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD25921D24 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOLJO-0000ky-Op for qemu-devel@archiver.kernel.org; Fri, 02 Oct 2020 09:41:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOLHj-0007Ta-RL for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:39:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:48759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kOLHh-0005Qy-2z for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:39:43 -0400 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= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-6rI3QRIqMvGDfNZICdBKgw-1; Fri, 02 Oct 2020 09:39:38 -0400 X-MC-Unique: 6rI3QRIqMvGDfNZICdBKgw-1 Received: by mail-wr1-f70.google.com with SMTP id a10so546799wrw.22 for ; Fri, 02 Oct 2020 06:39:38 -0700 (PDT) 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=DoR0LF5jOPfcpTDeiU1NdzksEWVqbMz27aP+jMYlfLTsCwbdVh1+sPClXwakqzpyFC bFuRW7eZuOnk5zJLhjoF6L8nCV2ZJinE5s9j88n5VbIivO8MA0H2lpicsWu8QR6Iwoyt ZR7QqTINYL0IYsxrDKn3X84oK3hC1fSWVPjwNTPEdOdXlPrWz9OfzK2Ovta5Ym5fJDzd sH7F54ObnnTdMCv0Zbze296qNo2/ZaROiPbpo7YPpq3n1Woz1g9EyxXH4RCY4fqGCVBk GeUKfBJyXaE3H7OVfOkVDZpxda+W0IhTfbFWYGoUCbGqdLKUIxrVnBxpxtaT2aQPMpEz 1Dgg== X-Gm-Message-State: AOAM530m6v0lbhhlN2MqcE9ppXmoIHi+ro+hwg3SsiQ4iS41LVienKWi XkVNY0+AMvPzy+WNFAmLYefwoUqdVcspNYHwUAHdcDF9WhpA+Z6WRnx4wqs+4QG/Ozny/3KsRxE xLixl9YccT61Ct4k= X-Received: by 2002:a1c:63c1:: with SMTP id x184mr3042797wmb.138.1601645977326; 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/01 23:37:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: Peter Maydell , Stefano Stabellini , Eduardo Habkost , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Paul Durrant , Markus Armbruster , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , Gerd Hoffmann , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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é --- 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' } +## +# @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' } -## -# @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 } -## -# @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" 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" From patchwork Fri Oct 2 13:39:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 272213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA9B2C4363D for ; Fri, 2 Oct 2020 13:43:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 42CC9206CA for ; Fri, 2 Oct 2020 13:43:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CMA2qWUG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42CC9206CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOLL6-0003Tk-50 for qemu-devel@archiver.kernel.org; Fri, 02 Oct 2020 09:43:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOLHs-0007Zc-V2 for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:39:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kOLHm-0005Rh-IE for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:39:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645985; 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=l++0FncV4p/balcOSro5u4OfFvevG6nmzhJ8fBAOs6w=; b=CMA2qWUGKaJFPOl0xhGRkqRJydMFHE/FmbhQU6a7ZBwhMjgpWmsmnjpmOVyZuLlumvB6Y1 6E+J1hXmJ0pWFAEvPkSpteVeuafaRmgZxX18bWOuyvMTx9UNnAH4ik6TwLKEEwITrK5ClC 8uVqal1/E8Mcjd1PAMKodt8yPS13IeI= 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-338-33mi2_fyNU6lwhs5Mup5YQ-1; Fri, 02 Oct 2020 09:39:44 -0400 X-MC-Unique: 33mi2_fyNU6lwhs5Mup5YQ-1 Received: by mail-wm1-f70.google.com with SMTP id a25so436338wmb.2 for ; Fri, 02 Oct 2020 06:39:44 -0700 (PDT) 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=l++0FncV4p/balcOSro5u4OfFvevG6nmzhJ8fBAOs6w=; b=JpyMfO+dhZtz8EI8CN0E7ulbTRAqQc+KamtAiaDZ3DSqKAPxEsRRaht6T0444U/sAf LDdmMKyMVdrgx7F73WgdFfrhdNtuzTuRegG6nTAfzXcEoZ69z1ZQ9IyYYlzLiF+jYMS2 JxqhzR7NwewP9RfXZv89o5iVexqfhzFHftPgdctVMs1ptQqLqHfMTq0HpLoWISsEe912 6KSbPqDzWERRqPuWWqhjkq2af00LlLU6aXO/NqmgXlufWtVD/YGyB5qjPwzoOZ4ja9Yq C2c71/v7If9KRNfOcIyLh/AEQaCX8xHzXo3UIJzc7OiBiTkUSQxcf3Cs2bZeoh89rJp4 op6A== X-Gm-Message-State: AOAM532Bro7os5m9kYXoXcT6ii8MYUEKzl8vhYGGMN80TGxkVhKbkS5k qKZSNtcQ53bz7T3rq2h1tOABHrZxtOXwY1rCDbNuY9F9Li15USA4nH1gLGlM6d9sggD6spxZtlP BZzizLlBpfnm0GYM= X-Received: by 2002:a1c:9a0c:: with SMTP id c12mr3069203wme.85.1601645982656; Fri, 02 Oct 2020 06:39:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytnflmvzG2NbHjeDXeHd5cEjLZ7ujLVl3vbAMVyGFRFjZMyWEyqKmjFZCL5TRb0S/3cpVZiw== X-Received: by 2002:a1c:9a0c:: with SMTP id c12mr3069171wme.85.1601645982462; Fri, 02 Oct 2020 06:39:42 -0700 (PDT) Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id 13sm1358682wmk.30.2020.10.02.06.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 06:39:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/5] qapi: Restrict '(p)memsave' command to machine code Date: Fri, 2 Oct 2020 15:39:21 +0200 Message-Id: <20201002133923.1716645-4-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 Received-SPF: pass client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/01 23:37:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: Peter Maydell , Stefano Stabellini , Eduardo Habkost , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Paul Durrant , Markus Armbruster , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , Gerd Hoffmann , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Restricting memsave/pmemsave to machine.json pulls slightly less QAPI-generated code into user-mode and tools. Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 61 +++++++++++++++++++++++++++++++++++++++++++++++ qapi/misc.json | 61 ----------------------------------------------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 55328d4f3c..5a3bbcae01 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -887,6 +887,67 @@ { 'enum': 'HostMemPolicy', 'data': [ 'default', 'preferred', 'bind', 'interleave' ] } +## +# @memsave: +# +# Save a portion of guest memory to a file. +# +# @val: the virtual address of the guest to start from +# +# @size: the size of memory region to save +# +# @filename: the file to save the memory to as binary data +# +# @cpu-index: the index of the virtual CPU to use for translating the +# virtual address (defaults to CPU 0) +# +# Returns: Nothing on success +# +# Since: 0.14.0 +# +# Notes: Errors were not reliably returned until 1.1 +# +# Example: +# +# -> { "execute": "memsave", +# "arguments": { "val": 10, +# "size": 100, +# "filename": "/tmp/virtual-mem-dump" } } +# <- { "return": {} } +# +## +{ 'command': 'memsave', + 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} } + +## +# @pmemsave: +# +# Save a portion of guest physical memory to a file. +# +# @val: the physical address of the guest to start from +# +# @size: the size of memory region to save +# +# @filename: the file to save the memory to as binary data +# +# Returns: Nothing on success +# +# Since: 0.14.0 +# +# Notes: Errors were not reliably returned until 1.1 +# +# Example: +# +# -> { "execute": "pmemsave", +# "arguments": { "val": 10, +# "size": 100, +# "filename": "/tmp/physical-mem-dump" } } +# <- { "return": {} } +# +## +{ 'command': 'pmemsave', + 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} } + ## # @Memdev: # diff --git a/qapi/misc.json b/qapi/misc.json index cce2e71e9c..2a5d03a69e 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -177,67 +177,6 @@ ## { 'command': 'stop' } -## -# @memsave: -# -# Save a portion of guest memory to a file. -# -# @val: the virtual address of the guest to start from -# -# @size: the size of memory region to save -# -# @filename: the file to save the memory to as binary data -# -# @cpu-index: the index of the virtual CPU to use for translating the -# virtual address (defaults to CPU 0) -# -# Returns: Nothing on success -# -# Since: 0.14.0 -# -# Notes: Errors were not reliably returned until 1.1 -# -# Example: -# -# -> { "execute": "memsave", -# "arguments": { "val": 10, -# "size": 100, -# "filename": "/tmp/virtual-mem-dump" } } -# <- { "return": {} } -# -## -{ 'command': 'memsave', - 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} } - -## -# @pmemsave: -# -# Save a portion of guest physical memory to a file. -# -# @val: the physical address of the guest to start from -# -# @size: the size of memory region to save -# -# @filename: the file to save the memory to as binary data -# -# Returns: Nothing on success -# -# Since: 0.14.0 -# -# Notes: Errors were not reliably returned until 1.1 -# -# Example: -# -# -> { "execute": "pmemsave", -# "arguments": { "val": 10, -# "size": 100, -# "filename": "/tmp/physical-mem-dump" } } -# <- { "return": {} } -# -## -{ 'command': 'pmemsave', - 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} } - ## # @cont: # From patchwork Fri Oct 2 13:39:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 303843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85A65C4363D for ; Fri, 2 Oct 2020 13:43:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 320F5206CA for ; Fri, 2 Oct 2020 13:43:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WLnR9ETf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 320F5206CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOLL3-0003Ml-C7 for qemu-devel@archiver.kernel.org; Fri, 02 Oct 2020 09:43:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOLHw-0007b3-Ct for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:39:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:41751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kOLHt-0005Rz-Mj for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:39:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645990; 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=tvVXKSfjWkoZJFhCHk1dGuX00kfrmBZkcI+Ka1f3ccA=; b=WLnR9ETfDS4r/AKBNje6d4yfmzyiqvTwaUreLh30eQ6pSwV7xqInImU0HYuHJ6YTXF3kMc S3kGoKovKhN2PMSpSJ2RtMuEXJja6ki5bjjaKx0hfMDqDbTsyXpBx4VZdsKb75uPqd5H92 gbs29dFhDH749aiGKcl1vJKdg1qwXnI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-576-ugbAX-LnMgyvnbXpHotCQA-1; Fri, 02 Oct 2020 09:39:49 -0400 X-MC-Unique: ugbAX-LnMgyvnbXpHotCQA-1 Received: by mail-wm1-f72.google.com with SMTP id d197so539756wmd.4 for ; Fri, 02 Oct 2020 06:39:48 -0700 (PDT) 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=tvVXKSfjWkoZJFhCHk1dGuX00kfrmBZkcI+Ka1f3ccA=; b=nKQvD9jdFMKIlP7nfIYmPAc44kve7koeipaICmv+6F3DWa9dtbqoXW8mX9R/I2kVsn jQWUgyJsGpYi48O+D0AZ6gYJc1ags+9L240opU8LbwgHk1KihWLByH+tf9/CtBEJqicq 7aWijprNmaC6qZR/h7j4saL18/+LsCB37GFsJazpMe8gMyqGr4bNdsdf1LKucjQWMjwI lSGgGrPQH+EOhSP+R4n+MCgJT/I0ee4DpdPBr10bzm5OlIsbRHTjjwkZkI98Wc+Vx4vt 2rmSHcyF3f9K6O1nufCpC+nPMkqhAHatjXsmZFP2s7csX/oFGffoD3ctljoKigc1zpsG e4+A== X-Gm-Message-State: AOAM533SlJT+/CQn2IP/SA/rF5nMpmgmCEbaXyNQ05pLDyzhFXKfHj6/ Z02n8T2JTfHrT6xFwT6MPUd8mT9qtAxJ+rpFPonQz0aPwPwXI6lUCr2WrE4CAf99XLuVDzuAzlG VIyAv292C/hT0HEU= X-Received: by 2002:adf:9bcf:: with SMTP id e15mr3075495wrc.93.1601645987717; Fri, 02 Oct 2020 06:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXZ0DUtM8ag+Gzw12Jr6+YpFZwVTHU0tycGVTY/5KbE5Wb3wWL4PNJqnB0Xi/zQrZCrmxEzA== X-Received: by 2002:adf:9bcf:: with SMTP id e15mr3075463wrc.93.1601645987503; Fri, 02 Oct 2020 06:39:47 -0700 (PDT) Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id d18sm1779795wrm.10.2020.10.02.06.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 06:39:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 4/5] qapi: Restrict 'query-kvm' command to machine code Date: Fri, 2 Oct 2020 15:39:22 +0200 Message-Id: <20201002133923.1716645-5-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 Received-SPF: pass client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/01 23:37:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: Peter Maydell , Stefano Stabellini , Eduardo Habkost , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Paul Durrant , Markus Armbruster , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , Gerd Hoffmann , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Restricting query-kvm to machine.json pulls slightly less QAPI-generated code into user-mode and tools. Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 30 ++++++++++++++++++++++++++++++ qapi/misc.json | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 5a3bbcae01..7c9a263778 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -561,6 +561,36 @@ ## { 'command': 'inject-nmi' } +## +# @KvmInfo: +# +# Information about support for KVM acceleration +# +# @enabled: true if KVM acceleration is active +# +# @present: true if KVM acceleration is built into this executable +# +# Since: 0.14.0 +## +{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} } + +## +# @query-kvm: +# +# Returns information about KVM acceleration +# +# Returns: @KvmInfo +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "query-kvm" } +# <- { "return": { "enabled": true, "present": true } } +# +## +{ 'command': 'query-kvm', 'returns': 'KvmInfo' } + ## # @NumaOptionsType: # diff --git a/qapi/misc.json b/qapi/misc.json index 2a5d03a69e..9813893269 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -68,36 +68,6 @@ ## { 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true } -## -# @KvmInfo: -# -# Information about support for KVM acceleration -# -# @enabled: true if KVM acceleration is active -# -# @present: true if KVM acceleration is built into this executable -# -# Since: 0.14.0 -## -{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} } - -## -# @query-kvm: -# -# Returns information about KVM acceleration -# -# Returns: @KvmInfo -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-kvm" } -# <- { "return": { "enabled": true, "present": true } } -# -## -{ 'command': 'query-kvm', 'returns': 'KvmInfo' } - ## # @IOThreadInfo: # From patchwork Fri Oct 2 13:39:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 303842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C35F3C4363D for ; Fri, 2 Oct 2020 13:45:00 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 559D0206CA for ; Fri, 2 Oct 2020 13:45:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MQBD7F11" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 559D0206CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOLMp-0005WY-Gr for qemu-devel@archiver.kernel.org; Fri, 02 Oct 2020 09:44:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOLI2-0007co-5e for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:40:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kOLHy-0005Td-0Y for qemu-devel@nongnu.org; Fri, 02 Oct 2020 09:40:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645996; 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=8IRn/Y0aJt1eGijTbQmkn/6JoyPalvnCOEAPCHm0k58=; b=MQBD7F11kpTxjsik9FV6v8rcS/d9u9imMaejaRE/Bxo/GCKTGsv0NS3RkRWzB26fpurtiF ppSTEh9sI0MYvAL97aZy/g05cmU4HsvU/KxLrvfpaRITcMoQdfoeBViwIjsdMEdeG6//kC 3WJxhDOFSI0uwC82k17eJCSKScBXZGI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-480-VpEtMgYnNqybgH_jj2vP7g-1; Fri, 02 Oct 2020 09:39:55 -0400 X-MC-Unique: VpEtMgYnNqybgH_jj2vP7g-1 Received: by mail-wm1-f72.google.com with SMTP id t8so433910wmj.6 for ; Fri, 02 Oct 2020 06:39:55 -0700 (PDT) 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=8IRn/Y0aJt1eGijTbQmkn/6JoyPalvnCOEAPCHm0k58=; b=oMyAjpTp8yRVbK7SeuNosyQxJtWymcy2FYlui+CSlXuAX8v1aFw8pAm0kvwNzbSLfo UT4hu3TDo70ncaXVqRoNSbL5pCmOUnYqzZ3QXuI2K1M1pWqpZVCkiCL5iP46k4zPysEW fWWY/Fhsum5RPcwkxbihmRHdMjlO6YnLYnC9xY/oEWzUzEkKIMybwwiWrdHxQAgd/1f/ uAjMRH1p033e5LdT+SLlWg87CMgHLuWvrHU+43+D4UlL3+ozN5fXseSS74UcNS980uwX FiqBreU9nYvDzIrNksWptp6bH6rMaKICNpyhhCky7ASrckm4KPVY83VBnRA7+xB54ysi 5Jdw== X-Gm-Message-State: AOAM531W1JmSkz8b1pn7L4Esdf2cMG476NHUh57B0R8SHop3ewiOAzL9 YtDb9JRQhqKhQi6aS9arpH8l90RTIWlHkMxlTlE0Z25ztjfD8I52xuggqL7ACokBupukHx8o0VU j6EH21ZuNhs2zmkY= X-Received: by 2002:a5d:43cf:: with SMTP id v15mr3203828wrr.269.1601645993157; Fri, 02 Oct 2020 06:39:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrtjDxbvNT2qZx2AnpZX/U8SDHXTxctCni5ZD+jg0EWfaGOVq2AOPJli+/iQHk1imFPhnyVw== X-Received: by 2002:a5d:43cf:: with SMTP id v15mr3203803wrr.269.1601645992898; Fri, 02 Oct 2020 06:39:52 -0700 (PDT) Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id f6sm1818116wro.5.2020.10.02.06.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 06:39:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 5/5] qapi: Restrict Xen migration commands to migration.json Date: Fri, 2 Oct 2020 15:39:23 +0200 Message-Id: <20201002133923.1716645-6-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 Received-SPF: pass client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/01 23:37:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: Peter Maydell , Stefano Stabellini , Eduardo Habkost , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Paul Durrant , Markus Armbruster , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , Gerd Hoffmann , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Restricting xen-set-global-dirty-log and xen-load-devices-state commands migration.json pulls slightly less QAPI-generated code into user-mode and tools. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Dr. David Alan Gilbert --- qapi/migration.json | 41 +++++++++++++++++++++++++++++++++++++++++ qapi/misc.json | 41 ----------------------------------------- accel/stubs/xen-stub.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- migration/savevm.c | 1 - 5 files changed, 43 insertions(+), 44 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index 7f5e6fd681..cb30f4c729 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1551,6 +1551,47 @@ { 'command': 'xen-save-devices-state', 'data': {'filename': 'str', '*live':'bool' } } +## +# @xen-set-global-dirty-log: +# +# Enable or disable the global dirty log mode. +# +# @enable: true to enable, false to disable. +# +# Returns: nothing +# +# Since: 1.3 +# +# Example: +# +# -> { "execute": "xen-set-global-dirty-log", +# "arguments": { "enable": true } } +# <- { "return": {} } +# +## +{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } } + +## +# @xen-load-devices-state: +# +# Load the state of all devices from file. The RAM and the block devices +# of the VM are not loaded by this command. +# +# @filename: the file to load the state of the devices from as binary +# data. See xen-save-devices-state.txt for a description of the binary +# format. +# +# Since: 2.7 +# +# Example: +# +# -> { "execute": "xen-load-devices-state", +# "arguments": { "filename": "/tmp/resume" } } +# <- { "return": {} } +# +## +{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} } + ## # @xen-set-replication: # diff --git a/qapi/misc.json b/qapi/misc.json index 9813893269..afe936b45b 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -287,26 +287,6 @@ 'data': {'device': 'str', 'target': 'str', '*arg': 'str'}, 'features': [ 'deprecated' ] } -## -# @xen-set-global-dirty-log: -# -# Enable or disable the global dirty log mode. -# -# @enable: true to enable, false to disable. -# -# Returns: nothing -# -# Since: 1.3 -# -# Example: -# -# -> { "execute": "xen-set-global-dirty-log", -# "arguments": { "enable": true } } -# <- { "return": {} } -# -## -{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } } - ## # @getfd: # @@ -606,24 +586,3 @@ ## { 'enum': 'ReplayMode', 'data': [ 'none', 'record', 'play' ] } - -## -# @xen-load-devices-state: -# -# Load the state of all devices from file. The RAM and the block devices -# of the VM are not loaded by this command. -# -# @filename: the file to load the state of the devices from as binary -# data. See xen-save-devices-state.txt for a description of the binary -# format. -# -# Since: 2.7 -# -# Example: -# -# -> { "execute": "xen-load-devices-state", -# "arguments": { "filename": "/tmp/resume" } } -# <- { "return": {} } -# -## -{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} } diff --git a/accel/stubs/xen-stub.c b/accel/stubs/xen-stub.c index 7ba0b697f4..7054965c48 100644 --- a/accel/stubs/xen-stub.c +++ b/accel/stubs/xen-stub.c @@ -7,7 +7,7 @@ #include "qemu/osdep.h" #include "sysemu/xen.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-migration.h" bool xen_allowed; diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index f3ababf33b..9519c33c09 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -24,7 +24,7 @@ #include "hw/xen/xen-bus.h" #include "hw/xen/xen-x86.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-migration.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/range.h" diff --git a/migration/savevm.c b/migration/savevm.c index 34e4b71052..1fdf3f76c2 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -42,7 +42,6 @@ #include "postcopy-ram.h" #include "qapi/error.h" #include "qapi/qapi-commands-migration.h" -#include "qapi/qapi-commands-misc.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "sysemu/cpus.h"