qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel.a@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, ehabkost@redhat.com, mst@redhat.com,
	stefanha@redhat.com, armbru@redhat.com, aliguori@amazon.com,
	pbonzini@redhat.com, lersek@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH 1/3] hw/machine: move QEMUMachine assignment into the core machine
Date: Tue, 11 Mar 2014 17:35:54 +0200	[thread overview]
Message-ID: <1394552156-18901-2-git-send-email-marcel.a@redhat.com> (raw)
In-Reply-To: <1394552156-18901-1-git-send-email-marcel.a@redhat.com>

The QemuMachine assignment into the QOM machine it is common
to all machines until the conversion is over. It is not
specific to vl.c .

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
---
 hw/core/machine.c | 8 ++++++++
 vl.c              | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index d3ffef7..4b49a7d 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -12,12 +12,20 @@
 
 #include "hw/boards.h"
 
+static void machine_base_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->qemu_machine = data;
+}
+
 static const TypeInfo machine_info = {
     .name = TYPE_MACHINE,
     .parent = TYPE_OBJECT,
     .abstract = true,
     .class_size = sizeof(MachineClass),
     .instance_size = sizeof(MachineState),
+    .class_base_init = machine_base_class_init,
 };
 
 static void machine_register_types(void)
diff --git a/vl.c b/vl.c
index d75ca55..6a380d9 100644
--- a/vl.c
+++ b/vl.c
@@ -1531,19 +1531,11 @@ void pcmcia_info(Monitor *mon, const QDict *qdict)
 
 MachineState *current_machine;
 
-static void machine_class_init(ObjectClass *oc, void *data)
-{
-    MachineClass *mc = MACHINE_CLASS(oc);
-
-    mc->qemu_machine = data;
-}
-
 int qemu_register_machine(QEMUMachine *m)
 {
     TypeInfo ti = {
         .name       = g_strconcat(m->name, TYPE_MACHINE_SUFFIX, NULL),
         .parent     = TYPE_MACHINE,
-        .class_init = machine_class_init,
         .class_data = (void *)m,
     };
 
-- 
1.8.3.1

  reply	other threads:[~2014-03-11 15:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 15:35 [Qemu-devel] [PATCH 0/3] tests/qdev-global-props: fixes due to machine conversion to QOM Marcel Apfelbaum
2014-03-11 15:35 ` Marcel Apfelbaum [this message]
2014-03-11 15:53   ` [Qemu-devel] [PATCH 1/3] hw/machine: move QEMUMachine assignment into the core machine Marcel Apfelbaum
2014-03-11 15:35 ` [Qemu-devel] [PATCH 2/3] hw/null-machine: Convert null machine to QOM Marcel Apfelbaum
2014-03-11 15:47   ` Eric Blake
2014-03-11 15:50     ` Marcel Apfelbaum
2014-03-11 15:35 ` [Qemu-devel] [PATCH 3/3] tests/qdev-global-props: Manually add an instance of a QOM machine Marcel Apfelbaum
2014-03-11 17:11 ` [Qemu-devel] [PATCH 0/3] tests/qdev-global-props: fixes due to machine conversion to QOM Andreas Färber
2014-03-11 19:44   ` Marcel Apfelbaum

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=1394552156-18901-2-git-send-email-marcel.a@redhat.com \
    --to=marcel.a@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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: 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).