summaryrefslogtreecommitdiff
path: root/vl.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-12virtio-vga: add '-vga virtio' supportGerd Hoffmann1-0/+13
Some convinience fluff: Add support for '-vga virtio', also add virtio-vga to the list of vga cards so '-device virtio-vga' will turn off the default vga. Written by Dave Airlie and Gerd Hoffmann. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-06-10fw_cfg: insert fw_cfg file blobs via qemu cmdlineGabriel L. Somlo1-0/+63
Allow user supplied files to be inserted into the fw_cfg device before starting the guest. Since fw_cfg_add_file() already disallows duplicate fw_cfg file names, qemu will exit with an error message if the user supplies multiple blobs with the same fw_cfg file name, or if a blob name collides with a fw_cfg name programmatically added from within the QEMU source code. A warning message will be printed if the fw_cfg item name does not begin with the prefix "opt/", which is recommended for external, user provided blobs. Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-06-09QemuOpts: Convert qemu_opt_foreach() to ErrorMarkus Armbruster1-4/+5
Retain the function value for now, to permit selective conversion of its callers. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-06-09QemuOpts: Drop qemu_opt_foreach() parameter abort_on_failureMarkus Armbruster1-2/+2
When the argument is non-zero, qemu_opt_foreach() stops on callback returning non-zero, and returns that value. When the argument is zero, it doesn't stop, and returns the callback's value from the last iteration. The two callers that pass zero could just as well pass one: * qemu_spice_init()'s callback add_channel() either returns zero or exit()s. * config_write_opts()'s callback config_write_opt() always returns zero. Drop the parameter, and always stop. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-06-09QemuOpts: Convert qemu_opts_foreach() to ErrorMarkus Armbruster1-29/+43
Retain the function value for now, to permit selective conversion of its callers. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
2015-06-08QemuOpts: Drop qemu_opts_foreach() parameter abort_on_failureMarkus Armbruster1-17/+18
When the argument is non-zero, qemu_opts_foreach() stops on callback returning non-zero, and returns that value. When the argument is zero, it doesn't stop, and returns the bit-wise inclusive or of all the return values. Funky :) The callers that pass zero could just as well pass one, because their callbacks can't return anything but zero: * qemu_add_globals()'s callback qdev_add_one_global() * qemu_config_write()'s callback config_write_opts() * main()'s callbacks default_driver_check(), drive_enable_snapshot(), vnc_init_func() Drop the parameter, and always stop. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
2015-06-08vl: Fail right after first bad -objectMarkus Armbruster1-1/+1
Failure to create an object with -object is a fatal error. However, we delay the actual exit until all -object are processed. On the one hand, this permits detection of genuine additional errors. On the other hand, it can muddy the waters with uninteresting additional errors, e.g. when a later -object tries to reference a prior one that failed. We generally stop right on the first bad option, so do that for -object as well. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-06-08vl: Print -device help at most onceMarkus Armbruster1-1/+1
We print it once for each -device help. Not helpful. Stop after the first one. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-06-08vl: Report failure to sandbox at most onceMarkus Armbruster1-1/+1
It's reported once per -sandbox on. Stop on the first failure, like we do for other options. Not fixed: "-sandbox on -sandbox off" should leave the sandbox off. It doesn't. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-06-05vl: run "late" notifiers immediatelyPaolo Bonzini1-0/+6
If a machine_init_done notifier is added late, as part of a hot-plugged device, run it immediately. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-06-05icount: add sleep parameter to the icount option to set icount_sleep modeVictor CLEMENT1-0/+3
The 'sleep' parameter sets the icount_sleep mode, which is enabled by default. To disable it, add the 'sleep=no' parameter (or 'nosleep') to the qemu -icount option. Signed-off-by: Victor CLEMENT <victor.clement@openwide.fr> Message-Id: <1432912446-9811-3-git-send-email-victor.clement@openwide.fr> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-06-04Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' ↵Peter Maydell1-14/+16
into staging Patch queue for ppc - 2015-06-03 Highlights this time around: - sPAPR: endian fixes, speedups, bug fixes, hotplug basics - add default ram size capability for machines (sPAPR defaults to 512MB now) # gpg: Signature made Wed Jun 3 22:59:09 2015 BST using RSA key ID 03FEDC60 # gpg: Good signature from "Alexander Graf <agraf@suse.de>" # gpg: aka "Alexander Graf <alex@csgraf.de>" * remotes/agraf/tags/signed-ppc-for-upstream: (40 commits) softmmu: support up to 12 MMU modes tcg: add TCG_TARGET_TLB_DISPLACEMENT_BITS tci: do not use CPUArchState in tcg-target.h Add David Gibson for sPAPR in MAINTAINERS file pseries: Enable in-kernel H_LOGICAL_CI_{LOAD, STORE} implementations spapr: override default ram size to 512MB machine: add default_ram_size to machine class spapr_pci: emit hotplug add/remove events during hotplug spapr_pci: enable basic hotplug operations pci: make pci_bar useable outside pci.c spapr_pci: create DRConnectors for each PCI slot during PHB realize spapr_pci: add dynamic-reconfiguration option for spapr-pci-host-bridge spapr_drc: add spapr_drc_populate_dt() spapr_events: event-scan RTAS interface spapr_events: re-use EPOW event infrastructure for hotplug events spapr_rtas: add ibm, configure-connector RTAS interface spapr: add rtas_st_buffer_direct() helper spapr_rtas: add get-sensor-state RTAS interface spapr_rtas: add set-indicator RTAS interface spapr_rtas: add get/set-power-level RTAS interfaces ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-06-03machine: add default_ram_size to machine classNikunj A Dadhania1-14/+16
Machines types can have different requirement for default ram size. Introduce a member in the machine class and set the current default_ram_size to 128MB. For QEMUMachine types override the value during the registration of the machine and for MachineClass introduce the generic class init setting the default_ram_size. Add helpers [K,M,G,T,P,E]_BYTE for better readability and easy usage Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-06-03vl: fix memory leak spotted by valgrindShannon Zhao1-2/+3
valgrind complains about: ==9276== 13 bytes in 1 blocks are definitely lost in loss record 1,046 of 3,673 ==9276== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9276== by 0x2EAFBB: malloc_and_trace (vl.c:2556) ==9276== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==9276== by 0x4A28BD: addr_to_string (vnc.c:123) ==9276== by 0x4A29AD: vnc_socket_local_addr (vnc.c:139) ==9276== by 0x4A9AFE: vnc_display_local_addr (vnc.c:3240) ==9276== by 0x2EF4FE: main (vl.c:4321) Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-05-31machine: Remove unused fields from QEMUMachineEduardo Habkost1-15/+0
This removes the following fields from QEMUMachine: family, alias, reset, hot_add_cpu, units_per_default_bus, no_serial, no_parallel, use_virtcon, use_sclp, no_floppy, no_cdrom, default_display, compat_props, and hw_version. The only users of those fields were already converted to use QOM and MachineClass directly, so they are not needed anymore. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-05-29gtk: add opengl support, using eglGerd Hoffmann1-1/+10
This adds opengl rendering support to the gtk ui, using egl. It's off by default for now, use 'qemu -display gtk,gl=on' to play with this. Note that gtk got native opengl support with release 3.16. There most likely will be a separate implementation for 3.16+, using the native gtk opengl support. This patch covers older versions (and for the time being 3.16 too, hopefully without rendering quirks). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-05sdl2: add support for display rendering using opengl.Gerd Hoffmann1-0/+23
Add new sdl2-gl.c file, with display rendering functions using opengl. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-03-26Avoid crashing on multiple -incomingDr. David Alan Gilbert1-1/+3
Passing multiple -incoming options used to crash qemu (due to an invalid state transition incoming->incoming). Instead we now take the last -incoming option, e.g.: qemu-system-x86_64 -nographic -incoming tcp::4444 -incoming defer ends up doing the defer. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-19numa: introduce machine callback for VCPU to node mappingIgor Mammedov1-1/+1
Current default round-robin way of distributing VCPUs among NUMA nodes might be wrong in case on multi-core/threads CPUs. Making guests confused wrt topology where cores from the same socket are on different nodes. Allow a machine to override default mapping by providing MachineClass::cpu_index_to_socket_id() callback which would allow it group VCPUs from a socket on the same NUMA node. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-03-19vl: fix resource leak with monitor_fdset_add_fdPaolo Bonzini1-2/+4
monitor_fdset_add_fd returns an AddfdInfo struct (used by the QMP command add_fd). Free it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-03-12configure: opengl overhaulGerd Hoffmann1-0/+1
Rename config option from "glx" to "opengl", glx will not be the only option for opengl in near future. Also switch over to pkg-config for opengl support detection. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-03-10vnc: -readconfig fixGerd Hoffmann1-2/+5
Now that -vnc goes through QemuOpts we can get vnc configuration via -readconfig too. So setting display_remote in the command line parsing code doesn't cut it any more, we must check QemuOpts instead to see whenever any vnc display is configured. Reported-by: Markus Armbruster <armbru@redhat.com> Tested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-03-09Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell1-18/+16
pci, pc, virtio fixes and cleanups A bunch of fixes all over the place. All of ACPI refactoring has been merged. Legacy pci commands have been dropped. virtio header cleanup initial patches from virtio-1.0 branch Signed-off-by: Michael S. Tsirkin <mst@redhat.com> * remotes/mst/tags/for_upstream: (130 commits) acpi: drop unused code aml-build: comment fix acpi-build: fix typo in comment acpi: update generated files vhost user:support vhost user nic for non msi guests aml-build: fix build for glib < 2.22 acpi: update generated files Makefile.target: binary depends on config-devices acpi-test-data: update after pci rewrite acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb(). pci-hotplug-old: Has been dead for five major releases, bury pci: Give a few helpers internal linkage acpi: make build_*() routines static to aml-build.c pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs pc: acpi-build: drop template patching and create PCI bus tree dynamically tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation pc: acpi-build: simplify PCI bus tree generation tests: add ACPI blobs for qemu with bridge cases tests: bios-tables-test: add support for testing bridges tests: ACPI test blobs update due to PCI0._CRS changes ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Conflicts: hw/pci/pci-hotplug-old.c
2015-03-08Merge remote-tracking branch 'remotes/gonglei/tags/bootdevice-next-20150303' ↵Peter Maydell1-14/+22
into staging bootdevice: bug fixes # gpg: Signature made Tue Mar 3 05:18:39 2015 GMT using RSA key ID DDE30FBB # gpg: Good signature from "Gonglei <arei.gonglei@huawei.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 5178 9C82 617F 2F58 8693 63B1 BA7A 65B0 DDE3 0FBB * remotes/gonglei/tags/bootdevice-next-20150303: bootdevice: add check in restore_boot_order() bootdevice: check boot order argument validation before vm running Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-03vl: take iothread lock very earlyPaolo Bonzini1-3/+3
If the iothread lock isn't taken by the main thread, the RCU callbacks might run concurrently with the main thread. QEMU's not ready for that. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Tested-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-03Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell1-4/+8
- more config options - bootdevice, iscsi, virtio-scsi fixes - build system patches for MinGW and config-devices.mak - qemu_mutex_lock_iothread deadlock fixes - another tiny patch from the record/replay series # gpg: Signature made Mon Mar 2 09:59:14 2015 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: cpus: be more paranoid in avoiding deadlocks cpus: fix deadlock and segfault in qemu_mutex_lock_iothread virtio-scsi: Allocate op blocker reason before blocking Makefile.target: binary depends on config-devices Makefile: don't silence mak file test with V=1 Makefile: fix up parallel building under MSYS+MinGW iscsi: Handle write protected case in reopen Give ivshmem its own config option Create specific config option for "platform-bus" Add specific config options for PCI-E bridges bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd' timer: replace time() with QEMU_CLOCK_HOST virtio-scsi-dataplane: Call blk_set_aio_context within BQL block: Forbid bdrv_set_aio_context outside BQL scsi: give device a parent before setting properties Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-03bootdevice: check boot order argument validation before vm runningGonglei1-14/+22
Either 'once' option or 'order' option can take effect for -boot at the same time, that is say initial startup processing can check only one. And pc.c's set_boot_dev() fails when its boot order argument is invalid. This patch provide a solution fix this problem: 1. If "once" is given, register reset handler to restore boot order. 2. Pass the normal boot order to machine creation. Should fail when the normal boot order is invalid. 3. If "once" is given, set it with qemu_boot_set(). Fails when the once boot order is invalid. 4. Start the machine. 5. On reset, the reset handler calls qemu_boot_set() to restore boot order. Should never fail. Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2015-03-03Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-26' ↵Peter Maydell1-45/+57
into staging QemuOpts: Convert various setters to Error # gpg: Signature made Thu Feb 26 13:56:43 2015 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-error-2015-02-26: qtest: Use qemu_opt_set() instead of qemu_opts_parse() pc: Use qemu_opt_set() instead of qemu_opts_parse() qemu-sockets: Simplify setting numeric and boolean options block: Simplify setting numeric options qemu-img: Suppress unhelpful extra errors in convert, amend QemuOpts: Propagate errors through opts_parse() QemuOpts: Propagate errors through opts_do_parse() QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use block: Suppress unhelpful extra errors in bdrv_img_create() qemu-img: Suppress unhelpful extra errors in convert, resize QemuOpts: Convert qemu_opts_set() to Error, fix its use QemuOpts: Convert qemu_opt_set_number() to Error, fix its use QemuOpts: Convert qemu_opt_set_bool() to Error, fix its use Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-02Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into ↵Peter Maydell1-19/+3
staging NUMA fixes queue # gpg: Signature made Mon Feb 23 19:28:42 2015 GMT using RSA key ID 984DC5A6 # gpg: Can't check signature: public key not found * remotes/ehabkost/tags/numa-pull-request: numa: Rename set_numa_modes() to numa_post_machine_init() numa: Rename option parsing functions numa: Move QemuOpts parsing to set_numa_nodes() numa: Make max_numa_nodeid static numa: Move NUMA globals to numa.c vl.c: Remove unnecessary zero-initialization of NUMA globals numa: Move NUMA declarations from sysemu.h to numa.h Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-27timer: replace time() with QEMU_CLOCK_HOSTPavel Dovgalyuk1-4/+8
This patch replaces time() function calls with calls to qemu_clock_get_ns(QEMU_CLOCK_HOST). It makes such requests deterministic in record/replay mode of icount. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20150227131102.11912.89850.stgit@PASHA-ISP> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-26block: Simplify setting numeric optionsMarkus Armbruster1-7/+6
Don't convert numbers to strings for use with qemu_opt_set(), simply use qemu_opt_set_number() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix useMarkus Armbruster1-33/+40
qemu_opt_set() is a wrapper around qemu_opt_set() that reports the error with qerror_report_err(). Most of its users assume the function can't fail. Make them use qemu_opt_set_err() with &error_abort, so that should the assumption ever break, it'll break noisily. Just two users remain, in util/qemu-config.c. Switch them to qemu_opt_set_err() as well, then rename qemu_opt_set_err() to qemu_opt_set(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26QemuOpts: Convert qemu_opts_set() to Error, fix its useMarkus Armbruster1-5/+10
Return the Error object instead of reporting it with qerror_report_err(). Change callers that assume the function can't fail to pass &error_abort, so that should the assumption ever break, it'll break noisily. Turns out all callers outside its unit test assume that. We could drop the Error ** argument, but that would make the interface less regular, so don't. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26QemuOpts: Convert qemu_opt_set_number() to Error, fix its useMarkus Armbruster1-1/+1
Return the Error object instead of reporting it with qerror_report_err(). Change callers that assume the function can't fail to pass &error_abort, so that should the assumption ever break, it'll break noisily. Turns out all callers outside its unit test assume that. We could drop the Error ** argument, but that would make the interface less regular, so don't. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26QemuOpts: Convert qemu_opt_set_bool() to Error, fix its useMarkus Armbruster1-2/+3
Return the Error object instead of reporting it with qerror_report_err(). Change callers that assume the function can't fail to pass &error_abort, so that should the assumption ever break, it'll break noisily. Turns out all callers outside its unit test assume that. We could drop the Error ** argument, but that would make the interface less regular, so don't. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26vl.c: Fix error messages when parsing maxmem parametersPeter Krempa1-18/+16
Produce more human readable error messages and fix few spelling mistakes. Also remove a redundant check for the max memory size. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2015-02-26Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-18' ↵Peter Maydell1-13/+8
into staging Clean up around error_get_pretty(), qerror_report_err() # gpg: Signature made Wed Feb 18 10:10:07 2015 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-error-2015-02-18: qemu-char: Avoid qerror_report_err() outside QMP command handlers qemu-img: Avoid qerror_report_err() outside QMP command handlers vl: Avoid qerror_report_err() outside QMP command handlers tpm: Avoid qerror_report_err() outside QMP command handlers numa: Avoid qerror_report_err() outside QMP command handlers net: Avoid qerror_report_err() outside QMP command handlers monitor: Avoid qerror_report_err() outside QMP command handlers monitor: Clean up around monitor_handle_fd_param() error: Use error_report_err() where appropriate error: New convenience function error_report_err() vhost-scsi: Improve error reporting for invalid vhostfd Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-23numa: Rename set_numa_modes() to numa_post_machine_init()Eduardo Habkost1-1/+1
This function does some initialization that needs to be done after machine init. The function may be eventually removed if we move the CPUState.numa_node initialization to the CPU init code, but while the function exists, lets give it a name that makes sense. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-23numa: Rename option parsing functionsEduardo Habkost1-1/+1
Renaming set_numa_nodes() and numa_init_func() to parse_numa_opts() and parse_numa() makes the purpose of those functions clearer. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-23numa: Move QemuOpts parsing to set_numa_nodes()Eduardo Habkost1-5/+0
This allows us to make numa_init_func() static. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-23numa: Move NUMA globals to numa.cEduardo Habkost1-4/+0
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-23vl.c: Remove unnecessary zero-initialization of NUMA globalsEduardo Habkost1-8/+0
There's no need to zero-initialize globals, they are automatically initialized to zero. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-23numa: Move NUMA declarations from sysemu.h to numa.hEduardo Habkost1-0/+1
Not all sysemu.h users need the NUMA declarations, and keeping them in a separate file makes it easier to see what are the interfaces provided by numa.c. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-18hmp: Name HMP command handler functions hmp_COMMAND()Markus Armbruster1-2/+2
Some are called do_COMMAND() (old ones, usually), some hmp_COMMAND(), and sometimes COMMAND pointlessly differs in spelling. Normalize to hmp_COMMAND(), where COMMAND is exactly the command name with '-' replaced by '_'. Exceptions: * do_device_add() and client_migrate_info() *not* renamed to hmp_device_add(), hmp_client_migrate_info(), because they're also QMP handlers. They still need to be converted to QAPI. * do_memory_dump(), do_physical_memory_dump(), do_ioport_read(), do_ioport_write() renamed do hmp_* instead of hmp_x(), hmp_xp(), hmp_i(), hmp_o(), because those names are too cryptic for my taste. * do_info_help() renamed to hmp_info_help() instead of hmp_info(), because it only covers help. Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-02-18vl: Avoid qerror_report_err() outside QMP command handlersMarkus Armbruster1-4/+2
qerror_report_err() is a transitional interface to help with converting existing monitor commands to QMP. It should not be used elsewhere. Replace by error_report_err() in initial startup helpers machine_set_property() and object_create(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-18error: Use error_report_err() where appropriateMarkus Armbruster1-9/+6
Coccinelle semantic patch: @@ expression E; @@ - error_report("%s", error_get_pretty(E)); - error_free(E); + error_report_err(E); @@ expression E, S; @@ - error_report("%s", error_get_pretty(E)); + error_report_err(E); ( exit(S); | abort(); ) Trivial manual touch-ups in block/sheepdog.c. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-10vl.c: fix memory leak spotted by valgrindChristian Borntraeger1-0/+1
valgrind complains about: ==42062== 16 bytes in 1 blocks are definitely lost in loss record 387 of 1,048 ==42062== at 0x402DCB2: malloc (vg_replace_malloc.c:299) ==42062== by 0x40C1BE3: g_malloc (in /usr/lib64/libglib-2.0.so.0.3800.2) ==42062== by 0x40DA133: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3800.2) ==42062== by 0x40DB2E5: g_slist_prepend (in /usr/lib64/libglib-2.0.so.0.3800.2) ==42062== by 0x801637FF: object_class_get_list_tramp (object.c:690) ==42062== by 0x40A96C9: g_hash_table_foreach (in /usr/lib64/libglib-2.0.so.0.3800.2) ==42062== by 0x80164885: object_class_foreach (object.c:665) ==42062== by 0x80164975: object_class_get_list (object.c:698) ==42062== by 0x800100A5: machine_parse (vl.c:2447) ==42062== by 0x800100A5: main (vl.c:3756) Lets free machines in case of mc. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-02-10vl: Fix bogus error message for implied mon ID clashingMarkus Armbruster1-2/+4
monitor_parse() desugars --monitor, --qmp and -qmp-pretty to --mon. The ID it picks can clash with a user-specified ID. When it happens, the error message is misleading. Reproducer: $ qemu --mon id=compat_monitor0 --monitor stdio Message before the patch: duplicate chardev: compat_monitor0 There's no "duplicate chardev" here. The problem is a duplicate monitor ID. Moreover, the message provides no clue which option caused the problem. The patch changes the message to: qemu: --monitor stdio: Duplicate ID 'compat_monitor0' for mon monitor_parse() is also used for creating a default monitor, but that's not done when the user specifies a monitor, so an ID clash is impossible then. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-01-22vnc: switch to QemuOpts, allow multiple serversGerd Hoffmann1-29/+13
This patch switches vnc over to QemuOpts, and it (more or less as side effect) allows multiple vnc server instances. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22vnc: remove unused DisplayState parameter, add id instead.Gerd Hoffmann1-3/+4
DisplayState isn't used anywhere, drop it. Add the vnc server ID as parameter instead, so it is possible to specify the server instance. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>