diff mbox series

[1/7] qemu/thread: Constify qemu_thread_get_affinity() 'thread' argument

Message ID 20250120061310.81368-2-philmd@linaro.org (mailing list archive)
State New
Headers show
Series cpus: Constify some CPUState arguments | expand

Commit Message

Philippe Mathieu-Daudé Jan. 20, 2025, 6:13 a.m. UTC
QemuThread structure is not modified, only read.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/qemu/thread.h    | 4 ++--
 util/qemu-thread-posix.c | 4 ++--
 util/qemu-thread-win32.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/include/qemu/thread.h b/include/qemu/thread.h
index 7eba27a7049..d4f44241ef0 100644
--- a/include/qemu/thread.h
+++ b/include/qemu/thread.h
@@ -191,8 +191,8 @@  void qemu_thread_create(QemuThread *thread, const char *name,
                         void *arg, int mode);
 int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus,
                              unsigned long nbits);
-int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus,
-                             unsigned long *nbits);
+int qemu_thread_get_affinity(const QemuThread *thread,
+                             unsigned long **host_cpus, unsigned long *nbits);
 void *qemu_thread_join(QemuThread *thread);
 void qemu_thread_get_self(QemuThread *thread);
 bool qemu_thread_is_self(QemuThread *thread);
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index 6fff4162ac6..0fc3003ec46 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -617,8 +617,8 @@  int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus,
 #endif
 }
 
-int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus,
-                             unsigned long *nbits)
+int qemu_thread_get_affinity(const QemuThread *thread,
+                             unsigned long **host_cpus, unsigned long *nbits)
 {
 #if defined(CONFIG_PTHREAD_AFFINITY_NP)
     unsigned long tmpbits;
diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
index a7fe3cc345f..0d512c0188e 100644
--- a/util/qemu-thread-win32.c
+++ b/util/qemu-thread-win32.c
@@ -513,8 +513,8 @@  int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus,
     return -ENOSYS;
 }
 
-int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus,
-                             unsigned long *nbits)
+int qemu_thread_get_affinity(const QemuThread *thread,
+                             unsigned long **host_cpus, unsigned long *nbits)
 {
     return -ENOSYS;
 }