From nobody Mon Feb 9 08:11:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601645991; cv=none; d=zohomail.com; s=zohoarc; b=Y8v1hmbOr2Ds4B+GkNXaCVXBS8YBJkn05drRdWagkXq7Ke+v0pVw0twFl6FfNR3PvuHo3f8gO6TMKHkLJwYNFfNdbD4msZfvvrj/ckJe79J2dr3gB/IuXEeHyLT8BTrB3daWm7KVsBGWF0fylJFDmrLA2htxjo/YouujFXPljEM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601645991; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=l++0FncV4p/balcOSro5u4OfFvevG6nmzhJ8fBAOs6w=; b=fb4764CDUzxNiXUJzvA6/1NEsCw10v3KNid7C5xgcRqkrLxVjdUFbPdGKNKOuymOtqhhZga5u0m24XCGQQrNWecf+QdFt2jRCkKFQ9UIE4ewZZXm7Q4pJlLyDJ0CPiKqMhgp5VXn2qIhqUmYEk06+inlowjUu7FrMa5883rDnLQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601645991898485.9130599992495; Fri, 2 Oct 2020 06:39:51 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-cHdHvFR3MSSYTliAzDBXQg-1; Fri, 02 Oct 2020 09:39:44 -0400 Received: by mail-wm1-f70.google.com with SMTP id y6so539245wmi.7 for ; Fri, 02 Oct 2020 06:39:43 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id 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) 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=l++0FncV4p/balcOSro5u4OfFvevG6nmzhJ8fBAOs6w=; b=T0u8BqO43ZW0AEHIF4fqgz6L60dSYBZrl0wQxNuP73yGwfft0V1U/OJyg4XOo/p3hydeY1 hJ+/+/3/a9XaBnEcwFXaGB8CSG3IOmgdawmWlFBA7NHp0fsYrOeEK++dG29yiYPJEgHBYj BIZUHtKNF7TV1Fh3dAINk6oBfbcD6AM= X-MC-Unique: cHdHvFR3MSSYTliAzDBXQg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l++0FncV4p/balcOSro5u4OfFvevG6nmzhJ8fBAOs6w=; b=Rm4AkY3u66BXn4uAPY/xKkT929zQ4Rwo82AHwMVtApF5VQKpAldpWE3dfGQGs0kmnv LmVmJnUU386xSl2i3YwRDnnUDN7ntmmgUtFCUcV/fCvgN8kGQpOIoqhcBVLthvmC1LPa iZeZMRMTe9NYBmsh/6juS6avWIa/XUHruae31UfBUovtSdrpO/PsU464b7PoRkTzKTzF WcC3yn0kY2pEYx01/jkOPN1IWWvDZw9oF3cOn+nOCaiFvLE2dJMoC/pTIFKYRdKmFUWh Ph8bLJIc33kEILTf4BF2shhCzYOkvGoY9xStutErb9lXINE547hbxvsGDy3eTly+Vqry hShA== X-Gm-Message-State: AOAM533nlfhrSu+ScIh1CMGsDgyoVSLPBCeS+q3scjnbT4HopDXp26Ab 9oAv2c7/JYENZ+ieUPVcagTUubNWEqHwbncuytTAWDihufsMcvimQFTQY/NhFjDtMkHhjlf3WIl 31G5QwhCej/JbUw== X-Received: by 2002:a1c:9a0c:: with SMTP id c12mr3069206wme.85.1601645982657; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Marcel Apfelbaum , "Dr. David Alan Gilbert" , xen-devel@lists.xenproject.org, Gerd Hoffmann , Markus Armbruster , Paolo Bonzini , Juan Quintela , Stefano Stabellini , Anthony Perard , Eric Blake , Paul Durrant , Peter Maydell , "Michael S. Tsirkin" , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @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=C3=A9 --- 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' ] } =20 +## +# @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' } =20 -## -# @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: # --=20 2.26.2