From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGU1v-0001YZ-AS for qemu-devel@nongnu.org; Thu, 20 Feb 2014 08:51:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGU1i-0003ky-Fj for qemu-devel@nongnu.org; Thu, 20 Feb 2014 08:51:11 -0500 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:57287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGU1h-0003k8-OZ for qemu-devel@nongnu.org; Thu, 20 Feb 2014 08:50:58 -0500 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 20 Feb 2014 23:50:54 +1000 From: Alexey Kardashevskiy Date: Fri, 21 Feb 2014 00:50:43 +1100 Message-Id: <1392904246-15575-4-git-send-email-aik@ozlabs.ru> In-Reply-To: <1392904246-15575-1-git-send-email-aik@ozlabs.ru> References: <1392904246-15575-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v5 3/6] 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: Alexey Kardashevskiy , Paolo Bonzini , qemu-ppc@nongnu.org, Alexander Graf , Andreas Faerber 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 c2096e6..8640272 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -29,6 +29,7 @@ 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 01ab7e4..b300721 100644 --- a/vl.c +++ b/vl.c @@ -4034,6 +4034,11 @@ int main(int argc, char **argv, char **envp) qtest_init(qtest_chrdev, qtest_log); } + 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