QemuOpts: use strtosz

This will simplify conversion of -numa node,mem=... and -m to QemuOpts.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: implement -m with QemuOpts

This becomes -machine ram_size.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: implement -S with QemuOpts

This becomes -machine autostart.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: implement -bios with QemuOpts

This becomes -machine bios.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: implement -localtime with QemuOpts

The -localtime option already has a QemuOpts equivalent.  Setting
the merge_lists option on the -rtc list makes it simple to use it.

This includes a small change in behavior for -rtc.  For example, "-rtc
base=localtime -rtc driftfix=slew" will actually combine the option
rather than override them.  These are actually nicer semantics than
what was there so far.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: make -M a simple alias for -machine type

machine_parse is still being called from the -M handler.  Remove this,
and just call machine_parse based on the "-machine type" value.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: accept NULL opts in qemu_opt_find

This simplifies the code in cases where we process the options without
qemu_opts_foreach.  One example is -machine, the next patch will rely
on this.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: implement -nodefaults with qemuopts

This becomes -machine default_devices.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: convert -smp to QemuOpts

This introduces a new option group, but it is mostly trivial.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: reindent numa_add

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: convert -numa to QemuOpts

This requires some special casing to skip the fake "node" option and
to handle the automatic "-numa node" syntax.  Besides this, the option
parsing maps easily to QemuOpts.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: convert -acpitable to QemuOpts

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmdline: convert -smbios and -uuid to QemuOpts

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
QemuOpts: correctly skip escaped ,id=

QemuOpts would parse incorrectly something that included ",,id=" (with
an escaped comma).  Fix this by using get_param_value.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
reimplement no-reboot/no-shutdown preparing for replacement

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
revert commit 5db4af8 (Introduce get_next_param_value, 2009-06-24)

This is not needed anymore since slirp has been converted to QemuOpts.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
vga: disable default VGA if appropriate -device is used

This is a partial revert of commits a369da5 (vga: improve VGA logic,
committed 2012-01-22) and c5bd4f3 (vga: fix -nodefaults -device VGA,
2012-01-24) which broke command-line option parsing in different ways.

Since commit a369da5 it has become impossible to specify a VGA device
entirely with QemuOpts-enabled options, i.e. without needing an explicit
"-vga none".

In addition, until commit c5bd4f3 -nodefaults would not disable the device
you specified with the legacy "-vga" option, independent of the order.
Since commit c5bd4f3 QEMU -nodefaults will override a previous -vga
option.

I did not reintroduce machine->no_vga.  Boards can simply ignore the
vga_interface_type variable, and most will indeed do so.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>