qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 16/17] plugins: add plugin API to read guest memory


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 16/17] plugins: add plugin API to read guest memory
Date: Fri, 13 Sep 2024 22:17:24 +0200
User-agent: Mozilla Thunderbird

On 13/9/24 19:26, Alex Bennée wrote:
From: Rowan Hart <rowanbhart@gmail.com>

Signed-off-by: Rowan Hart <rowanbhart@gmail.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20240827215329.248434-2-rowanbhart@gmail.com>
[AJB: tweaked cpu_memory_rw_debug call]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
vAJB:
   - explicit bool for cpu_memory_rw_debug
---
  include/qemu/qemu-plugin.h   | 32 +++++++++++++++++++++++++++++++-
  plugins/api.c                | 20 ++++++++++++++++++++
  plugins/qemu-plugins.symbols |  1 +
  3 files changed, 52 insertions(+), 1 deletion(-)


+/**
+ * qemu_plugin_read_memory_vaddr() - read from memory using a virtual address
+ *
+ * @addr: A virtual address to read from
+ * @data: A byte array to store data into
+ * @len: The number of bytes to read, starting from @addr
+ *
+ * @len bytes of data is read starting at @addr and stored into @data. If @data
+ * is not large enough to hold @len bytes, it will be expanded to the necessary
+ * size, reallocating if necessary. @len must be greater than 0.
+ *
+ * This function does not ensure writes are flushed prior to reading, so
+ * callers should take care when calling this function in plugin callbacks to
+ * avoid attempting to read data which may not yet be written and should use
+ * the memory callback API instead.
+ *
+ * Returns true on success and false on failure.
+ */
+QEMU_PLUGIN_API
+bool qemu_plugin_read_memory_vaddr(uint64_t addr,
+                                          GByteArray *data, size_t len);


Align is a bit off.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]