qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm/kvm-all: declare kvm_park_vcpu static and make it local to kvm-all.c
@ 2025-08-15  5:30 Ani Sinha
  2025-08-15  6:24 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Ani Sinha @ 2025-08-15  5:30 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Ani Sinha, kvm, qemu-devel

kvm_park_vcpu() is only used in kvm-all.c. Declare it static, remove it from
common header file and make it local to kvm-all.c

Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
 accel/kvm/kvm-all.c  | 3 ++-
 include/system/kvm.h | 8 --------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 890d5ea9f8..41cf606ca8 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -141,6 +141,7 @@ static QemuMutex kml_slots_lock;
 #define kvm_slots_unlock()  qemu_mutex_unlock(&kml_slots_lock)
 
 static void kvm_slot_init_dirty_bitmap(KVMSlot *mem);
+static void kvm_park_vcpu(CPUState *cpu);
 
 static inline void kvm_resample_fd_remove(int gsi)
 {
@@ -414,7 +415,7 @@ err:
     return ret;
 }
 
-void kvm_park_vcpu(CPUState *cpu)
+static void kvm_park_vcpu(CPUState *cpu)
 {
     struct KVMParkedVcpu *vcpu;
 
diff --git a/include/system/kvm.h b/include/system/kvm.h
index 3c7d314736..c7fd7533bb 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -317,14 +317,6 @@ int kvm_create_device(KVMState *s, uint64_t type, bool test);
  */
 bool kvm_device_supported(int vmfd, uint64_t type);
 
-/**
- * kvm_park_vcpu - Park QEMU KVM vCPU context
- * @cpu: QOM CPUState object for which QEMU KVM vCPU context has to be parked.
- *
- * @returns: none
- */
-void kvm_park_vcpu(CPUState *cpu);
-
 /**
  * kvm_unpark_vcpu - unpark QEMU KVM vCPU context
  * @s: KVM State
-- 
2.50.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kvm/kvm-all: declare kvm_park_vcpu static and make it local to kvm-all.c
  2025-08-15  5:30 [PATCH] kvm/kvm-all: declare kvm_park_vcpu static and make it local to kvm-all.c Ani Sinha
@ 2025-08-15  6:24 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2025-08-15  6:24 UTC (permalink / raw)
  To: Ani Sinha, Paolo Bonzini; +Cc: kvm, qemu-devel

On 8/15/25 15:30, Ani Sinha wrote:
> kvm_park_vcpu() is only used in kvm-all.c. Declare it static, remove it from
> common header file and make it local to kvm-all.c
> 
> Signed-off-by: Ani Sinha <anisinha@redhat.com>
> ---
>   accel/kvm/kvm-all.c  | 3 ++-
>   include/system/kvm.h | 8 --------
>   2 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 890d5ea9f8..41cf606ca8 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -141,6 +141,7 @@ static QemuMutex kml_slots_lock;
>   #define kvm_slots_unlock()  qemu_mutex_unlock(&kml_slots_lock)
>   
>   static void kvm_slot_init_dirty_bitmap(KVMSlot *mem);
> +static void kvm_park_vcpu(CPUState *cpu);
>   

No need for this, since the definition precedes all uses.
You can also unexport kvm_unpark_vcpu.


r~


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-15  6:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15  5:30 [PATCH] kvm/kvm-all: declare kvm_park_vcpu static and make it local to kvm-all.c Ani Sinha
2025-08-15  6:24 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).