From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4JdQ-0002qu-28 for qemu-devel@nongnu.org; Wed, 22 Aug 2012 18:42:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4JdO-0008Rg-56 for qemu-devel@nongnu.org; Wed, 22 Aug 2012 18:42:47 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:35787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4JdO-0008RX-18 for qemu-devel@nongnu.org; Wed, 22 Aug 2012 18:42:46 -0400 Received: from /spool/local by e6.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Aug 2012 18:42:45 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id E22DDC90041 for ; Wed, 22 Aug 2012 18:42:41 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7MMgfqF182374 for ; Wed, 22 Aug 2012 18:42:41 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7MMgfft018786 for ; Wed, 22 Aug 2012 19:42:41 -0300 From: Anthony Liguori In-Reply-To: References: <1345667067-24298-1-git-send-email-aliguori@us.ibm.com> Date: Wed, 22 Aug 2012 17:42:37 -0500 Message-ID: <87k3wqo8f6.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] boards: add a 'none' machine type to all platforms List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Markus Armbruster Peter Maydell writes: > On 22 August 2012 21:24, Anthony Liguori wrote: >> This allows any QEMU binary to be executed with: >> >> $QEMU_BINARY -qmp stdio > > ...presumably you mean -qmp stdio -M none ? > >> >> Without errors from missing options that are required by various boards. This >> also provides a mode that we can use in the future to construct machines >> entirely through QMP commands. > > How about documenting this machine (and its purpose) somewhere? Okay, but where? I don't know an obvious place. >> Cc: Daniel Berrange >> Cc: Markus Armbruster >> Signed-off-by: Anthony Liguori >> --- >> hw/Makefile.objs | 2 ++ >> hw/null-machine.c | 40 ++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 42 insertions(+), 0 deletions(-) >> create mode 100644 hw/null-machine.c >> >> diff --git a/hw/Makefile.objs b/hw/Makefile.objs >> index 7f57ed5..6dfebd2 100644 >> --- a/hw/Makefile.objs >> +++ b/hw/Makefile.objs >> @@ -134,6 +134,8 @@ hw-obj-$(CONFIG_DP8393X) += dp8393x.o >> hw-obj-$(CONFIG_DS1225Y) += ds1225y.o >> hw-obj-$(CONFIG_MIPSNET) += mipsnet.o >> >> +hw-obj-y += null-machine.o >> + >> # Sound >> sound-obj-y = >> sound-obj-$(CONFIG_SB16) += sb16.o >> diff --git a/hw/null-machine.c b/hw/null-machine.c >> new file mode 100644 >> index 0000000..69910d3 >> --- /dev/null >> +++ b/hw/null-machine.c >> @@ -0,0 +1,40 @@ >> +/* >> + * Empty machine >> + * >> + * Copyright IBM, Corp. 2012 >> + * >> + * Authors: >> + * Anthony Liguori >> + * >> + * This work is licensed under the terms of the GNU GPL, version 2 or later. >> + * See the COPYING file in the top-level directory. >> + * >> + */ >> + >> +#include "qemu-common.h" >> +#include "hw/hw.h" >> +#include "hw/boards.h" >> + >> +static void machine_none_init(ram_addr_t ram_size, >> + const char *boot_device, >> + const char *kernel_filename, >> + const char *kernel_cmdline, >> + const char *initrd_filename, >> + const char *cpu_model) >> +{ >> +} >> + >> +static QEMUMachine machine_none = { >> + .name = "none", >> + .desc = "empty machine", >> + .init = machine_none_init, >> + .max_cpus = 0, >> +}; >> + >> +static void register_machines(void) >> +{ >> + qemu_register_machine(&machine_none); >> +} >> + >> +machine_init(register_machines); > > We seem to be about evenly split about whether machine_init() > should have a trailing semicolon (it doesn't need one > but it doesn't hurt either...) It's obviously superior to use a semicolon... C is completely consistent synactically about the usage of semicolons afterall :-) Regards, Anthony Liguori > > -- PMM