From nobody Mon Feb 9 07:22:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1602504956; cv=none; d=zohomail.com; s=zohoarc; b=Q7GTgIIw4+o6pYtU+hkjzi8TV1DBmevc6UD1vl58bzIgd79WBodCOHpfrjiyQvAKANsHsy/r49pnZe7PXKGwoSVWDewBVhGwQxqUjEjG7HdUq6YFTX2gv5LVSSTpGAbGiR1UgYv+d21XjeV+Kl8Kjd0mUi3ZB3ntl+HZ1o6gz8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602504956; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=PgJl3lyw3zlJ4rwBHSsLrJq7aR281tmH8GHtlDsXSws=; b=c+HRLWwNd1ZzL5S7yYPRycs3iQl+MCd1kZoJcMtLaKhsZrPRl7Nv1sPy9MsGDz8pMpgWBMScQPhIU5VaOEQjkEdFNCz51CV6xTkb9indyUrxFIpCef+TctXNyn2jL4+dcTla+LZJDS9acc6PkZSmvGfo17Hj1NG9T/Vk/aCv4dM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1602504956868694.8865690588282; Mon, 12 Oct 2020 05:15:56 -0700 (PDT) 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-145-CBkCsRHlNM6C4VznvUO9Cg-1; Mon, 12 Oct 2020 08:15:54 -0400 Received: by mail-wr1-f72.google.com with SMTP id t17so9256231wrm.13 for ; Mon, 12 Oct 2020 05:15:54 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id w1sm25023393wrp.95.2020.10.12.05.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 05:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602504955; 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=PgJl3lyw3zlJ4rwBHSsLrJq7aR281tmH8GHtlDsXSws=; b=A/Ai0aBDVusjZBPcrleFOQNWHfTHShl+mO74S2utxXK9LA4s4zkteSD8R1QQdkWSK3JYxf amJO0OsivwT/3f1DrFT07rKNVjCyltNTfLockG4Rw9kBQ9I0De8CuFgaf5tmT+VYYkiH7r lfhIo2kV9/eCdtRaamMP/h1DFWOo1wU= X-MC-Unique: CBkCsRHlNM6C4VznvUO9Cg-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=PgJl3lyw3zlJ4rwBHSsLrJq7aR281tmH8GHtlDsXSws=; b=sEKp41wkFLDh+u5bEuJJc3DBoAjOO4myVnjrNFG0m4i/MDZHqU0pj1h73tqgCOtdeX BfqtlRyKNAaxILMTwbBApEvZmPvwBeI6MwZNlOvqWsAnOKT8fzU84IGS9DngHaz6WsxX bf8GgAgcDor9lGnsEYufd3hJgja0FUDareqSF00ot4AIvKUR56dgBa3TkV2S/dlTFtzS rtaq9uN3g3mQx6T30WajFbpW3nP9hlx8QSLArisLGP3pyDVmQuKINMPc6RijZnGGqkAC yl3HlO0R20C88PvS0dnduaLmnmBaslhKh7PZo8ni4LWDZCK0gNw8oOuNT0bzi/D7iYHJ YxUQ== X-Gm-Message-State: AOAM531qZcI3uT47jZvOPGgeHBbnoy52xF+rfVp0R2Xv0ektBbKeu5oO I4afVFE2FE5BSlK0LHLuy0YGijWCJhPYHp6JMgROAu7rYyqQYdAwI7CFN0Isxz/TbldNXkA/com AenmzwBaK7tge+g== X-Received: by 2002:a5d:40cb:: with SMTP id b11mr27530570wrq.254.1602504953124; Mon, 12 Oct 2020 05:15:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPXKJoRuNkuaLK5MItsZ/rjhub7YYwh4l98TVQ1DKvOc5WgBpacVjym95pHEXhqN3TaHPhTA== X-Received: by 2002:a5d:40cb:: with SMTP id b11mr27530544wrq.254.1602504952929; Mon, 12 Oct 2020 05:15:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Marcel Apfelbaum , Eduardo Habkost Cc: Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v2 3/5] qapi: Restrict '(p)memsave' command to machine code Date: Mon, 12 Oct 2020 14:15:34 +0200 Message-Id: <20201012121536.3381997-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201012121536.3381997-1-philmd@redhat.com> References: <20201012121536.3381997-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. Acked-by: Paolo Bonzini 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 55328d4f3ca..5a3bbcae01b 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 90fd862a6cb..9fa702b0f66 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