Replace current_machine by qdev_get_machine()
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest15 patches 26 repliesIn review
Patches in v1 No applies recorded yet
Reviews trailers per patch
14 of 15 patches have a Reviewed-by or Acked-by.
| Patch | Dr. David Alan Gilbert | Greg Kurz | Alistair Francis | David Gibson | Juan Quintela |
|---|---|---|---|---|---|
| 1/15 | R-b | ||||
| 2/15 | R-b | A-b | |||
| 3/15 | R-b | A-b | |||
| 4/15 | |||||
| 5/15 | R-b | ||||
| 6/15 | A-b | R-b | R-b | ||
| 7/15 | R-b | ||||
| 8/15 | R-b | ||||
| 9/15 | R-b | ||||
| 10/15 | R-b | ||||
| 11/15 | R-b | ||||
| 12/15 | R-b | ||||
| 13/15 | R-b | ||||
| 14/15 | R-b | ||||
| 15/15 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [PATCH 00/15] Replace current_machine by qdev_get_machine()
Blurb from previous question [1]:
"hw/boards.h" declare current_machine, and vl.c defines it:
current_machine = MACHINE(object_new_with_class(OBJECT_CLASS(machine_class)));
object_property_add_child(object_get_root(), "machine",
OBJECT(current_machine), &error_abort); The bigger user of 'current_machine' is the accel/KVM code.
Recently in a0628599f..cc7d44c2e0 "Replace global smp variables with machine smp properties" we started to use MACHINE(qdev_get_machine()). Following a0628599f..cc7d44c2e0, a5e0b33119 use 'current_machine' again.
qdev_get_machine() resolves the machine in the QOM composition tree.
Paolo answered [2]:
Quoted 3 lines
I would always use MACHINE(qdev_get_machine()), espeecially outside
vl.c. Ideally,current_machinewould be static withinvl.cor even unused outside theobject_property_add_child()that you quote above.
Let's remove the global current_machine.
I am still confused by this comment:
/* qdev_get_machine() can return something that's not TYPE_MACHINE
* if this is one of the user-only emulators; in that case there's
* no need to check the ignore_memory_transaction_failures board flag. */
[1] https://www.mail-archive.com/[email protected]/msg669475.html
[2] https://www.mail-archive.com/[email protected]/msg669493.html
Philippe Mathieu-Daudé (15):
target/arm/kvm: Use CPUState::kvm_state in kvm_arm_pmu_supported() hw/ppc/spapr_rtas: Use local MachineState variable hw/ppc/spapr_rtas: Access MachineState via SpaprMachineState argument hw/ppc/spapr_rtas: Restrict variables scope to single switch case
device-hotplug: Replace current_machine by qdev_get_machine() migration/savevm: Replace current_machine by qdev_get_machine() hw/core/machine-qmp-cmds: Replace current_machine by
qdev_get_machine()
target/arm/monitor: Replace current_machine by qdev_get_machine()
device_tree: Replace current_machine by qdev_get_machine()
memory: Replace current_machine by qdev_get_machine()
exec: Replace current_machine by qdev_get_machine()
accel: Introduce the current_accel() method
accel: Replace current_machine->accelerator by current_accel() method accel/accel: Replace current_machine by qdev_get_machine()
vl: Make current_machine a local variable
include/hw/boards.h | 2 -- include/sysemu/accel.h | 2 ++ accel/accel.c | 7 +++++++ accel/kvm/kvm-all.c | 4 ++-- accel/tcg/tcg-all.c | 2 +- device-hotplug.c | 2 +- device_tree.c | 4 +++- exec.c | 10 ++++++---- hw/core/machine-qmp-cmds.c | 4 ++-- hw/ppc/spapr_rtas.c | 6 +++--- memory.c | 6 ++++-- migration/savevm.c | 10 +++++----- target/arm/kvm.c | 4 +--- target/arm/kvm64.c | 4 ++-- target/arm/monitor.c | 3 ++- target/i386/kvm.c | 2 +- target/ppc/kvm.c | 2 +- vl.c | 6 +++--- 18 files changed, 46 insertions(+), 34 deletions(-)
Signature · 1 line
2.21.1