aboutsummaryrefslogtreecommitdiff
path: root/hw/arm
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2023-07-18 11:10:57 +0100
committerAnthony PERARD <anthony.perard@citrix.com>2023-08-01 10:22:33 +0100
commitbcb40db010517120dfffccc77cef9e4fcd3235fa (patch)
tree3bf6126fd98bab4626d7cb814dc3ba5e74c7f525 /hw/arm
parentf4f71363fcdb1092ff64d2bba6f9af39570c2f2b (diff)
downloadqemu-bcb40db010517120dfffccc77cef9e4fcd3235fa.zip
qemu-bcb40db010517120dfffccc77cef9e4fcd3235fa.tar.gz
qemu-bcb40db010517120dfffccc77cef9e4fcd3235fa.tar.bz2
xen: Don't pass MemoryListener around by value
Coverity points out (CID 1513106, 1513107) that MemoryListener is a 192 byte struct which we are passing around by value. Switch to passing a const pointer into xen_register_ioreq() and then to xen_do_ioreq_register(). We can also make the file-scope MemoryListener variables const, since nothing changes them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230718101057.1110979-1-peter.maydell@linaro.org> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Diffstat (limited to 'hw/arm')
-rw-r--r--hw/arm/xen_arm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 044093f..1d3e6d4 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -37,7 +37,7 @@
#define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh")
OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM)
-static MemoryListener xen_memory_listener = {
+static const MemoryListener xen_memory_listener = {
.region_add = xen_region_add,
.region_del = xen_region_del,
.log_start = NULL,
@@ -108,7 +108,7 @@ static void xen_arm_init(MachineState *machine)
xam->state = g_new0(XenIOState, 1);
- xen_register_ioreq(xam->state, machine->smp.cpus, xen_memory_listener);
+ xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
#ifdef CONFIG_TPM
if (xam->cfg.tpm_base_addr) {