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: 11813585 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 57AE8139F for ; Fri, 2 Oct 2020 13:40:27 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 28992206E3 for ; Fri, 2 Oct 2020 13:40:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z6DK7UlR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28992206E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.2122.6302 (Exim 4.92) (envelope-from ) id 1kOLHf-0001oS-Ny; Fri, 02 Oct 2020 13:39:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 2122.6302; Fri, 02 Oct 2020 13:39:39 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHf-0001oL-KQ; Fri, 02 Oct 2020 13:39:39 +0000 Received: by outflank-mailman (input) for mailman id 2122; Fri, 02 Oct 2020 13:39:38 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHe-0001o1-BS for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:38 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 65ec9fd5-b877-4355-ae15-291e198d59bc; Fri, 02 Oct 2020 13:39:35 +0000 (UTC) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-274-DSmf6SVhOiOntOuoPZ_fqA-1; Fri, 02 Oct 2020 09:39:33 -0400 Received: by mail-wr1-f69.google.com with SMTP id l9so554526wrq.20 for ; Fri, 02 Oct 2020 06:39:33 -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) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHe-0001o1-BS for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:38 +0000 X-Inumbo-ID: 65ec9fd5-b877-4355-ae15-291e198d59bc Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 65ec9fd5-b877-4355-ae15-291e198d59bc; Fri, 02 Oct 2020 13:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645975; 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=Z6DK7UlR9jzeTDWaDTeu0zBR6OjAZvmi4ldqzQlM7EUa0/VtQVTZ2c6ap5A/xQeV59MsZm d6X+Do8ZcgkfOInXJC6Gh3l7oILwJ5N3R4nCHN4Vi2hA2yM1sr2CbqKBgh09jVej7Cp0xm L1mtKfoRAJjKKGpDZQE7wKjr1xHVAx0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-274-DSmf6SVhOiOntOuoPZ_fqA-1; Fri, 02 Oct 2020 09:39:33 -0400 X-MC-Unique: DSmf6SVhOiOntOuoPZ_fqA-1 Received: by mail-wr1-f69.google.com with SMTP id l9so554526wrq.20 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=qvzefYhpkF7n6MMR4XIkxvhtD2H+CTP0Ot9/REeG70SLmktzCVki+qeOIHps/066pF /LCcxR6DzDKIEWQR3tNow4C4W4t54SD2neNhO9foUwURzOM4lJUPUi661ZSvtNAl0zuF p8leW8pmNDYF8NFi6eMRNUbvPziBrwVxzPizZPZCrb+EHTYsyXUx9VlPb6hm9IhziyMJ Dipxvx/f4hPRqGFS7HFkxRS6gXCZArBGzj2dhehibUKNyf7/Q2yFHFnsmjzJr8MwWYBw ryzxsO6sQei/wNcy9uonhV8y1QzMjGHtALZqqJzyeQ1RY0FHFmxMAfbY/EosuYSqP4W9 Ulkg== X-Gm-Message-State: AOAM530l6iD3jWmhdbyGVixljgzy8/JeN16MzQ/h3EP5Cdfeh0zssPrl JbKbVV9+dkFvYHpaujXdQrzOh2BiV5kjDH+buJ4wP8vuHy45Q8yN16JcFYwNg1/CxCHNqzTV6mO x5Wk1PzLUItwVyjcUgLuhNOTXNrY= X-Received: by 2002:a7b:cc02:: with SMTP id f2mr2894069wmh.1.1601645972085; 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 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_Mathieu-Daud=C3=A9?= 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 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: 11813591 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03441139F for ; Fri, 2 Oct 2020 13:40:42 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 C6D8B20719 for ; Fri, 2 Oct 2020 13:40:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (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 C6D8B20719 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.2123.6314 (Exim 4.92) (envelope-from ) id 1kOLHk-0001rR-7d; Fri, 02 Oct 2020 13:39:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 2123.6314; Fri, 02 Oct 2020 13:39:44 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHk-0001rJ-3h; Fri, 02 Oct 2020 13:39:44 +0000 Received: by outflank-mailman (input) for mailman id 2123; Fri, 02 Oct 2020 13:39:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHj-0001o1-7l for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:43 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id bfb246c0-b6fd-40ae-bcf1-97b5a21e218e; Fri, 02 Oct 2020 13:39:40 +0000 (UTC) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-484-8QquVv6XN-WG38wS1ghzDg-1; Fri, 02 Oct 2020 09:39:38 -0400 Received: by mail-wm1-f69.google.com with SMTP id i9so95878wml.2 for ; Fri, 02 Oct 2020 06:39:38 -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) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHj-0001o1-7l for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:43 +0000 X-Inumbo-ID: bfb246c0-b6fd-40ae-bcf1-97b5a21e218e Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id bfb246c0-b6fd-40ae-bcf1-97b5a21e218e; Fri, 02 Oct 2020 13:39:40 +0000 (UTC) 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-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-484-8QquVv6XN-WG38wS1ghzDg-1; Fri, 02 Oct 2020 09:39:38 -0400 X-MC-Unique: 8QquVv6XN-WG38wS1ghzDg-1 Received: by mail-wm1-f69.google.com with SMTP id i9so95878wml.2 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=lc4bklQB/9mlIdD253n0ziNqrLJ2/OXTx8wk1FNM0UB8xR8mE5kkizU8f4WKYl5Z+Z NfUleXm6S6/fC3lNQADHNgAjJpGBhBGVJLvn85c0cSt39f2qL6epWwDHGmoKTb2hEzCB akkgxtMTth+KUrVtQoUZM5NGb6ACWU0UMHtYrWNDHRHFL70fBeR+/+dzqDDJ/HSyX6Ei VqZMOIA56UXy75fYOXQukbN4s5mGg2psRTw/EnDtMAY3t7yt3ERq0GIEv+ivZtIuG6wY lS1uqfh7fAg8qtqXW9/N16Czv1r81PaIeYFeUp1S5c/piN01cAn/XEFHbvRXajBIYgzK aqWQ== X-Gm-Message-State: AOAM531w7h/gP5lYIIlEgiBEMsikbjCDKksU3W9wGaz4CEvXR0wB7PJW z1oQrvyG74XwsS9l+9oiVO5ZfAffeTjaTAfgFSMLL+R3tVljx6Pj1+o0qRnCCCsKZ7dHjQHoT/U jXS8osdorQHDwCdBEwF1sKeCoZ4A= X-Received: by 2002:a1c:63c1:: with SMTP id x184mr3042796wmb.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 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_Mathieu-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 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: 11813593 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 812A3139F for ; Fri, 2 Oct 2020 13:40:48 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 54D8520719 for ; Fri, 2 Oct 2020 13:40:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="A62p7juO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54D8520719 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.2125.6338 (Exim 4.92) (envelope-from ) id 1kOLHo-0001xN-U2; Fri, 02 Oct 2020 13:39:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 2125.6338; Fri, 02 Oct 2020 13:39:48 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHo-0001xA-PU; Fri, 02 Oct 2020 13:39:48 +0000 Received: by outflank-mailman (input) for mailman id 2125; Fri, 02 Oct 2020 13:39:47 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHn-0001sI-8c for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:47 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [216.205.24.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 071378c0-3579-45d2-b599-f6a9d517486b; Fri, 02 Oct 2020 13:39:46 +0000 (UTC) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-yxHcaOtHPt6Z8bCmYwWpEQ-1; Fri, 02 Oct 2020 09:39:44 -0400 Received: by mail-wm1-f71.google.com with SMTP id y83so538355wmc.8 for ; Fri, 02 Oct 2020 06:39:43 -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) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHn-0001sI-8c for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:47 +0000 X-Inumbo-ID: 071378c0-3579-45d2-b599-f6a9d517486b Received: from us-smtp-delivery-124.mimecast.com (unknown [216.205.24.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 071378c0-3579-45d2-b599-f6a9d517486b; Fri, 02 Oct 2020 13:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645986; 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=A62p7juO5/oCRzYcD+UnjZCgVl4O/baHfJCuA60JD6GY0wx84Vx9dEvMnYvJGn2W+Qb1Mh kcJ5wz9eJ0wfDaY2MNdFVa//r7G0kZPxYZABdbdemrzxAoJ7/kRg9K6WgUH0IL4k48XrRF LbpfmxnIzQ1ib2+dZkR0+o3fuWoa4VI= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-yxHcaOtHPt6Z8bCmYwWpEQ-1; Fri, 02 Oct 2020 09:39:44 -0400 X-MC-Unique: yxHcaOtHPt6Z8bCmYwWpEQ-1 Received: by mail-wm1-f71.google.com with SMTP id y83so538355wmc.8 for ; Fri, 02 Oct 2020 06:39:43 -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=psaPcu/UzDhKUJKdh55I2jd2eCCbEYKknfAo6zPTDG9+Zi1/ur7lQuSyHqAoUMYjyC /h7zKctrrz+GrC6U08CW/pKsZgT/KMUNfzRwZyNLe7JuniGdmOer1e8ebamSHO3aHJco wCCTC9sQkBUnz61ICzWEPHp4ZKj4+f1Xic6mX/MSWtcx2DJk9KUNhtwBAM/zzYinTZs+ 0cfIti12g2diov5PzXtZSkPI/fbZn7xzKq/ehqMd2lpDUQFJ25IoqCfBztGvOnaZ+S1N iAVkX5ci8PGLXFmDybgdaHPUn1kDCkRXViNboS3kRpyLsO4KNN8XvIaPQtDKBvIt8rFt Y0hg== X-Gm-Message-State: AOAM5324HpPxBVLhdhXyEx1PkxtD7GJA3/yCcAac3QhLIFUSjTGYXx4I k9sp+v8BF4uSQKYCoWDI30CR9QgBnvvVnnfwh9g6W4/ShmgbIubU5ywAmPeMgaXbmrNlKW96l64 naimJnnw0Fj0Egf6dfVWPh7K/5ng= X-Received: by 2002:a1c:9a0c:: with SMTP id c12mr3069190wme.85.1601645982655; 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 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_Mathieu-Daud=C3=A9?= 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 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: 11813587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D2ED139F for ; Fri, 2 Oct 2020 13:40:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 3AB0B206E3 for ; Fri, 2 Oct 2020 13:40:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y9UNoL+P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AB0B206E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.2126.6350 (Exim 4.92) (envelope-from ) id 1kOLHt-00023E-Go; Fri, 02 Oct 2020 13:39:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 2126.6350; Fri, 02 Oct 2020 13:39:53 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHt-000236-CR; Fri, 02 Oct 2020 13:39:53 +0000 Received: by outflank-mailman (input) for mailman id 2126; Fri, 02 Oct 2020 13:39:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHs-000223-FI for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:52 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 0514069d-5379-4000-bbbf-b4a2b6d0123c; Fri, 02 Oct 2020 13:39:51 +0000 (UTC) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-596-vfdZeNnmMf-TehhOv5_q6A-1; Fri, 02 Oct 2020 09:39:50 -0400 Received: by mail-wr1-f72.google.com with SMTP id r16so554198wrm.18 for ; Fri, 02 Oct 2020 06:39:50 -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) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHs-000223-FI for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:52 +0000 X-Inumbo-ID: 0514069d-5379-4000-bbbf-b4a2b6d0123c Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 0514069d-5379-4000-bbbf-b4a2b6d0123c; Fri, 02 Oct 2020 13:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645991; 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=Y9UNoL+P7MRObMQELlSDzu+JhTudkEbGjlHpGCFRvvloKQZNg78znvFafm/XjHFhgLtM5w JWIeRVQnOL7dZqbgLLEcrun1643CiEcltViAa7G+pdmKJw+sRiQIo1gQHq3/lU24i3PuNt kQDUv8x4Iq3rIeUWVVybXptUDd1UkQE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-596-vfdZeNnmMf-TehhOv5_q6A-1; Fri, 02 Oct 2020 09:39:50 -0400 X-MC-Unique: vfdZeNnmMf-TehhOv5_q6A-1 Received: by mail-wr1-f72.google.com with SMTP id r16so554198wrm.18 for ; Fri, 02 Oct 2020 06:39:50 -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=YtcOiJ5f2FZZhMGhjzYpYlsciTMrkFzBnT0/L9b+vPhFpHqL8I+4arbPA/VA7JBAAI 90rY0EBA4IVWzhi/sFeMedQl6nmQDTIngXkMEQaY0Oj37HO4R8ZYsb26mFbeuAHx96J4 y7zhO6LzkGVpyy1jZ2qtQPm87fjkAXH0UftLm4GfyWhhYY25eagcEcaCYQs/BTp0RkTa M23mGQ07bHgJKyGieJ8J3MqIl6JkSuhu9YhK/0lP0wL5+n/IsB/4lr9XQEyrVjp2CERF wyiuyYbDcV/Mu9ObX1LMIZLXz082oJZiu+0+LnvgPUQjmIz1yCwua2N67OW3GOpIWDaj 4/rQ== X-Gm-Message-State: AOAM530GkqkUIdDhqexjKHi2obhXUFWrN8S+rFZ7j1xBYortsVEtVNyI cy40MXQXRS4U2RFhBWKwPc12dXosmBlNKehULdgnstSq4kDivIzQqwg9mVq7cawasnUr7dkjSjD VtNE/pM106XhsulTIOaJx7Berrzw= X-Received: by 2002:adf:9bcf:: with SMTP id e15mr3075488wrc.93.1601645987716; 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 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_Mathieu-Daud=C3=A9?= 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 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: 11813589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD546139F for ; Fri, 2 Oct 2020 13:40:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 8F889206E3 for ; Fri, 2 Oct 2020 13:40:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="I7tw93m2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F889206E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.2127.6362 (Exim 4.92) (envelope-from ) id 1kOLHz-0002Be-UF; Fri, 02 Oct 2020 13:39:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 2127.6362; Fri, 02 Oct 2020 13:39:59 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHz-0002BS-PY; Fri, 02 Oct 2020 13:39:59 +0000 Received: by outflank-mailman (input) for mailman id 2127; Fri, 02 Oct 2020 13:39:58 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHy-0002AB-Hy for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:58 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 23309c66-c2e2-446e-8bd4-41bf2412830e; Fri, 02 Oct 2020 13:39:57 +0000 (UTC) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-426-8CPeljkbOza0gEeRdeNhlA-1; Fri, 02 Oct 2020 09:39:55 -0400 Received: by mail-wm1-f69.google.com with SMTP id 13so437872wmf.0 for ; Fri, 02 Oct 2020 06:39:55 -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) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOLHy-0002AB-Hy for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 13:39:58 +0000 X-Inumbo-ID: 23309c66-c2e2-446e-8bd4-41bf2412830e Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 23309c66-c2e2-446e-8bd4-41bf2412830e; Fri, 02 Oct 2020 13:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601645997; 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=I7tw93m2OGcrMYGGWQLAFY0xbZJnomqp+6GXbHzFOIipZtec+FuqDQUVgXrsLshYvZ6r9C LvjkQDUVl9gAR6Fw3k9JNT7UnC5z/lrt/p4EaQsratPdhuE8jU12H2scPyePYlHFBYZOD6 WbXFW7Os8Qn3R2hwv99SAJSbTy0At7E= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-426-8CPeljkbOza0gEeRdeNhlA-1; Fri, 02 Oct 2020 09:39:55 -0400 X-MC-Unique: 8CPeljkbOza0gEeRdeNhlA-1 Received: by mail-wm1-f69.google.com with SMTP id 13so437872wmf.0 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=PwZzHvpZk/1VvvaYlJkBaea/N/LqGBLLcVNb+VY1UKJ+mbca3e1qjISqOKDxAfFlDI PwcCVUpl8gnLu9WYRs6DVfwZdAgvQ+JdE5l7paN85nf0xdx394t5Kh1/VhXGfnkoYPN+ ztnLTmCCCbxrlzOCwDLj8sIBBZSONf5O8X2ufGUcUa97siliXFwvqUAj859cg2kROe2y kX+YdGFQA1ztPkPXLMmcOqIgZhpXeDQX/MSUGHqrBl1qcfHrbh8AFViRse34LqcVM62f 1Gt0lZe4mVgCT0cw4vPF015aR5lAG0kucP4QAtGHXUWJTTxSj1HLcF7gxEGcNhfdiyNL pgHg== X-Gm-Message-State: AOAM5300aRY+Bbj+0og9u66Lf3/SNTuqmnuCFrkN2tKMglBb7WNoAV42 i8TRxzLojydRJ/fbh5psuIsbZw5rVho68zMsKhJdz5oz/qIqdr7XrRGh6C9dFokPHL8ojVLpC49 VGaYsUp6ZYx95/oc+PujAZ5rvoms= X-Received: by 2002:a5d:43cf:: with SMTP id v15mr3203831wrr.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 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_Mathieu-Daud=C3=A9?= 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 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"