From: Like Xu <like.xu@linux.intel.com> To: qemu-trivial@nongnu.org Cc: Igor Mammedov <imammedo@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Markus Armbruster <armbru@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org, like.xu@intel.com Subject: [Qemu-devel] [PATCH v3 0/2] vl.c: make current_machine as non-global variable Date: Mon, 15 Apr 2019 15:59:43 +0800 [thread overview] Message-ID: <1555315185-16414-1-git-send-email-like.xu@linux.intel.com> (raw) 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
WARNING: multiple messages have this Message-ID (diff)
From: Like Xu <like.xu@linux.intel.com> To: qemu-trivial@nongnu.org Cc: Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, like.xu@intel.com, qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>, Igor Mammedov <imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v3 0/2] vl.c: make current_machine as non-global variable Date: Mon, 15 Apr 2019 15:59:43 +0800 [thread overview] Message-ID: <1555315185-16414-1-git-send-email-like.xu@linux.intel.com> (raw) Message-ID: <20190415075943.O3L_zjikfpEY-quZIdzD23n-aIgNjfld9_LhA4aH-cU@z> (raw) 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
next reply other threads:[~2019-04-15 8:00 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-15 7:59 Like Xu [this message] 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 ` [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-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 3:12 ` Like Xu 2019-04-25 17:48 ` Eduardo Habkost 2019-04-25 17:48 ` Eduardo Habkost 2019-05-06 11:17 ` Markus Armbruster 2019-05-06 11:15 ` Markus Armbruster
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1555315185-16414-1-git-send-email-like.xu@linux.intel.com \ --to=like.xu@linux.intel.com \ --cc=armbru@redhat.com \ --cc=ehabkost@redhat.com \ --cc=imammedo@redhat.com \ --cc=like.xu@intel.com \ --cc=peter.maydell@linaro.org \ --cc=qemu-devel@nongnu.org \ --cc=qemu-trivial@nongnu.org \ --cc=thuth@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).