summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vl: separate qemu_create_machinePaolo Bonzini2020-12-101-53/+60
| | | | | Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: separate qemu_create_late_backendsPaolo Bonzini2020-12-101-32/+32
| | | | | | | "Late" backends are created after the machine. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: separate qemu_create_early_backendsPaolo Bonzini2020-12-101-58/+65
| | | | | | | | "Early" backends are created before the machine and can be used as machine options. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: move CHECKPOINT_INIT after preconfigPaolo Bonzini2020-12-102-5/+5
| | | | | | | | | | Move CHECKPOINT_INIT right before the machine initialization is completed. Everything before is essentially an extension of command line parsing. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: extract default devices to separate functionsPaolo Bonzini2020-12-101-102/+114
| | | | | Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: load plugins as late as possiblePaolo Bonzini2020-12-101-6/+6
| | | | | | | | | There is no need to load plugins in the middle of default device processing, move -plugin handling just before preconfig is entered. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: create "-net nic -net user" default earlierPaolo Bonzini2020-12-101-8/+8
| | | | | | | | Create it together with other default backends, even though the processing is done later. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-option: restrict qemu_opts_set to merge-lists QemuOptsPaolo Bonzini2020-12-104-23/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* vl: extract various command line desugaring snippets to a new functionPaolo Bonzini2020-12-101-18/+22
| | | | | | | | | | | | Keep the machine initialization sequence free of miscellaneous command line parsing actions. The only difference is that preallocation will always be done with one thread if -smp is not provided; previously it was using mc->default_cpus, which is almost always 1 anyway. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: preconfig and loadvm are mutually exclusivePaolo Bonzini2020-12-101-1/+6
| | | | | | | | | | | Just like -incoming. Later we will add support for "-incoming defer -preconfig", because there are cases (Xen, block layer) that want to look at RUNSTATE_INMIGRATE. -loadvm will remain mutually exclusive with preconfig; the plan is to just do loadvm in the monitor, since the user is already going to interact with it for preconfiguration. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: extract various command line validation snippets to a new functionPaolo Bonzini2020-12-102-39/+40
| | | | | Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: move prelaunch part of qemu_init to new functionsPaolo Bonzini2020-12-101-115/+134
| | | | | | | | | The final part of qemu_init, starting with the completion of board init, is already relatively clean. Split it out of qemu_init so that qemu_init keeps only the messy parts. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: extract qemu_init_subsystemsPaolo Bonzini2020-12-101-51/+43Star
| | | | | | | | | Group a bunch of subsystem initializations that can be done right after command line parsing. Remove initializations that can be done simply as global variable initializers. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: move various initialization routines out of qemu_initPaolo Bonzini2020-12-105-19/+7Star
| | | | | | | | Some very simple initialization routines can be nested in existing subsystem-level functions, do that to simplify qemu_init. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: split various early command line options to a separate functionPaolo Bonzini2020-12-101-88/+112
| | | | | | | | | Various options affect the global state of QEMU including the rest of qemu_init, and they need to be called very early. Group them together in a function that is called at the beginning. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: remove bogus checkPaolo Bonzini2020-12-101-6/+0Star
| | | | | | | | There is no reason to prevent -preconfig -daemonize. Of course if no monitor is defined there will be no way to start the VM, but that is a user error. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: extract validation of -smp to machine.cPaolo Bonzini2020-12-103-18/+26
| | | | | | | | | Once smp_parse is done, the validation operates on the MachineState. There is no reason for that code to be in vl.c. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* treewide: do not use short-form boolean optionsPaolo Bonzini2020-12-108-34/+34
| | | | | | | They are going to be deprecated, avoid warnings on stdout while the tests run. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hw/char/serial: Clean up unnecessary codePhilippe Mathieu-Daudé2020-12-101-8/+5Star
| | | | | | | | | | | | | Since commit 5ec3a23e6c8 ("serial: convert PIO to new memory api read/write") we don't need to worry about accesses bigger than 8-bit. Use the extract()/deposit() functions to access the correct part of the 16-bit 'divider' register. Reported-by: Jonathan D. Belanger <jbelanger1@rochester.rr.com> Buglink: https://bugs.launchpad.net/qemu/+bug/1904331 Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201120161933.2514089-1-f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* make ram_size local to vl.cPaolo Bonzini2020-12-106-11/+12
| | | | | | Use the machine properties for the leftovers too. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* sparc64: do not use ram_size globalPaolo Bonzini2020-12-102-3/+4
| | | | | | | Use the machine properties instead. Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* s390x: do not use ram_size globalPaolo Bonzini2020-12-106-12/+25
| | | | | | | Use the machine properties instead. Cc: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* riscv: do not use ram_size globalPaolo Bonzini2020-12-101-2/+3
| | | | | | | Use the machine properties instead. Cc: Alistair Francis <Alistair.Francis@wdc.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* ppc: do not use ram_size globalPaolo Bonzini2020-12-102-3/+3
| | | | | | | Use the machine properties instead. Cc: qemu-ppc@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* nios2: do not use ram_size globalPaolo Bonzini2020-12-101-4/+4
| | | | | | Use the equivalent argument to the function instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* moxie: do not use ram_size globalPaolo Bonzini2020-12-101-1/+1
| | | | | | | Use the loader parameters instead. Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* mips: do not use ram_size globalPaolo Bonzini2020-12-102-3/+3
| | | | | | | Use the machine properties or loader parameters instead. Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* microblaze: do not use ram_size globalPaolo Bonzini2020-12-101-4/+4
| | | | | | Use the equivalent argument to the function instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* m68k: do not use ram_size globalPaolo Bonzini2020-12-103-4/+8
| | | | | | | | Use the machine properties instead. Cc: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* i386: do not use ram_size globalPaolo Bonzini2020-12-105-8/+10
| | | | | | Use the loader parameters instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hppa: do not use ram_size globalPaolo Bonzini2020-12-101-5/+5
| | | | | | | Use the machine properties instead. Cc: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* cris: do not use ram_size globalPaolo Bonzini2020-12-103-1/+3
| | | | | | Use the machine properties instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* arm: do not use ram_size globalPaolo Bonzini2020-12-103-7/+9
| | | | | | | Use the machine properties instead. Cc: qemu-ppc@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vl: remove bios_namePaolo Bonzini2020-12-102-3/+0Star
| | | | | | | | | | bios_name was a legacy variable used by machine code, but it is no more. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20201026143028.3034018-16-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* digic: remove bios_namePaolo Bonzini2020-12-101-12/+7Star
| | | | | | | Pull defaults to digic4_board_init so that a MachineState is available. Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* sparc: remove bios_namePaolo Bonzini2020-12-103-5/+3Star
| | | | | | | | | Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201026143028.3034018-15-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* sh4: remove bios_namePaolo Bonzini2020-12-101-2/+1Star
| | | | | | | | | Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201026143028.3034018-14-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* s390: remove bios_namePaolo Bonzini2020-12-102-7/+4Star
| | | | | | | | | Cc: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201026143028.3034018-13-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rx: move BIOS load from MCU to boardPaolo Bonzini2020-12-102-9/+10
| | | | | | | | | | | | | | The ROM loader state is global and not part of the MCU, and the BIOS is in machine->firmware. So just like the kernel case, load it in the board. Due to the ordering between CPU reset and ROM reset, the ROM has to be registered before the CPU is realized, otherwise the reset vector is loaded before the ROM is there. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* ppc: remove bios_namePaolo Bonzini2020-12-107-22/+9Star
| | | | | | | | | Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20201026143028.3034018-11-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* moxie: remove bios_namePaolo Bonzini2020-12-101-3/+3
| | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20201026143028.3034018-10-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* mips: remove bios_namePaolo Bonzini2020-12-104-12/+12
| | | | | | | | Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20201026143028.3034018-9-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* m68k: remove bios_namePaolo Bonzini2020-12-103-11/+7Star
| | | | | | | | | | | Cc: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201026143028.3034018-8-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* lm32: remove bios_namePaolo Bonzini2020-12-101-3/+1Star
| | | | | | | | Cc: Michael Walle <michael@walle.cc> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20201026143028.3034018-7-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* i386: remove bios_namePaolo Bonzini2020-12-104-13/+11Star
| | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20201026143028.3034018-6-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hppa: remove bios_namePaolo Bonzini2020-12-101-2/+1Star
| | | | | | | | | Cc: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201026143028.3034018-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* arm: remove bios_namePaolo Bonzini2020-12-107-14/+15
| | | | | | | | | | Get the firmware name from the MachineState object. Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20201026143028.3034018-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* alpha: remove bios_namePaolo Bonzini2020-12-101-1/+1
| | | | | | | | | Cc: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201026143028.3034018-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hw/net/xilinx_axienet: Rename StreamSlave as StreamSinkPhilippe Mathieu-Daudé2020-12-101-12/+12
| | | | | | | | | | | In order to use inclusive terminology, rename 'slave stream' as 'sink stream'. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Message-Id: <20200910070131.435543-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hw/dma/xilinx_axidma: Rename StreamSlave as StreamSinkPhilippe Mathieu-Daudé2020-12-101-13/+13
| | | | | | | | | | | In order to use inclusive terminology, rename 'slave stream' as 'sink stream'. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Message-Id: <20200910070131.435543-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>