[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/59] accel: Introduce the current_accel() wrapper
From: |
Paolo Bonzini |
Subject: |
[PULL 28/59] accel: Introduce the current_accel() wrapper |
Date: |
Thu, 23 Jan 2020 14:50:18 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
The accel/ code only accesses the MachineState::accel field.
As we simply want to access the accelerator, not the machine,
add a current_accel() wrapper.
Suggested-by: Paolo Bonzini <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
accel/accel.c | 5 +++++
include/sysemu/accel.h | 2 ++
2 files changed, 7 insertions(+)
diff --git a/accel/accel.c b/accel/accel.c
index 1c5c3a6..cb555e3 100644
--- a/accel/accel.c
+++ b/accel/accel.c
@@ -63,6 +63,11 @@ int accel_init_machine(AccelState *accel, MachineState *ms)
return ret;
}
+AccelState *current_accel(void)
+{
+ return current_machine->accelerator;
+}
+
void accel_setup_post(MachineState *ms)
{
AccelState *accel = ms->accelerator;
diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h
index d4c1429..47e5788 100644
--- a/include/sysemu/accel.h
+++ b/include/sysemu/accel.h
@@ -70,4 +70,6 @@ int accel_init_machine(AccelState *accel, MachineState *ms);
/* Called just before os_setup_post (ie just before drop OS privs) */
void accel_setup_post(MachineState *ms);
+AccelState *current_accel(void);
+
#endif
--
1.8.3.1
- [PULL 19/59] target/i386: add a ucode-rev property, (continued)
- [PULL 19/59] target/i386: add a ucode-rev property, Paolo Bonzini, 2020/01/23
- [PULL 18/59] target/i386: kvm: initialize feature MSRs very early, Paolo Bonzini, 2020/01/23
- [PULL 20/59] target/i386: kvm: initialize microcode revision from KVM, Paolo Bonzini, 2020/01/23
- [PULL 21/59] virtio-scsi: delete vqs in unrealize to avoid memleaks, Paolo Bonzini, 2020/01/23
- [PULL 22/59] virtio-scsi: convert to new virtio_delete_queue, Paolo Bonzini, 2020/01/23
- [PULL 23/59] hw/ppc/spapr_rtas: Use local MachineState variable, Paolo Bonzini, 2020/01/23
- [PULL 24/59] hw/ppc/spapr_rtas: Access MachineState via SpaprMachineState argument, Paolo Bonzini, 2020/01/23
- [PULL 25/59] hw/ppc/spapr_rtas: Remove local variable, Paolo Bonzini, 2020/01/23
- [PULL 26/59] target/arm/kvm: Use CPUState::kvm_state in kvm_arm_pmu_supported(), Paolo Bonzini, 2020/01/23
- [PULL 27/59] qom/object: Display more helpful message when a parent is missing, Paolo Bonzini, 2020/01/23
- [PULL 28/59] accel: Introduce the current_accel() wrapper,
Paolo Bonzini <=
- [PULL 29/59] accel: Replace current_machine->accelerator by current_accel() wrapper, Paolo Bonzini, 2020/01/23
- [PULL 30/59] accel/tcg: Sanitize include path, Paolo Bonzini, 2020/01/23
- [PULL 31/59] object: add extra sanity checks, Paolo Bonzini, 2020/01/23
- [PULL 32/59] qdev: remove duplicated qdev_property_add_static() doc, Paolo Bonzini, 2020/01/23
- [PULL 33/59] qdev: remove extraneous error, Paolo Bonzini, 2020/01/23
- [PULL 34/59] qdev: move helper function to monitor/misc, Paolo Bonzini, 2020/01/23
- [PULL 35/59] object: avoid extra class property key duplication, Paolo Bonzini, 2020/01/23
- [PULL 36/59] object: add class property initializer, Paolo Bonzini, 2020/01/23
- [PULL 37/59] object: make object_class_property_add* return property, Paolo Bonzini, 2020/01/23
- [PULL 38/59] qstring: add qstring_free(), Paolo Bonzini, 2020/01/23