From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rqqxi-000321-VX for qemu-devel@nongnu.org; Fri, 27 Jan 2012 13:55:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rqqxe-0001u7-P4 for qemu-devel@nongnu.org; Fri, 27 Jan 2012 13:55:50 -0500 Received: from david.siemens.de ([192.35.17.14]:23002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rqqxe-0001tt-9t for qemu-devel@nongnu.org; Fri, 27 Jan 2012 13:55:46 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id q0RItjxA001460 for ; Fri, 27 Jan 2012 19:55:45 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id q0RIthbc015715 for ; Fri, 27 Jan 2012 19:55:43 +0100 Message-ID: <4F22F32F.3010206@siemens.com> Date: Fri, 27 Jan 2012 19:55:43 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F22F2FE.8000008@siemens.com> In-Reply-To: <4F22F2FE.8000008@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 2/2] Improve default machine options usability List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel So far we overwrite the machine options completely with defaults if no accel=value is provided. More user friendly is to fill in only unspecified options. The new qemu_opts_set_defaults enables this. Signed-off-by: Jan Kiszka --- vl.c | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) diff --git a/vl.c b/vl.c index 6af0f83..138f6bc 100644 --- a/vl.c +++ b/vl.c @@ -3153,21 +3153,8 @@ int main(int argc, char **argv, char **envp) * specified either by the configuration file or by the command line. */ if (machine->default_machine_opts) { - QemuOptsList *list = qemu_find_opts("machine"); - const char *p = NULL; - - if (!QTAILQ_EMPTY(&list->head)) { - p = qemu_opt_get(QTAILQ_FIRST(&list->head), "accel"); - } - if (p == NULL) { - qemu_opts_reset(list); - opts = qemu_opts_parse(list, machine->default_machine_opts, 0); - if (!opts) { - fprintf(stderr, "parse error for machine %s: %s\n", - machine->name, machine->default_machine_opts); - exit(1); - } - } + qemu_opts_set_defaults(qemu_find_opts("machine"), + machine->default_machine_opts, 0); } qemu_opts_foreach(qemu_find_opts("device"), default_driver_check, NULL, 0); -- 1.7.3.4