[PATCH v1 1/5] qemuBuildMemoryDeviceProps: Fix const correctness

Michal Privoznik mprivozn at redhat.com
Wed Jan 19 13:32:14 UTC 2022


The @mem agrument of qemuBuildMemoryDeviceProps() function is
only read from. Make this fact obvious from the function
declaration too.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_command.c | 2 +-
 src/qemu/qemu_command.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index bca867a492..fb87649e65 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4002,7 +4002,7 @@ qemuBuildMemoryDimmBackendStr(virCommand *cmd,
 
 virJSONValue *
 qemuBuildMemoryDeviceProps(const virDomainDef *def,
-                           virDomainMemoryDef *mem)
+                           const virDomainMemoryDef *mem)
 {
     g_autoptr(virJSONValue) props = NULL;
     const char *device = NULL;
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index dbdf3a4793..dd981e333f 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -154,7 +154,7 @@ int qemuBuildMemoryBackendProps(virJSONValue **backendProps,
 
 virJSONValue *
 qemuBuildMemoryDeviceProps(const virDomainDef *def,
-                           virDomainMemoryDef *mem);
+                           const virDomainMemoryDef *mem);
 
 /* Current, best practice */
 virJSONValue *
-- 
2.34.1




More information about the libvir-list mailing list