From: Igor Mammedov <imammedo@redhat.com>
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
Subject: [Qemu-devel] [PATCH 3/4] add cpu-model option to -machine
Date: Tue, 30 Apr 2013 08:34:02 +0200 [thread overview]
Message-ID: <1367303643-16036-4-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1367303643-16036-1-git-send-email-imammedo@redhat.com>
Provides globally accessible cpu-model via machine opts.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
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
next prev parent reply other threads:[~2013-04-30 6:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 6:33 [Qemu-devel] [PATCH 0/4 v8 for-1.5] target-i386: CPU hot-add with cpu-add QMP command Igor Mammedov
2013-04-30 6:34 ` [Qemu-devel] [PATCH 1/4] add hot_add_cpu hook to QEMUMachine Igor Mammedov
2013-04-30 6:34 ` [Qemu-devel] [PATCH 2/4] QMP: add cpu-add command Igor Mammedov
2013-04-30 13:46 ` Eduardo Habkost
2013-04-30 13:53 ` [Qemu-devel] [libvirt] " Peter Krempa
2013-04-30 13:56 ` [Qemu-devel] " Igor Mammedov
2013-04-30 6:34 ` Igor Mammedov [this message]
2013-04-30 12:09 ` [Qemu-devel] [PATCH 3/4] add cpu-model option to -machine Eduardo Habkost
2013-04-30 6:34 ` [Qemu-devel] [PATCH 4/4] target-i386: implement machine->hot_add_cpu hook Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1367303643-16036-4-git-send-email-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=ehabkost@redhat.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=lig.fnst@cn.fujitsu.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).