qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Igor Mammedov <imammedo@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Marcel Apfelbaum <marcel.a@redhat.com>
Subject: [Qemu-devel] [PATCH 4/4] module: Rename machine_init() to opts_init()
Date: Tue, 16 Feb 2016 18:59:07 -0200	[thread overview]
Message-ID: <1455656347-29033-5-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1455656347-29033-1-git-send-email-ehabkost@redhat.com>

The only remaining users of machine_init() only call
qemu_add_opts(). Rename machine_init() to opts_init() and move it
closer to the qemu_add_opts() calls on vl.c.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 fsdev/qemu-fsdev-opts.c | 2 +-
 hw/acpi/core.c          | 2 +-
 hw/smbios/smbios.c      | 2 +-
 include/qemu/module.h   | 4 ++--
 ui/spice-core.c         | 2 +-
 ui/vnc.c                | 2 +-
 vl.c                    | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fsdev/qemu-fsdev-opts.c b/fsdev/qemu-fsdev-opts.c
index 0b4619f..88a4ac3 100644
--- a/fsdev/qemu-fsdev-opts.c
+++ b/fsdev/qemu-fsdev-opts.c
@@ -83,4 +83,4 @@ static void fsdev_register_config(void)
     qemu_add_opts(&qemu_fsdev_opts);
     qemu_add_opts(&qemu_virtfs_opts);
 }
-machine_init(fsdev_register_config);
+opts_init(fsdev_register_config);
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 3a14e90..714bc68 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -68,7 +68,7 @@ static void acpi_register_config(void)
     qemu_add_opts(&qemu_acpi_opts);
 }
 
-machine_init(acpi_register_config);
+opts_init(acpi_register_config);
 
 static int acpi_checksum(const uint8_t *data, int len)
 {
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 3b5f9bd..1362e79 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -320,7 +320,7 @@ static void smbios_register_config(void)
     qemu_add_opts(&qemu_smbios_opts);
 }
 
-machine_init(smbios_register_config);
+opts_init(smbios_register_config);
 
 static void smbios_validate_table(void)
 {
diff --git a/include/qemu/module.h b/include/qemu/module.h
index 72d9498..24b61ec 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -42,14 +42,14 @@ static void __attribute__((constructor)) do_qemu_init_ ## function(void)    \
 
 typedef enum {
     MODULE_INIT_BLOCK,
-    MODULE_INIT_MACHINE,
+    MODULE_INIT_OPTS,
     MODULE_INIT_QAPI,
     MODULE_INIT_QOM,
     MODULE_INIT_MAX
 } module_init_type;
 
 #define block_init(function) module_init(function, MODULE_INIT_BLOCK)
-#define machine_init(function) module_init(function, MODULE_INIT_MACHINE)
+#define opts_init(function) module_init(function, MODULE_INIT_OPTS)
 #define qapi_init(function) module_init(function, MODULE_INIT_QAPI)
 #define type_init(function) module_init(function, MODULE_INIT_QOM)
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 4dbd99a..0038169 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -931,4 +931,4 @@ static void spice_register_config(void)
 {
     qemu_add_opts(&qemu_spice_opts);
 }
-machine_init(spice_register_config);
+opts_init(spice_register_config);
diff --git a/ui/vnc.c b/ui/vnc.c
index b6bbea5..2d06ca4 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3878,4 +3878,4 @@ static void vnc_register_config(void)
 {
     qemu_add_opts(&qemu_vnc_opts);
 }
-machine_init(vnc_register_config);
+opts_init(vnc_register_config);
diff --git a/vl.c b/vl.c
index 18e6086..6f7772c 100644
--- a/vl.c
+++ b/vl.c
@@ -2987,6 +2987,7 @@ int main(int argc, char **argv, char **envp)
     qemu_add_opts(&qemu_icount_opts);
     qemu_add_opts(&qemu_semihosting_config_opts);
     qemu_add_opts(&qemu_fw_cfg_opts);
+    module_call_init(MODULE_INIT_OPTS);
 
     runstate_init();
 
@@ -2999,7 +3000,6 @@ int main(int argc, char **argv, char **envp)
     QLIST_INIT (&vm_change_state_head);
     os_setup_early_signal_handling();
 
-    module_call_init(MODULE_INIT_MACHINE);
     machine_class = find_default_machine();
     cpu_model = NULL;
     snapshot = 0;
-- 
2.1.0

  parent reply	other threads:[~2016-02-16 20:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 20:59 [Qemu-devel] [PATCH 0/4] machine: Eliminate machine_init()/MODULE_INIT_MACHINE Eduardo Habkost
2016-02-16 20:59 ` [Qemu-devel] [PATCH 1/4] machine: Use type_init() to register machine classes Eduardo Habkost
2016-02-17 15:32   ` Marcel Apfelbaum
2016-02-17 15:57   ` Michael S. Tsirkin
2016-02-18  2:35   ` David Gibson
2016-02-16 20:59 ` [Qemu-devel] [PATCH 2/4] s390x/css: Allocate channel_subsys statically Eduardo Habkost
2016-02-17 11:43   ` Cornelia Huck
2016-02-17 21:03     ` Eduardo Habkost
2016-02-23 11:12       ` Cornelia Huck
2016-02-16 20:59 ` [Qemu-devel] [PATCH 3/4] s390x/css: Use static initialization for channel_subsys fields Eduardo Habkost
2016-02-17 11:44   ` Cornelia Huck
2016-02-16 20:59 ` Eduardo Habkost [this message]
2016-02-17 15:36   ` [Qemu-devel] [PATCH 4/4] module: Rename machine_init() to opts_init() Marcel Apfelbaum
2016-02-17 15:58   ` Michael S. Tsirkin

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=1455656347-29033-5-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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: link
Be 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).