All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/2] vl.c: make current_machine as non-global variable
@ 2019-04-15  7:59 ` Like Xu
  0 siblings, 0 replies; 25+ messages in thread
From: Like Xu @ 2019-04-15  7:59 UTC (permalink / raw)
  To: qemu-trivial
  Cc: Igor Mammedov, Peter Maydell, Markus Armbruster, Eduardo Habkost,
	Thomas Huth, qemu-devel, like.xu

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(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-05-06 11:19 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15  7:59 [Qemu-devel] [PATCH v3 0/2] vl.c: make current_machine as non-global variable Like Xu
2019-04-15  7:59 ` Like Xu
2019-04-15  7:59 ` [Qemu-devel] [PATCH v3 1/2] vl.c: refactor " Like Xu
2019-04-15  7:59   ` Like Xu
2019-04-16 21:16   ` Eduardo Habkost
2019-04-16 21:16     ` Eduardo Habkost
2019-04-17  5:26   ` Markus Armbruster
2019-04-17  5:26     ` Markus Armbruster
2019-04-17 17:05     ` Eduardo Habkost
2019-04-17 17:05       ` Eduardo Habkost
2019-04-15  7:59 ` [Qemu-devel] [PATCH v3 2/2] core/qdev: refactor qdev_get_machine() with type assertion Like Xu
2019-04-15  7:59   ` Like Xu
2019-04-16 21:20   ` Eduardo Habkost
2019-04-16 21:20     ` Eduardo Habkost
2019-04-17  5:14     ` Markus Armbruster
2019-04-17  5:14       ` Markus Armbruster
2019-04-17 17:10       ` Eduardo Habkost
2019-04-17 17:10         ` Eduardo Habkost
2019-04-23  7:59         ` Like Xu
2019-04-24 17:21           ` Eduardo Habkost
2019-04-24 17:21             ` Eduardo Habkost
2019-04-25  3:12             ` Like Xu
2019-04-25 17:48               ` Eduardo Habkost
2019-05-06 11:17                 ` Markus Armbruster
2019-05-06 11:15           ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.