- Jun 18, 2019
-
-
Kevin Wolf authored
The -mon pretty=on|off switch of the -mon option applies only to QMP monitors. It's silently ignored for HMP. Deprecate this combination so that we can make it an error in future versions. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Message-Id: <20190613153405.24769-16-kwolf@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> [Commit message tweaked] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Kevin Wolf authored
Most callers know which monitor type they want to have. Instead of calling monitor_init() with flags that can describe both types of monitors, make monitor_init_{hmp,qmp}() public interfaces that take specific bools instead of flags and call these functions directly. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Message-Id: <20190613153405.24769-15-kwolf@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Jun 12, 2019
-
-
Markus Armbruster authored
No header includes qemu-common.h after this commit, as prescribed by qemu-common.h's file comment. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-5-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and net/tap-bsd.c fixed up]
-
- Jun 11, 2019
-
-
Markus Armbruster authored
Other accelerators have their own headers: sysemu/hax.h, sysemu/hvf.h, sysemu/kvm.h, sysemu/whpx.h. Only tcg_enabled() & friends sit in qemu-common.h. This necessitates inclusion of qemu-common.h into headers, which is against the rules spelled out in qemu-common.h's file comment. Move tcg_enabled() & friends into their own header sysemu/tcg.h, and adjust #include directives. Cc: Richard Henderson <rth@twiddle.net> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-2-armbru@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> [Rebased with conflicts resolved automatically, except for accel/tcg/tcg-all.c]
-
- Jun 05, 2019
-
-
Markus Armbruster authored
Objects should not be "delayed" without a reason, as the previous commit demonstrates. The remaining ones have reasons. State them. and demand future ones come with such a statement. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190604151251.9903-3-armbru@redhat.com> Reviewed-by:
Michal Privoznik <mprivozn@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Markus Armbruster authored
qemu-system-FOO's main() acts on command line arguments in its own idiosyncratic order. There's not much method to its madness. Whenever we find a case where one kind of command line argument needs to refer to something created for another kind later, we rejigger the order. Recent commit cda4aa9a "vl: Create block backends before setting machine properties" was such a rejigger. Block backends are now created before "delayed" objects. This broke persistent reservation management. Reproducer: $ qemu-system-x86_64 -object pr-manager-helper,id=pr-helper0,path=/tmp/pr-helper0.sock-drive -drive file=/dev/mapper/crypt,file.pr-manager=pr-helper0,format=raw,if=none,id=drive-scsi0-0-0-2 qemu-system-x86_64: -drive file=/dev/mapper/crypt,file.pr-manager=pr-helper0,format=raw,if=none,id=drive-scsi0-0-0-2: No persistent reservation manager with id 'pr-helper0' The delayed pr-manager-helper object is created too late for use by -drive or -blockdev. Normal objects are still created in time. pr-manager-helper has always been a delayed object (commit 7c9e5276 "scsi, file-posix: add support for persistent reservation management"). Turns out there's no real reason for that. Make it a normal object. Fixes: cda4aa9a Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190604151251.9903-2-armbru@redhat.com> Reviewed-by:
Michal Privoznik <mprivozn@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 03, 2019
-
-
Wainer dos Santos Moschetta authored
Currently, -accel help shows all possible accelerators regardless if they are enabled in the binary or not. That is a different semantic from -cpu and -machine helps, for example. So this change makes it to list only the accelerators which support is compiled in the binary target. Note that it does not check if the accelerator is enabled in the host, so the help message's header was rewritten to emphasize that. Also qtest is not displayed given that it is used for internal testing purpose only. Signed-off-by:
Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20190530215755.328-2-wainersm@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- May 29, 2019
-
-
Marc-André Lureau authored
Add new virtio-gpu devices with a "vhost-user" property. The associated vhost-user backend is used to handle the virtio rings and provide rendering results thanks to the vhost-user-gpu protocol. Example usage: -object vhost-user-backend,id=vug,cmd="./vhost-user-gpu" -device vhost-user-vga,vhost-user=vug Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190524130946.31736-10-marcandre.lureau@redhat.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- May 28, 2019
-
-
Alex Bennée authored
It will be useful for a number of use-cases to be able to re-direct output to a file like we do with serial output. This does the wiring to allow us to treat then semihosting console like just another character output device. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Alex Bennée authored
In preparation for having some more common semihosting code let's excise the current config magic from vl.c into its own file. We shall later add more conditionals to the build configurations so we can avoid building this if we don't need it. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
- May 22, 2019
-
-
Richard Henderson authored
When the -seed option is given, call qemu_guest_random_seed_main, putting the subsystem into deterministic mode. Pass derived seeds to each cpu created; which is a no-op unless the subsystem is in deterministic mode. Reviewed-by:
Laurent Vivier <lvivier@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- May 17, 2019
-
-
Greg Kurz authored
The synth fsdriver never got used for anything else but the QTest testcase for VirtIO 9P. And even there, QTest uses -fsdev synth and -device virtio-9p-... directly. Signed-off-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
Marc-André Lureau authored
$ ./x86_64-softmmu/qemu-system-x86_64 -sandbox off qemu-system-x86_64: -sandbox off: There is no option group 'sandbox' Segmentation fault Commit 5780760f ("seccomp: check TSYNC host capability") wrapped one use of the sandbox option group to produce a sensible error, it didn't do the same for another call to qemu_opts_parse_noisily(): (gdb) bt at util/qemu-option.c:829 #0 0x00000000105b36d8 in opts_parse (list=0x0, params=0x3ffffffffab5 "off", permit_abbrev=true, defaults=false, errp=0x3ffffffff080) at util/qemu-option.c:829 #1 0x00000000105b3b74 in qemu_opts_parse_noisily (list=<optimized out>, params=<optimized out>, permit_abbrev=<optimized out>) at util/qemu-option.c:890 #2 0x0000000010024964 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:3589 Fixes: 5780760f Cc: david@gibson.dropbear.id.au Cc: otubo@redhat.com Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190429134757.13570-1-marcandre.lureau@redhat.com> Tested-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Laurent Vivier <lvivier@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- May 15, 2019
-
-
Philippe Mathieu-Daudé authored
Some VGA adapters do not contain an helpful description, this can be confusing: $ qemu-system-arm -M virt -vga help none std standard VGA cirrus Cirrus VGA (default) vmware VMWare SVGA xenfb Add a description to the missing adapters: $ qemu-system-arm -M virt -vga help none no graphic card std standard VGA cirrus Cirrus VGA (default) vmware VMWare SVGA xenfb Xen paravirtualized framebuffer Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Based-on: <20190412152713.16018-1-marcandre.lureau@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Paul Durrant <paul.durrant@citrix.com> Message-Id: <20190412163706.3878-1-philmd@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
The old -realtime mlock=on|off parameter does exactly the same as the new -overcommit mem-lock=on|off parameter. Additionally, "-realtime" does not activate any additional "realtime" capabilities as the name might indicate. We should avoid to confuse the users this way, so let's deprecate the old -realtime option. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190411175345.19414-1-thuth@redhat.com>
-
- May 07, 2019
-
-
Marc-André Lureau authored
Provide help output similar to other argument help handling: $ qemu-system-x86_64 -vga help none std standard VGA (default) cirrus Cirrus VGA vmware VMWare SVGA xenfb qxl QXL VGA virtio Virtio VG Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190412152713.16018-3-marcandre.lureau@redhat.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190412152713.16018-2-marcandre.lureau@redhat.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Apr 29, 2019
-
-
Yury Kotov authored
Signed-off-by:
Yury Kotov <yury-kotov@yandex-team.ru> Reviewed-by:
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190426102115.30002-1-yury-kotov@yandex-team.ru Message-Id: <20190426102115.30002-1-yury-kotov@yandex-team.ru> Signed-off-by:
Stefan Hajnoczi <stefanha@gmail.com>
-
- Apr 25, 2019
-
-
Eduardo Habkost authored
The "model[,option...]" string parsed by the function is not just a CPU model. Rename the function and its argument to indicate it expects the full "-cpu" option to be provided. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190417025944.16154-2-ehabkost@redhat.com> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
Markus Armbruster authored
Exploit that argument @name is nerver null. Check is_help_option() first, because that's what we do elsewhere. If we (foolishly!) defined a machine named "help", -machine help would now print help instead of selecting the machine named "help". Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Wei Yang <richardw.yang@linux.intel.com> Message-Id: <20190405064121.23662-5-richardw.yang@linux.intel.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
Markus Armbruster authored
Since the previous commit, find_machine() and find_default_machine() don't have to deallocate on return. This permits further simplifications. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Wei Yang <richardw.yang@linux.intel.com> Message-Id: <20190405064121.23662-4-richardw.yang@linux.intel.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
Wei Yang authored
Now all the functions used to select machine is local and the call flow looks like below: select_machine() find_default_machine() machine_parse() find_machine() All these related function will need a GSList for TYPE_MACHINE. Currently we allocate this list each time we use it, while this is not necessary to do so because we don't need to modify this. This patch make the TYPE_MACHINE list allocation in select_machine and pass this to its child for use. Signed-off-by:
Wei Yang <richardw.yang@linux.intel.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190405064121.23662-3-richardw.yang@linux.intel.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
Wei Yang authored
Function find_default_machine() is introduced by commit 2c8cffa5 "vl: make find_default_machine externally visible", and it was used outside of vl.c until commit a904410a "pc_sysfw: remove the rom_only property". Commit a904410a "pc_sysfw: remove the rom_only property" removed the only user of find_default_machine() outside vl.c, but neglected to make it static. Do that now. Signed-off-by:
Wei Yang <richardw.yang@linux.intel.com> Message-Id: <20190405064121.23662-2-richardw.yang@linux.intel.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
- Apr 18, 2019
-
-
Markus Armbruster authored
The various TARGET_cpu_list() take an fprintf()-like callback and a FILE * to pass to it. Their callers (vl.c's main() via list_cpus(), bsd-user/main.c's main(), linux-user/main.c's main()) all pass fprintf() and stdout. Thus, the flexibility provided by the (rather tiresome) indirection isn't actually used. Drop the callback, and call qemu_printf() instead. Calling printf() would also work, but would make the code unsuitable for monitor context without making it simpler. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190417191805.28198-10-armbru@redhat.com> Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-
Markus Armbruster authored
Command line help help explicitly requested by the user should be printed to stdout, not stderr. We do elsewhere. Adjust -machine $TYPE,help and -accel help to match: use printf() instead of error_printf(). Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Marcel Apfelbaum <marcel.apfelbaum@gmail.com> Message-Id: <20190417190641.26814-10-armbru@redhat.com>
-
- Apr 17, 2019
-
-
Christophe Fergeau authored
This commit adds a error_init() helper which calls g_log_set_default_handler() so that glib logs (g_log, g_warning, ...) are handled similarly to other QEMU logs. This means they will get a timestamp if timestamps are enabled, and they will go through the HMP monitor if one is configured. This commit also adds a call to error_init() to the binaries installed by QEMU. Since error_init() also calls error_set_progname(), this means that *-linux-user, *-bsd-user and qemu-pr-helper messages output with error_report, info_report, ... will slightly change: they will be prefixed by the binary name. glib debug messages are enabled through G_MESSAGES_DEBUG similarly to the glib default log handler. At the moment, this change will mostly impact SPICE logging if your spice version is >= 0.14.1. With older spice versions, this is not going to work as expected, but will not have any ill effect, so this call is not conditional on the SPICE version. Signed-off-by:
Christophe Fergeau <cfergeau@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20190131164614.19209-3-cfergeau@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Apr 02, 2019
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190401090827.20793-5-armbru@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com>
-
Markus Armbruster authored
This reverts commit 3df663e5. This reverts commit b605c47b. Command line option --only-migratable is for disallowing any configuration that can block migration. Initially, --only-migratable set global variable @only_migratable. Commit 3df663e5 "migration: move only_migratable to MigrationState" replaced it by MigrationState member @only_migratable. That was a mistake. First, it doesn't make sense on the design level. MigrationState captures the state of an individual migration, but --only-migratable isn't a property of an individual migration, it's a restriction on QEMU configuration. With fault tolerance, we could have several migrations at once. --only-migratable would certainly protect all of them. Storing it in MigrationState feels inappropriate. Second, it contributes to a dependency cycle that manifests itself as a bug now. Putting @only_migratable into MigrationState means its available only after migration_object_init(). We can't set it before migration_object_init(), so we delay setting it with a global property (this is fixup commit b605c47b "migration: fix handling for --only-migratable"). We can't get it before migration_object_init(), so anything that uses it can only run afterwards. Since migrate_add_blocker() needs to obey --only-migratable, any code adding migration blockers can run only afterwards. This contributes to the following dependency cycle: * configure_blockdev() must run before machine_set_property() so machine properties can refer to block backends * machine_set_property() before configure_accelerator() so machine properties like kvm-irqchip get applied * configure_accelerator() before migration_object_init() so that Xen's accelerator compat properties get applied. * migration_object_init() before configure_blockdev() so configure_blockdev() can add migration blockers The cycle was closed when recent commit cda4aa9a "Create block backends before setting machine properties" added the first dependency, and satisfied it by violating the last one. Broke block backends that add migration blockers. Moving @only_migratable into MigrationState was a mistake. Revert it. This doesn't quite break the "migration_object_init() before configure_blockdev() dependency, since migrate_add_blocker() still has another dependency on migration_object_init(). To be addressed the next commit. Note that the reverted commit made -only-migratable sugar for -global migration.only-migratable=on below the hood. Documentation has only ever mentioned -only-migratable. This commit removes the arcane & undocumented alternative to -only-migratable again. Nobody should be using it. Conflicts: include/migration/misc.h migration/migration.c migration/migration.h vl.c Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190401090827.20793-3-armbru@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com>
-
Markus Armbruster authored
This reverts commit e60483f2. Recent commit cda4aa9a moved block backend creation before machine property evaluation. This broke block backends registering migration blockers. Commit e60483f2 fixed it by moving migration object creation before block backend creation. This broke migration with Xen. Turns out we need to configure the accelerator before we create the migration object so that Xen's accelerator compat properties get applied. Revert the flawed commit. This fixes the Xen regression, but brings back the block backend regression. The next commits will fix it again. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190401090827.20793-2-armbru@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com>
-
Markus Armbruster authored
We blame badness in positional arguments on the last option argument: $ qemu-system-x86_64 -vnc :1 bad.img qemu-system-x86_64: -vnc :1: Could not open 'foo': No such file or directory I believe we've done this ever since we reported locations. Fix it to qemu-system-x86_64: bad.img: Could not open 'bad.img': No such file or directory Reported-by:
Daniel P. Berrangé <berrange@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190318183312.4684-1-armbru@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Stefano Garzarella <sgarzare@redhat.com>
-
- Mar 19, 2019
-
-
Markus Armbruster authored
Recent commit cda4aa9a moved block backend creation before machine property evaluation. This broke qemu-iotests 055. Turns out we need to create the migration object before block backends, so block backends can add migration blockers. Fix by calling migration_object_init() earlier, right before configure_blockdev(). Fixes: cda4aa9a Reported-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- Mar 13, 2019
-
-
Samuel Thibault authored
curses will use it for proper wide output support. Signed-off-by:
Samuel Thibault <samuel.thibault@ens-lyon.org> Message-Id: <20190311135127.2229-2-samuel.thibault@ens-lyon.org> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Mar 11, 2019
-
-
Markus Armbruster authored
qemu-system-FOO's main() acts on command line arguments in its own idiosyncratic order. There's not much method to its madness. Whenever we find a case where one kind of command line argument needs to refer to something created for another kind later, we rejigger the order. Block devices get created long after machine properties get processed. Therefore, block device machine properties can be created, but not set. No such properties exist. But the next commit will create some. Time to rejigger again: create block devices earlier. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190308131445.17502-8-armbru@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com>
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190308131445.17502-7-armbru@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com>
-
Markus Armbruster authored
Give the queue head type a name: BlockdevOptionsQueue. Rename the queue entry type from BlockdevOptions_queue to BlockdevOptionsQueueEntry. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190308131445.17502-6-armbru@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com>
-
Markus Armbruster authored
The first call of sysbus_get_default() creates the main system bus and stores it in QOM as "/machine/unattached/sysbus". This must not happen before main() creates "/machine", or else container_get() would "helpfully" create it as "container" object, and the real creation of "/machine" would later abort with "attempt to add duplicate property 'machine' to object (type 'container')". Has been that way ever since we wired up busses in QOM (commit f968fc68, v1.2.0). I believe the bug is latent. I got it to bite by trying to qdev_create() a sysbus device from a machine's .instance_init() method. The fix is obvious: store the main system bus in QOM right after creating "/machine". Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20190308131445.17502-5-armbru@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com>
-
Markus Armbruster authored
main() registers the user's -global only after we create the machine object, i.e. too late for devices created in the machine's .instance_init(). Fortunately, we know the bug is only latent: the commit before previous fixed a bug that would've crashed any attempt to create a device in an .instance_init(). Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190308131445.17502-4-armbru@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com>
-
Markus Armbruster authored
Compatibility properties started life as a qdev property thing: we supported them only for qdev properties, and implemented them with the machinery backing command line option -global. Recent commit fa0cb34d put them to use (tacitly) with memory backend objects (subtypes of TYPE_MEMORY_BACKEND). To make that possible, we first moved the work of applying them from the -global machinery into TYPE_DEVICE's .instance_post_init() method device_post_init(), in commits ea9ce893 and b66bbee3, then made it available to TYPE_MEMORY_BACKEND's .instance_post_init() method host_memory_backend_post_init() as object_apply_compat_props(), in commit 1c3994f6. Note the code smell: we now have function name starting with object_ in hw/core/qdev.c. It has to be there rather than in qom/, because it calls qdev_get_machine() to find the current accelerator's and machine's compat_props. Turns out calling qdev_get_machine() there is problematic. If we qdev_create() from a machine's .instance_init() method, we call device_post_init() and thus qdev_get_machine() before main() can create "/machine" in QOM. qdev_get_machine() tries to get it with container_get(), which "helpfully" creates it as "container" object, and returns that. object_apply_compat_props() tries to paper over the problem by doing nothing when the value of qdev_get_machine() isn't a TYPE_MACHINE. But the damage is done already: when main() later attempts to create the real "/machine", it fails with "attempt to add duplicate property 'machine' to object (type 'container')", and aborts. Since no machine .instance_init() calls qdev_create() so far, the bug is latent. But since I want to do that, I get to fix the bug first. Observe that object_apply_compat_props() doesn't actually need the MachineState, only its the compat_props member of its MachineClass and AccelClass. This permits a simple fix: register MachineClass and AccelClass compat_props with the object_apply_compat_props() machinery right after these classes get selected. This is actually similar to how things worked before commits ea9ce893 and b66bbee3, except we now register much earlier. The old code registered them only after the machine's .instance_init() ran, which would've broken compatibility properties for any devices created there. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190308131445.17502-2-armbru@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com>
-
Philippe Mathieu-Daudé authored
The 'boot_splash_filedata_size' was introduced as a global variable in 3d3b8303. This variable is used as a 'size' argument to the fw_cfg_add_file(). This function has an interface contract with its 'data' argument, but there is no such contract for 'size' (this is not a referenced pointer). We can simply remove it. Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Laszlo Ersek <lersek@redhat.com> Message-Id: <20190308013222.12524-7-philmd@redhat.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Kővágó, Zoltán authored
Audio drivers now get an Audiodev * as config paramters, instead of the global audio_option structs. There is some code in audio/audio_legacy.c that converts the old environment variables to audiodev options (this way backends do not have to worry about legacy options). It also contains a replacement of -audio-help, which prints out the equivalent -audiodev based config of the currently specified environment variables. Note that backends are not updated and still rely on environment variables. Also note that (due to moving try-poll from global to backend specific option) currently ALSA and OSS will always try poll mode, regardless of environment variables or -audiodev options. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: e99a7cbdac0d13512743880660b2032024703e4c.1552083282.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-