qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 59/63] kvm: Rename KVM_STATE to KVM_ACCEL


From: Eduardo Habkost
Subject: [PATCH 59/63] kvm: Rename KVM_STATE to KVM_ACCEL
Date: Wed, 2 Sep 2020 18:43:07 -0400

Make the type checking macro name consistent with the TYPE_*
constant.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: kvm@vger.kernel.org
Cc: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org
Cc: qemu-ppc@nongnu.org
---
 include/sysemu/kvm.h |  2 +-
 accel/kvm/kvm-all.c  | 18 +++++++++---------
 target/arm/kvm.c     |  2 +-
 target/i386/kvm.c    |  2 +-
 target/mips/kvm.c    |  2 +-
 target/ppc/kvm.c     |  4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 5bbea53883..89c422e1e7 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -204,7 +204,7 @@ struct KVMState;
 
 #define TYPE_KVM_ACCEL ACCEL_CLASS_NAME("kvm")
 typedef struct KVMState KVMState;
-DECLARE_INSTANCE_CHECKER(KVMState, KVM_STATE,
+DECLARE_INSTANCE_CHECKER(KVMState, KVM_ACCEL,
                          TYPE_KVM_ACCEL)
 
 extern KVMState *kvm_state;
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 63ef6af9a1..bdf63ca3a3 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -214,7 +214,7 @@ void kvm_resample_fd_notify(int gsi)
 
 int kvm_get_max_memslots(void)
 {
-    KVMState *s = KVM_STATE(current_accel());
+    KVMState *s = KVM_ACCEL(current_accel());
 
     return s->nr_slots;
 }
@@ -256,7 +256,7 @@ static KVMSlot *kvm_get_free_slot(KVMMemoryListener *kml)
 
 bool kvm_has_free_slot(MachineState *ms)
 {
-    KVMState *s = KVM_STATE(ms->accelerator);
+    KVMState *s = KVM_ACCEL(ms->accelerator);
     bool result;
     KVMMemoryListener *kml = &s->memory_listener;
 
@@ -1970,7 +1970,7 @@ static int kvm_max_vcpu_id(KVMState *s)
 
 bool kvm_vcpu_id_is_valid(int vcpu_id)
 {
-    KVMState *s = KVM_STATE(current_accel());
+    KVMState *s = KVM_ACCEL(current_accel());
     return vcpu_id >= 0 && vcpu_id < kvm_max_vcpu_id(s);
 }
 
@@ -1996,7 +1996,7 @@ static int kvm_init(MachineState *ms)
     const char *kvm_type;
     uint64_t dirty_log_manual_caps;
 
-    s = KVM_STATE(ms->accelerator);
+    s = KVM_ACCEL(ms->accelerator);
 
     /*
      * On systems where the kernel can support different base page
@@ -3084,7 +3084,7 @@ int kvm_get_one_reg(CPUState *cs, uint64_t id, void 
*target)
 static bool kvm_accel_has_memory(MachineState *ms, AddressSpace *as,
                                  hwaddr start_addr, hwaddr size)
 {
-    KVMState *kvm = KVM_STATE(ms->accelerator);
+    KVMState *kvm = KVM_ACCEL(ms->accelerator);
     int i;
 
     for (i = 0; i < kvm->nr_as; ++i) {
@@ -3102,7 +3102,7 @@ static void kvm_get_kvm_shadow_mem(Object *obj, Visitor 
*v,
                                    const char *name, void *opaque,
                                    Error **errp)
 {
-    KVMState *s = KVM_STATE(obj);
+    KVMState *s = KVM_ACCEL(obj);
     int64_t value = s->kvm_shadow_mem;
 
     visit_type_int(v, name, &value, errp);
@@ -3112,7 +3112,7 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Visitor 
*v,
                                    const char *name, void *opaque,
                                    Error **errp)
 {
-    KVMState *s = KVM_STATE(obj);
+    KVMState *s = KVM_ACCEL(obj);
     int64_t value;
 
     if (!visit_type_int(v, name, &value, errp)) {
@@ -3126,7 +3126,7 @@ static void kvm_set_kernel_irqchip(Object *obj, Visitor 
*v,
                                    const char *name, void *opaque,
                                    Error **errp)
 {
-    KVMState *s = KVM_STATE(obj);
+    KVMState *s = KVM_ACCEL(obj);
     OnOffSplit mode;
 
     if (!visit_type_OnOffSplit(v, name, &mode, errp)) {
@@ -3173,7 +3173,7 @@ bool kvm_kernel_irqchip_split(void)
 
 static void kvm_accel_instance_init(Object *obj)
 {
-    KVMState *s = KVM_STATE(obj);
+    KVMState *s = KVM_ACCEL(obj);
 
     s->kvm_shadow_mem = -1;
     s->kernel_irqchip_allowed = true;
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 8bb7318378..55583075f3 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -216,7 +216,7 @@ bool kvm_arm_pmu_supported(void)
 
 int kvm_arm_get_max_vm_ipa_size(MachineState *ms)
 {
-    KVMState *s = KVM_STATE(ms->accelerator);
+    KVMState *s = KVM_ACCEL(ms->accelerator);
     int ret;
 
     ret = kvm_check_extension(s, KVM_CAP_ARM_VM_IPA_SIZE);
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 205b68bc0c..2949c5f048 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -155,7 +155,7 @@ bool kvm_allows_irq0_override(void)
 
 static bool kvm_x2apic_api_set_flags(uint64_t flags)
 {
-    KVMState *s = KVM_STATE(current_accel());
+    KVMState *s = KVM_ACCEL(current_accel());
 
     return !kvm_vm_enable_cap(s, KVM_CAP_X2APIC_API, 0, flags);
 }
diff --git a/target/mips/kvm.c b/target/mips/kvm.c
index 72637a1e02..30f9c0349a 100644
--- a/target/mips/kvm.c
+++ b/target/mips/kvm.c
@@ -1277,7 +1277,7 @@ int mips_kvm_type(MachineState *machine, const char 
*vm_type)
 {
 #if defined(KVM_CAP_MIPS_VZ) || defined(KVM_CAP_MIPS_TE)
     int r;
-    KVMState *s = KVM_STATE(machine->accelerator);
+    KVMState *s = KVM_ACCEL(machine->accelerator);
 #endif
 
 #if defined(KVM_CAP_MIPS_VZ)
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index d85ba8ffe0..e446637137 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -263,7 +263,7 @@ static void kvm_get_smmu_info(struct kvm_ppc_smmu_info 
*info, Error **errp)
 
 struct ppc_radix_page_info *kvm_get_radix_page_info(void)
 {
-    KVMState *s = KVM_STATE(current_accel());
+    KVMState *s = KVM_ACCEL(current_accel());
     struct ppc_radix_page_info *radix_page_info;
     struct kvm_ppc_rmmu_info rmmu_info;
     int i;
@@ -2943,7 +2943,7 @@ void kvmppc_svm_off(Error **errp)
         return;
     }
 
-    rc = kvm_vm_ioctl(KVM_STATE(current_accel()), KVM_PPC_SVM_OFF);
+    rc = kvm_vm_ioctl(KVM_ACCEL(current_accel()), KVM_PPC_SVM_OFF);
     if (rc && rc != -ENOTTY) {
         error_setg_errno(errp, -rc, "KVM_PPC_SVM_OFF ioctl failed");
     }
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]