qemu/softmmu
Paolo Bonzini 32c02fdda4 qemu-option: restrict qemu_opts_set to merge-lists QemuOpts
qemu_opts_set is used to create default network backends and to
parse sugar options -kernel, -initrd, -append, -bios and -dtb.
These are very different uses:

I would *expect* a function named qemu_opts_set to set an option in a
merge-lists QemuOptsList, such as -kernel, and possibly to set an option
in a non-merge-lists QemuOptsList with non-NULL id, similar to -set.

However, it wouldn't *work* to use qemu_opts_set for the latter
because qemu_opts_set uses fail_if_exists==1. So, for non-merge-lists
QemuOptsList and non-NULL id, the semantics of qemu_opts_set (fail if the
(QemuOptsList, id) pair already exists) are debatable.

On the other hand, I would not expect qemu_opts_set to create a
non-merge-lists QemuOpts with a single option; which it does, though.
For this case of non-merge-lists QemuOptsList and NULL id, qemu_opts_set
hardly adds value over qemu_opts_parse.  It does skip some parsing and
unescaping, but that's not needed when creating default network
backends.

So qemu_opts_set has warty behavior for non-merge-lists QemuOptsList
if id is non-NULL, and it's mostly pointless if id is NULL.  My
solution to keeping the API as simple as possible is to limit
qemu_opts_set to merge-lists QemuOptsList.  For them, it's useful (we
don't want comma-unescaping for -kernel) *and* has sane semantics.
Network backend creation is switched to qemu_opts_parse.

qemu_opts_set is now only used on merge-lists QemuOptsList... except
in the testcase, which is changed to use a merge-list QemuOptsList.

With this change we can also remove the id parameter.  With the
parameter always NULL, we know that qemu_opts_create cannot fail
and can pass &error_abort to it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-12-10 12:15:12 -05:00
..
arch_init.c
balloon.c
bootdevice.c softmmu: move more files to softmmu/ 2020-10-12 11:50:21 -04:00
cpu-throttle.c
cpu-timers.c cpus: prepare new CpusAccel cpu accelerator interface 2020-10-05 16:41:22 +02:00
cpus.c WHPX: support for the kernel-irqchip on/off 2020-12-10 12:15:01 -05:00
device_tree.c softmmu: move more files to softmmu/ 2020-10-12 11:50:21 -04:00
dma-helpers.c dma: Let dma_memory_set() propagate MemTxResult 2020-12-10 12:15:01 -05:00
icount.c icount: rename functions to be consistent with the module name 2020-10-05 16:41:22 +02:00
ioport.c
main.c
memory_mapping.c
memory.c memory: Skip bad range assertion if notifier is DEVIOTLB_UNMAP type 2020-12-08 13:48:57 -05:00
meson.build exec: split out non-softmmu-specific parts 2020-10-12 11:50:22 -04:00
physmem.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
qdev-monitor.c vl: move various initialization routines out of qemu_init 2020-12-10 12:15:11 -05:00
qemu-seccomp.c softmmu: move more files to softmmu/ 2020-10-12 11:50:21 -04:00
qtest.c module: silence errors for module_load_qom_all(). 2020-10-15 10:43:48 +02:00
timers-state.h cpu-timers, icount: new modules 2020-10-05 16:41:22 +02:00
tpm.c softmmu: move more files to softmmu/ 2020-10-12 11:50:21 -04:00
trace-events
trace.h
vl.c qemu-option: restrict qemu_opts_set to merge-lists QemuOpts 2020-12-10 12:15:12 -05:00