Skip to content

vl.c: make current_machine as non-global variable

Like Xu qemu-devel qemu-trivial 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 12 repliesIn review
  2. v21 patch 10 repliesSuperseded
  3. v11 patch 1 replySuperseded

Changes in v3 from the cover letter

- add TYPE_MACHINE assertion for qdev_get_machine() usage
- apply qdev_get_machine_uncheck() for obj-common usage

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2vl.c: refactor current_machine as non-global variableaccel/kvm/kvm-all.c device-hotplug.c device_tree.c +8 more+28 -163 replies
2/2core/qdev: refactor qdev_get_machine() with type assertionhw/core/qdev.c include/hw/qdev-core.h qom/cpu.c+17 -59 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchEduardo Habkost
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Qemu-devel] [PATCH v3 0/2] vl.c: make current_machine as non-global variable

This patch makes the remaining dozen or so uses of the global current_machine outside vl.c use qdev_get_machine() instead, and then make current_machine local to vl.c instead of global.

With type assertion in qdev_get_machine(), it will be hard to misuse this function if machine hasn't been created yet. For obj-common cases, qdev_get_machine_uncheck() is applied without semantic change.

---
Changes in v3:
- add TYPE_MACHINE assertion for qdev_get_machine() usage
- apply qdev_get_machine_uncheck() for obj-common usage
Changes in v2:
- make the variable current_machine "static" (Thomas Huth)

Like Xu (2):
vl.c: refactor current_machine as non-global variable core/qdev: refactor qdev_get_machine() with type assertion

 accel/kvm/kvm-all.c    |  6 ++++--
 device-hotplug.c       |  3 ++-
 device_tree.c          |  3 ++-
 exec.c                 |  6 ++++--
 hw/core/qdev.c         | 16 +++++++++++++---
 hw/ppc/spapr_rtas.c    |  3 ++-
 include/hw/boards.h    |  1 -
 include/hw/qdev-core.h |  1 +
 migration/savevm.c     |  9 ++++++---
 qmp.c                  |  3 ++-
 qom/cpu.c              |  5 +++--
 target/i386/kvm.c      |  3 ++-
 target/ppc/kvm.c       |  3 ++-
 vl.c                   |  4 ++--
 14 files changed, 45 insertions(+), 21 deletions(-)
Signature · 1 line
1.8.3.1