From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqgwT-0001Z8-NB for qemu-devel@nongnu.org; Wed, 11 Dec 2013 05:23:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqgwK-0001GW-Dl for qemu-devel@nongnu.org; Wed, 11 Dec 2013 05:22:57 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:60848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqgwJ-0001Ei-My for qemu-devel@nongnu.org; Wed, 11 Dec 2013 05:22:48 -0500 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Dec 2013 20:22:36 +1000 From: Alexey Kardashevskiy Date: Wed, 11 Dec 2013 21:22:20 +1100 Message-Id: <1386757341-12154-8-git-send-email-aik@ozlabs.ru> In-Reply-To: <1386757341-12154-1-git-send-email-aik@ozlabs.ru> References: <1386757341-12154-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v4 7/8] vl: allow customizing the class of /machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, Paolo Bonzini , qemu-ppc@nongnu.org, Alexander Graf From: Paolo Bonzini This is a first step towards QOMifying /machine. Signed-off-by: Paolo Bonzini --- include/hw/boards.h | 1 + vl.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/hw/boards.h b/include/hw/boards.h index 5a7ae9f..431d016 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -25,6 +25,7 @@ typedef struct QEMUMachine { const char *name; const char *alias; const char *desc; + const char *class_name; QEMUMachineInitFunc *init; QEMUMachineResetFunc *reset; QEMUMachineHotAddCPUFunc *hot_add_cpu; diff --git a/vl.c b/vl.c index 2cde6a1..442b190 100644 --- a/vl.c +++ b/vl.c @@ -4047,6 +4047,11 @@ int main(int argc, char **argv, char **envp) qtest_init(); } + if (machine->class_name) { + Object *m = object_new(machine->class_name); + object_property_add_child(object_get_root(), "machine", m, NULL); + } + machine_opts = qemu_get_machine_opts(); kernel_filename = qemu_opt_get(machine_opts, "kernel"); initrd_filename = qemu_opt_get(machine_opts, "initrd"); -- 1.8.4.rc4