accel/kvm/kvm-all.c | 4 ++-- include/system/kvm.h | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-)
kvm_park_vcpu() and kvm_unpark_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 | 4 ++--
include/system/kvm.h | 17 -----------------
2 files changed, 2 insertions(+), 19 deletions(-)
changelog:
unexport kvm_unpark_vcpu() as well and remove unnecessary forward
declarations.
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 890d5ea9f8..f36dfe3349 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -414,7 +414,7 @@ err:
return ret;
}
-void kvm_park_vcpu(CPUState *cpu)
+static void kvm_park_vcpu(CPUState *cpu)
{
struct KVMParkedVcpu *vcpu;
@@ -426,7 +426,7 @@ void kvm_park_vcpu(CPUState *cpu)
QLIST_INSERT_HEAD(&kvm_state->kvm_parked_vcpus, vcpu, node);
}
-int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
+static int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
{
struct KVMParkedVcpu *cpu;
int kvm_fd = -ENOENT;
diff --git a/include/system/kvm.h b/include/system/kvm.h
index 3c7d314736..4fc09e3891 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -317,23 +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
- * @vcpu_id: Architecture vCPU ID of the parked vCPU
- *
- * @returns: KVM fd
- */
-int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id);
-
/**
* kvm_create_and_park_vcpu - Create and park a KVM vCPU
* @cpu: QOM CPUState object for which KVM vCPU has to be created and parked.
--
2.50.1
Queued, thanks. Paolo
On Fri, Aug 15, 2025 at 12:24:45PM +0530, Ani Sinha wrote: > Date: Fri, 15 Aug 2025 12:24:45 +0530 > From: Ani Sinha <anisinha@redhat.com> > Subject: [PATCH v2] kvm/kvm-all: make kvm_park/unpark_vcpu local to > kvm-all.c > X-Mailer: git-send-email 2.50.1 > > kvm_park_vcpu() and kvm_unpark_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 | 4 ++-- > include/system/kvm.h | 17 ----------------- > 2 files changed, 2 insertions(+), 19 deletions(-) > > changelog: > unexport kvm_unpark_vcpu() as well and remove unnecessary forward > declarations. Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
On Fri, 15 Aug 2025 12:24:45 +0530
Ani Sinha <anisinha@redhat.com> wrote:
> kvm_park_vcpu() and kvm_unpark_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>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
> ---
> accel/kvm/kvm-all.c | 4 ++--
> include/system/kvm.h | 17 -----------------
> 2 files changed, 2 insertions(+), 19 deletions(-)
>
> changelog:
> unexport kvm_unpark_vcpu() as well and remove unnecessary forward
> declarations.
>
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 890d5ea9f8..f36dfe3349 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -414,7 +414,7 @@ err:
> return ret;
> }
>
> -void kvm_park_vcpu(CPUState *cpu)
> +static void kvm_park_vcpu(CPUState *cpu)
> {
> struct KVMParkedVcpu *vcpu;
>
> @@ -426,7 +426,7 @@ void kvm_park_vcpu(CPUState *cpu)
> QLIST_INSERT_HEAD(&kvm_state->kvm_parked_vcpus, vcpu, node);
> }
>
> -int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
> +static int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
> {
> struct KVMParkedVcpu *cpu;
> int kvm_fd = -ENOENT;
> diff --git a/include/system/kvm.h b/include/system/kvm.h
> index 3c7d314736..4fc09e3891 100644
> --- a/include/system/kvm.h
> +++ b/include/system/kvm.h
> @@ -317,23 +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
> - * @vcpu_id: Architecture vCPU ID of the parked vCPU
> - *
> - * @returns: KVM fd
> - */
> -int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id);
> -
> /**
> * kvm_create_and_park_vcpu - Create and park a KVM vCPU
> * @cpu: QOM CPUState object for which KVM vCPU has to be created and parked.
On 26/8/25 13:23, Igor Mammedov wrote:
> On Fri, 15 Aug 2025 12:24:45 +0530
> Ani Sinha <anisinha@redhat.com> wrote:
>
>> kvm_park_vcpu() and kvm_unpark_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>
>
> Reviewed-by: Ani Sinha <anisinha@redhat.com>
Do you mean Igor Mammedov <imammedo@redhat.com>?
>
>> ---
>> accel/kvm/kvm-all.c | 4 ++--
>> include/system/kvm.h | 17 -----------------
>> 2 files changed, 2 insertions(+), 19 deletions(-)
>>
>> changelog:
>> unexport kvm_unpark_vcpu() as well and remove unnecessary forward
>> declarations.
>>
>> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
>> index 890d5ea9f8..f36dfe3349 100644
>> --- a/accel/kvm/kvm-all.c
>> +++ b/accel/kvm/kvm-all.c
>> @@ -414,7 +414,7 @@ err:
>> return ret;
>> }
>>
>> -void kvm_park_vcpu(CPUState *cpu)
>> +static void kvm_park_vcpu(CPUState *cpu)
>> {
>> struct KVMParkedVcpu *vcpu;
>>
>> @@ -426,7 +426,7 @@ void kvm_park_vcpu(CPUState *cpu)
>> QLIST_INSERT_HEAD(&kvm_state->kvm_parked_vcpus, vcpu, node);
>> }
>>
>> -int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
>> +static int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
>> {
>> struct KVMParkedVcpu *cpu;
>> int kvm_fd = -ENOENT;
>> diff --git a/include/system/kvm.h b/include/system/kvm.h
>> index 3c7d314736..4fc09e3891 100644
>> --- a/include/system/kvm.h
>> +++ b/include/system/kvm.h
>> @@ -317,23 +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
>> - * @vcpu_id: Architecture vCPU ID of the parked vCPU
>> - *
>> - * @returns: KVM fd
>> - */
>> -int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id);
>> -
>> /**
>> * kvm_create_and_park_vcpu - Create and park a KVM vCPU
>> * @cpu: QOM CPUState object for which KVM vCPU has to be created and parked.
>
>
On Tue, 26 Aug 2025 17:09:27 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> On 26/8/25 13:23, Igor Mammedov wrote:
> > On Fri, 15 Aug 2025 12:24:45 +0530
> > Ani Sinha <anisinha@redhat.com> wrote:
> >
> >> kvm_park_vcpu() and kvm_unpark_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>
> >
> > Reviewed-by: Ani Sinha <anisinha@redhat.com>
>
> Do you mean Igor Mammedov <imammedo@redhat.com>?
sorry for mistake,
I've surely meant myself
>
> >
> >> ---
> >> accel/kvm/kvm-all.c | 4 ++--
> >> include/system/kvm.h | 17 -----------------
> >> 2 files changed, 2 insertions(+), 19 deletions(-)
> >>
> >> changelog:
> >> unexport kvm_unpark_vcpu() as well and remove unnecessary forward
> >> declarations.
> >>
> >> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> >> index 890d5ea9f8..f36dfe3349 100644
> >> --- a/accel/kvm/kvm-all.c
> >> +++ b/accel/kvm/kvm-all.c
> >> @@ -414,7 +414,7 @@ err:
> >> return ret;
> >> }
> >>
> >> -void kvm_park_vcpu(CPUState *cpu)
> >> +static void kvm_park_vcpu(CPUState *cpu)
> >> {
> >> struct KVMParkedVcpu *vcpu;
> >>
> >> @@ -426,7 +426,7 @@ void kvm_park_vcpu(CPUState *cpu)
> >> QLIST_INSERT_HEAD(&kvm_state->kvm_parked_vcpus, vcpu, node);
> >> }
> >>
> >> -int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
> >> +static int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
> >> {
> >> struct KVMParkedVcpu *cpu;
> >> int kvm_fd = -ENOENT;
> >> diff --git a/include/system/kvm.h b/include/system/kvm.h
> >> index 3c7d314736..4fc09e3891 100644
> >> --- a/include/system/kvm.h
> >> +++ b/include/system/kvm.h
> >> @@ -317,23 +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
> >> - * @vcpu_id: Architecture vCPU ID of the parked vCPU
> >> - *
> >> - * @returns: KVM fd
> >> - */
> >> -int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id);
> >> -
> >> /**
> >> * kvm_create_and_park_vcpu - Create and park a KVM vCPU
> >> * @cpu: QOM CPUState object for which KVM vCPU has to be created and parked.
> >
> >
>
Igor Mammedov <imammedo@redhat.com> writes: > On Fri, 15 Aug 2025 12:24:45 +0530 > Ani Sinha <anisinha@redhat.com> wrote: > >> kvm_park_vcpu() and kvm_unpark_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> > > Reviewed-by: Ani Sinha <anisinha@redhat.com> ? I assume you meant reviewed by Igor but I'm not sure what b4 will do now. -- Alex Bennée Virtualisation Tech Lead @ Linaro
© 2016 - 2025 Red Hat, Inc.