History | View | Annotate | Download (99.8 kB)
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Fix termination by signal with -no-shutdown
On signals such as SIGTERM qemu should exit instead of just stopping the VMeven with -no-shutdown.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Replace the VMSTOP macros with a proper state type
Today, when notifying a VM state change with vm_state_notify(),we pass a VMSTOP macro as the 'reason' argument. This is not idealbecause the VMSTOP macros tell why qemu stopped and not exactlywhat the current VM state is....
RunState: Add additional states
Currently, only vm_start() and vm_stop() change the VM state.That's, the state is only changed when starting or stopping the VM.
This commit adds the runstate_set() function, which makes it possibleto also do state transitions when the VM is stopped or running....
runstate_set(): Check for valid transitions
This commit could have been folded with the previous one, howeverdoing it separately will allow for easy bisect and revert if needed.
Checking and testing all valid transitions wasn't trivial, chancesare this will need broader testing to become more stable....
Drop the incoming_expected global variable
Test against RSTATE_IN_MIGRATE instead.
Please, note that the RSTATE_IN_MIGRATE state is only set when all theinitial VM setup is done, while 'incoming_expected' was set right inthe beginning when parsing command-line options. Shouldn't be a problem...
Drop the vm_running global variable
Use runstate_is_running() instead, which is introduced by this commit.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Monitor/QMP: Don't allow cont on bad VM state
We have two states where issuing cont before system_reset cancause problems: RSTATE_SHUTDOWN (when -no-shutdown is used) andRSTATE_PANICKED (which only happens with kvm).
This commit fixes that by doing the following when state is...
QMP: query-status: Introduce 'status' key
This new key reports the current VM status to clients. Please, checkthe documentation being added in this commit for more details.
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Don't use g_thread_get_initialized.
Initialize glib threads unconditionally in main() insteadof using g_thread_get_initialized in the 9p code.
Fixes a build failure on RHEL-5, which ships glib 2.12.g_thread_get_initialized was added in 2.20.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
Fix comment (install patch -> install path)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
rename qemu_malloc and related to glib names for coherence
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Frediano Ziglio <freddy77@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
main: force enabling of I/O thread
Enabling the I/O thread by default seems like an important part of declaring1.0. Besides allowing true SMP support with KVM, the I/O thread means that theTCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which...
Merge remote-tracking branch 'stefanha/tracing' into staging
Add glib support to main loop
This allows GSources to be used to register callback events in QEMU. This isuseful as it allows us to take greater advantage of glib and also because itallows us to write code that is more easily testable outside of QEMU since we...
trace: add "-trace events" argument to control initial state
The "-trace events" argument can be used to provide a file with a list of traceevent names that will be enabled prior to starting execution, thus providingearly tracing.
This saves the user from manually toggling event states through the monitor...
trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*
Provides a more hierarchical view of the variable domain.
Also adds the CONFIG_TRACE_* variables for all backends.
[Stefan added missing 'test' in stap if statement]
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>...
trace: move backend-specific code into the trace/ directory
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
trace: avoid conditional code compilation during option parsing
A default implementation for backend-specific routines is provided in"trace/default.c", which backends can override by setting "trace_default=no" in"configure".
Do not drop global mutex for polled main loop runs
If we call select without a timeout, it's more efficient to keep theglobal mutex locked as we may otherwise just play ping pong with avcpu thread contending for it. This is particularly important for TCG...
Poll main loop after I/O events were received
Polling until select returns empty fdsets helps to reduce the switchesbetween iothread and vcpus. The benefit of this patch is best visiblewhen running an SMP guest on an SMP host in emulation mode.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
char: rename qemu_chr_open() -> qemu_chr_new()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
char: qemu_chr_open_opts() -> qemu_chr_new_from_opts()
Add trace points for g_malloc/g_free functions
Derived from a patch submitted by Avi Kivity.
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Reorder default ram_size initialization
code_gen_alloc depends on it, and that is now called earlier viaconfigure_accelerator.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Avoid allocating TCG resources in non-TCG mode
Do not allocate TCG-only resources like the translation buffer whenrunning over KVM or XEN. Saves a "few" bytes in the qemu address spaceand is also conceptually cleaner.
Merge remote-tracking branch 'agraf/xen-next' into staging
Allow to leave type on default in -machine
This allows to specify -machine options without setting an explicitmachine type. We will pick the default machine in this case. Requestingthe list of available machines is still possible via '-machine ?' e.g....
showing a splash picture when start
Added options to let qemu transfer two configuration files to bios:"bootsplash.bmp" and "etc/boot-menu-wait", which could be specified by command -boot splash=P,splash-time=TP is jpg/bmp file name or an absolute path, T have a max value of 0xffff, unit...
vl.c: Check the asked ram_size later.
As a Xen guest can have more than 2GB of RAM on a 32bit host, we movethe conditions after than we now if we run one Xen or not.
[agraf] separate xen branch from ram_size check
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
notifier: Pass data argument to callback
This allows to pass additional information to the notifier callbackwhich is useful if sender and receiver do not share any other distinctdata structure.
Will be used first for the clock reset notifier.
vl.c: Don't limit node count by smp count
[I've sent this patch couple of months ago and noticed it didn't make it's way in - so I'm sending it again]
It is possible to create CPU-less NUMA nodes, node amount shouldn't belimited by amount of CPUs.
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>...
do not reset no_shutdown after we shutdown the vm
Daniel P. Berrange sent a libvirt's patch to supportreboots with the QEMU driver. He implements it injson model like this:1. add -no-shutdown in the qemu's option: qemu -no-shutdown xxxx2. shutdown the vm by monitor command system_powerdown...
Generalize -machine command line option
-machine somehow suggests that it selects the machine, but it doesn't.Fix that before this command is set in stone.
Actually, -machine should supersede -M and allow to introduce arbitraryper-machine options to the command line. That will change the internal...
pxa2xx_lcd: add proper rotation support
Until now, pxa2xx_lcd only supported 90deg rotation, butsome machines (for example Zipit Z2) needs 270deg rotation.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Allow silent system resets
This allows qemu_system_reset to be issued silently for internalpurposes, ie. without sending out a monitor event. Convert the systemreset after startup to the silent mode.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Introduce format string for pid_t
BeOS and Haiku on i386 use long for 32-bit types, including pid_t.Using %d with pid_t therefore results in a warning.
Unfortunately POSIX:2008 does not define a PRId* string for pid_t.
In some places pid_t was previously casted to long and %ld hardcoded....
Command line support for altering the log file location
Add command line support for logging to a location other than /tmp/qemu.log.
With logging enabled (command line option -d), the log is written tothe hard-coded path /tmp/qemu.log. This patch adds support for writing...
usb: don't call usb_host_device_open from vl.c
Not needed any more, usb-host is qdev-ified these days.Well, at least the linux version ...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Merge remote-tracking branch 'spice/spice.v37' into staging
Conflicts: vl.c
isa-vga: Make available with -device, like the other VGA qdevs
Switch no_user off and make it suppress the default VGA.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix regression introduced by -machine accel=
Commit 85097db6 changed the timing when kvm_allowed is set until afterkvm is initialized. During initialization, the ioeventfd initialization codechecks kvm_enabled() and after this change, ioeventfd is effectively disabled....
qxl: add to the list of devices which disable the default vga
defaults: ide-cd, ide-hd and scsi-cd devices suppress default CD-ROM
ide-hd has to suppress the default CD-ROM, or else you can't put oneon secondary master without -nodefaults.
Unlike legacy scsi-disk, scsi-cd suppresses default CD-ROM.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
vl.c: Introduce getter for shutdown_requested and reset_requested.
Introduce two functions qemu_shutdown_requested_get andqemu_reset_requested_get to get the value of shutdown/reset_requestedwithout reset it.
xen: Add initialisation of Xen
The xenpv machine use the common init function.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
Introduce -machine command option.
This option gives the ability to switch one "accelerator" like kvm, xenor the default one tcg. We can specify more than one accelerator byseparate them by a colon. QEMU will try each one and use the first whoseworks....
machine, Add default_machine_opts to QEMUMachine.
With this new field, we can specified which accelerator use to run themachine, if the accelerator is not already specified by either aconfiguration file or the command line options.
Currently, the only use will be made in the xenfv machine....
vl.c: Replace -virtfs string manipulation with QemuOpts
The -virtfs option creates an fsdev representing the pass-through filesystem and a guest-visible virtio-9p-pci device that can access thisfile system. This patch replaces the string manipulation used to build...
vl: trivial spelling fix
Signed-off-by: Brad Hards <bradh@frogmouth.net>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
exit if -drive specified is invalid instead of ignoring the "wrong" -drive
This fixes the problem when qemu continues even if -drive specificationis somehow invalid, resulting in a mess. Applicable for both currentmaster and for stable-0.14 (and the same issue exist 0.13 and 0.12 too)....
virtio: use generic name when possible
We have two different virtio buses: pci and s390. The abstraction pathtaken in qemu is to have generic aliases for each device type in thearchitecture specific qdev devices.
So let's make use of these aliases whenever we can and define them...
register signal handler after initializing SDL.
SDL library initialization mangles signal handlers, so QEMU shouldregister them after initializing SDL. This was the case before and codeeven have a comment about that. Fix it to be so again.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
vl.c: Tidy up message printed when we exit on a signal
Tidy up the message printed when qemu exits due to a signal, so thatit's clearer where the message is coming from and that it's not juststray debug output.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
extract I/O handler lists to iohandler.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
report that QEMU process was killed by a signal
Currently when rogue script kills QEMU process (using TERM/INT/HUPsignal) it looks indistinguishable from system shutdown. Lets reportthat QEMU was killed and leave some clues about the killer identity.
vl.c: Fix compilation failure if CONFIG_SDL isn't defined
Fix a compilation failure if CONFIG_SDL isn't defined (gcc complainedthat the label 'invalid_display' wasn't used).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
error message if user specifies SDL cmd line option when SDL is disabled
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
error message if user specifies curses on cmd line when curses is disabled
Make VNC support optional
Per default VNC is enabled.
Introduce -display argument
This patch introduces a -display argument which consolidates thesetting of the display mode. Valid options are:sdl/curses/default
Introduce -display none
New option -display none. This option differs from -nographic by nottrying to take control of stdio etc. but instead behaves as if agraphics display is enabled, except that it doesn't show one.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
Add support for -display vnc
Merge remote branch 'qemu-kvm/uq/master' into staging
change all rt_clock references to use millisecond resolution accessors
This was done with:
sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
simpletrace: Move st_init() error reporting
User emulator builds do not have error_report() so it should not be usedby simpletrace.c. In fact, error reporting inside simpletrace.c isinappropriate and should be done by the caller instead.
This patch moves st_init() error reporting out to its caller,...
Synchronize VCPU states before reset
This is required to support keeping VCPU states across a system reset.If we do not read the current state before the reset,cpu_synchronize_all_post_reset may write back incorrect stateinformation.
The first user of this will be MCE MSR synchronization which currently...
simpletrace: Thread-safe tracing
Trace events outside the global mutex cannot be used with the simpletrace backend since it is not thread-safe. There is no check to preventthem being enabled so people sometimes learn this the hard way.
This patch restructures the simple trace backend with a ring buffer...
Improve vm_stop reason declarations
Define and use dedicated constants for vm_stop reasons, they actuallyhave nothing to do with the EXCP_* defines used so far. At this chance,specify more detailed reasons so that VM state change handlers canevaluate them....
Refactor debug and vmstop request interface
Instead of fiddling with debug_requested and vmstop_requested directly,introduce qemu_system_debug_request and turn qemu_system_vmstop_requestinto a public interface. This aligns those services with exiting ones in...
Move debug exception handling out of cpu_exec
To prepare splitting up KVM and TCG CPU entry/exit, move the debugexception into cpus.c and invoke cpu_handle_debug_exception on returnfrom qemu_cpu_exec.
This also allows to clean up the debug request signaling: We can assign...
Stop current VCPU on synchronous reset requests
If some I/O operation ends up calling qemu_system_reset_request in VCPUcontext, we record this and inform the io-thread, but we do notterminate the VCPU loop. This can lead to fairly unexpected behavior if...
Process vmstop requests in IO thread
A pending vmstop request is also a reason to leave the inner main loop.So far we ignored it, and pending stop requests issued over VCPU threadswere simply ignored.
Leave inner main_loop faster on pending requests
If there is any pending request that requires us to leave the inner loopif main_loop, makes sure we do this as soon as possible by enforcingnon-blocking IO processing.
At this change, move variable definitions out of the inner loop to...
Flatten the main loop
First of all, vm_can_run is a misnomer, it actually means "no requestpending". Moreover, there is no need to check all pending requeststwice, the first time via the inner loop check and then again whenactually processing the requests. We can simply remove the inner loop...
do not pass NULL to strdup.
Also use qemu_strdup() instead of strdup() in bootindex code.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
aliguori: fix build with !defined(KVM_CAP_ASYNC_PF)
blockdev: Fix drive_add for drives without media
Watch this:
(qemu) drive_add 0 if=none (qemu) info block none0: type=hd removable=0 [not inserted] (qemu) drive_del none0 Segmentation fault (core dumped)
add_init_drive() is confused about drive_init()'s failure modes, and...
blockdev: Replace drive_add()'s fmt, ... by optstr parameter
Let the callers build the optstr. Only one wants to. All the othersbecome simpler, because they don't have to worry about escaping '%'.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev: Reject multiple definitions for the same drive
We silently ignore multiple definitions for the same drive:
$ qemu-system-x86_64 -nodefaults -vnc :1 -S -monitor stdio -drive if=ide,index=1,file=tmp.qcow2 -drive if=ide,index=1,file=nonexistant...
blockdev: Make drive_add() take explicit type, index parameters
Before, type & index were hidden in printf-like fmt, ... parameters,which get expanded into an option string. Rather inconvenient foruses later in this series.
New IF_DEFAULT to ask for the machine's default interface. Before,...
Make strtosz() return int64_t instead of ssize_t
strtosz() needs to return a 64 bit type even on 32 bitarchitectures. Otherwise qemu-img will fail to create diskimages >= 2GB
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
kvm: Drop smp_cpus argument from init functions
No longer used.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Merge remote branch 'mst/for_anthony' into staging
Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu
Fix a missing trailing newline
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
qbus: register reset handler for qbus whose parent is NULL
Stefan Weil reported the regression caused byec990eb622ad46df5ddcb1e94c418c271894d416 as follows
The second regression also occurs with MIPS malta.Networking no longer works with the default pcnet nic....
Avoid a warning from OpenBSD linker
Avoid the warning below by using snprintf:../libhw64/vl.o(.text+0x78d4): In function `get_boot_devices_list':/src/qemu/vl.c:763: warning: sprintf() is often misused, please use snprintf()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add notifier that will be called when machine is fully created.
Action that depends on fully initialized device model should registerwith this notifier chain.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Pass boot device list to firmware.
Add bootindex for option roms.
Extend -option-rom command to have additional parameter ,bootindex=.
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes devicein firmware readable way is added into sorted list. Later this list willbe passed into firmware to control boot order.
spice: add qxl device
qxl is a paravirtual graphics card. The qxl device is the bridgebetween the guest and the spice server (aka libspice-server). Thespice server will send the rendering commands to the spice client, whichwill actually render them....
Merge remote branch 'origin/master' into pci
Conflicts: Makefile.objs hw/virtio.c
qdev: reset qdev along with qdev tree
This patch changes the reset handling so that qdev has no knowledge of theglobal system reset. Instead, a new bus/device level function is introducedthat allows all devices/buses on the bus/device to be reset using a depth...
trace: Trace vm_start()/vm_stop()
VM state change notifications are invoked from vm_start()/vm_stop().Trace these state changes so we can reason about the state of the VMfrom trace output.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Delete IOHandlers after potentially running them
Since commit 4bed9837309e58d208183f81d8344996744292cf an .fd_read()handler that deletes its IOHandler is exposed to .fd_write() beingcalled on the deleted IOHandler.
This patch fixes deletion so that .fd_read() and .fd_write() are never...
Introduce strtosz() library function to convert a string to a byte count.
strtosz() returns -1 on error. It now supports human unit formats ineg. 1.0G, with better error handling.
The following suffixes are supported:B/b = bytesK/k = KBM/m = MBG/g = GB...