From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX48q-00069X-SV for qemu-devel@nongnu.org; Tue, 30 Apr 2013 02:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UX48p-0001Cz-R1 for qemu-devel@nongnu.org; Tue, 30 Apr 2013 02:34:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX48p-0001Ak-I3 for qemu-devel@nongnu.org; Tue, 30 Apr 2013 02:34:19 -0400 From: Igor Mammedov Date: Tue, 30 Apr 2013 08:34:02 +0200 Message-Id: <1367303643-16036-4-git-send-email-imammedo@redhat.com> In-Reply-To: <1367303643-16036-1-git-send-email-imammedo@redhat.com> References: <1367303643-16036-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 3/4] add cpu-model option to -machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, aliguori@us.ibm.com Cc: ehabkost@redhat.com, mst@redhat.com, jfrei@linux.vnet.ibm.com, pbonzini@redhat.com, afaerber@suse.de, lig.fnst@cn.fujitsu.com Provides globally accessible cpu-model via machine opts. Signed-off-by: Igor Mammedov --- Note: - it will be used in cpu-add hook on tartget-i386. --- vl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 1e7d474..37a0f81 100644 --- a/vl.c +++ b/vl.c @@ -429,6 +429,10 @@ static QemuOptsList qemu_machine_opts = { .name = "usb", .type = QEMU_OPT_BOOL, .help = "Set on/off to enable/disable usb", + }, { + .name = "cpu-model", + .type = QEMU_OPT_STRING, + .help = "alias for \"-cpu\" CPU model definition", }, { /* End of list */ } }, @@ -2979,7 +2983,7 @@ int main(int argc, char **argv, char **envp) } case QEMU_OPTION_cpu: /* hw initialization will check this */ - cpu_model = optarg; + qemu_opts_set(qemu_find_opts("machine"), 0, "cpu-model", optarg); break; case QEMU_OPTION_hda: { @@ -3919,6 +3923,11 @@ int main(int argc, char **argv, char **envp) */ cpudef_init(); + machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0); + if (machine_opts) { + cpu_model = qemu_opt_get(machine_opts, "cpu-model"); + } + if (cpu_model && is_help_option(cpu_model)) { list_cpus(stdout, &fprintf, cpu_model); exit(0); @@ -4124,6 +4133,7 @@ int main(int argc, char **argv, char **envp) kernel_filename = qemu_opt_get(machine_opts, "kernel"); initrd_filename = qemu_opt_get(machine_opts, "initrd"); kernel_cmdline = qemu_opt_get(machine_opts, "append"); + cpu_model = qemu_opt_get(machine_opts, "cpu-model"); } else { kernel_filename = initrd_filename = kernel_cmdline = NULL; } -- 1.8.2.1