History | View | Annotate | Download (5.5 kB)
Purge migration of (almost) everything to do with monitors
The Monitor object is passed back and forth within the migration/savevmcode so that it can print errors and progress to the user.
However, that approach assumes a HMP monitor, being completely invalid...
qapi: Convert migrate
The migrate command is one of those commands where HMP and QMP completelymix up together. This made the conversion to the QAPI (which separates thecommand into QMP and HMP parts) a bit difficult.
The first important change to be noticed is that this commit completes the...
suspend: make acpi timer wakeup the guest.
Make the acpi timer wake up the guest.Guests can enable/disable this via acpi too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
suspend: make rtc alarm wakeup the guest.
Make the rtc wake up the guest when the alarm fires.Add acpi windup to property support RTC_EN, so guestscan enable and disable this.
suspend: add infrastructure
This patch adds some infrastructure to handle suspend and resume toqemu. First there are two functions to switch state and second thereis a suspend notifier:
mc146818rtc: Use lost_tick_policy property
Allow to configure the MC146818 RTC via the new lost tick policyproperty and replace rtc_td_hack with this mechanism.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm: x86: Establish IRQ0 override control
KVM is forced to disable the IRQ0 override when we run with in-kernelirqchip but without IRQ routing support of the kernel. Set the fwcfgvalue correspondingly. This aligns us with qemu-kvm.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Add generic drive hotplugging
The monitor command for hotplugging is in i386 specific code. This is justplain wrong, as S390 just learned how to do hotplugging too and needs toget drives for that.
So let's add a generic copy to generic code that handles drive_add in a...
pcie_aer: adjust do_pcie_aer_inejct_error -> do_pcie_aer_inject_error
This function name is a bit wrong. Although it doesn't impact function, it is a bit necessary that we should fixup it.
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
main-loop: create main-loop.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
runstate: Allow user to migrate twice
It should be a matter of allowing the transition POSTMIGRATE ->FINISH_MIGRATE, but it turns out that the VM won't do thetransition the second time because it's already stopped.
So this commit also adds vm_stop_force_state() which performs...
RunState: Drop the RSTATE_NO_STATE value
The QAPI framework won't generate it, so we need to get rid of it.
In order to do that, this commit makes RSTATE_PRE_LAUNCH the initialstate and change qemu_vmstop_requested() to use RSTATE_MAX.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
RunState: Rename enum values as generated by the QAPI
Next commit will convert the query-status command to use theRunState type as generated by the QAPI.
In order to "transparently" replace the current enum by the QAPIone, we have to make some changes to some enum values....
qapi: Convert query-status
Please, note that the RunState type as defined in sysemu.h and itsrunstate_as_string() function are being dropped in favor of theRunState type generated by the QAPI.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.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 vm_running global variable
Use runstate_is_running() instead, which is introduced by this commit.
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.
Move vm_state_notify() prototype from cpus.h to sysemu.h
It's where all the state handling functions prototypes are located.
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>...
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...
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>
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.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
migration: move some declarations to migration.h
Move a few migration related declarations to migration.h.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Move CPU related functions to cpus.h
Move declarations of CPU related functions to cpus.h. Adjust the only user.
Move clock related functions to qemu-timer.h
Move declarations for clock related functions from sysemu.h to qemu-timer.h.
Move generic or OS function declarations to qemu-common.h
Move generic or OS related function declarations and macroTFR to qemu-common.h.
Move win32 include directives to qemu-os-win32.h. While moving,also add #include <winsock2.h> to fix a recent mingw32...
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.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
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>...
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...
audio: consolidate audio_init()
consolidate audio_init() and remove references to shoundhw.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
savevm: Fix no_migrate
The no_migrate save state flag is currently only checked in thelast phase of migration. This means that we potentially wastea lot of time and bandwidth with the live state handlers beforewe ever check the no_migrate flags. The error message printed...
Merge remote branch 'origin/master' into pci
Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu
pcie/aer: glue aer error injection into qemu monitor
introduce pcie_aer_inject_error command.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.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....
Use display types for local display only.
This patch drops DT_VNC. The display types are only used to selectselect the local display (i.e. curses, sdl, coca, ...). Remotedisplays (for now only vnc, spice will follow) can be enabledindependently.
migration: Accept 'cont' only after successful incoming migration
When a 'cont' is issued on a VM that's just waiting for an incomingmigration, the VM reboots and boots into the guest, possibly corruptingits storage since it could be shared with another VM running elsewhere....
pci hotplug: make pci_device_hot_remove() static
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Add exit notifiers.
Hook up any cleanup work which needs to be done here. Advantages overusing atexit(3):
(1) You get passed in a pointer to the notifier. If you embed that into your state struct you can use container_of() to get get your state info....
Merge remote branch 'kwolf/for-anthony' into staging
Conflicts: hw/pc.c
Introduce OS specific cmdline argument handling and move SMB arg to os-posix.c
Introduce OS specific cmdline argument handling by callingos_parse_cmd_args() at the end of switch() statement. Move optionenum to qemu-options.h and have it included from os-posix.c and...
Move daemonize handling to OS specific files
Move daemonize handling from vl.c to OS specific files. Provide dummystubs for Win32.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Richard Henderson <rth@redhat.com>...
Create qemu-os-win32.h and move WIN32 specific declarations there
Create qemu-os-win32.h for WIN32 specific declarations. Move pollinghandling declaration into this file from sysemu.h
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>...
vl.c: Move host_main_loop_wait() to OS specific files.
Move host_main_loop_wait() to OS specific files. Createqemu-os-posix.h and provide empty inline for the POSIX case.
Move win32 early signal handling setup to os_setup_signal_handling()
Rename os_setup_signal_handling() to os_setup_early_signal_handling()
Move find_datadir to OS specific files.
This moves the win32 and POSIX versions of find_datadir() to OSspecific files, and removes some #ifdef clutter from vl.c
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev: Hide QEMUMachine from drive_init()
To pave the way for moving it out of vl.c.
qdev: Move declaration of qdev_init_bdrv() into qdev.h
blockdev: Belatedly remove MAX_DRIVES
Unused since commit 751c6a17.
blockdev: Belatedly remove driveopts
Unused since commit 9dfd7c7a.
sysemu: Export 'no_shutdown'
It's a global variable already, do_quit() will use it.
Revert "Monitor: Return before exiting with 'quit'"
This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d.
Next commits will do the same thing in a better way.
Revert "PCI: Convert pci_device_hot_add() to QObject"
Short story: We don't want pci_add in QMP. Long story follows.
pci_add can do two things:
Revert "monitor: Convert do_pci_device_hot_remove() to QObject"
We don't want pci_del in QMP. Use device_del instead.
This reverts commit 6848d827162fea039f2658414a4adb6164a4f9b0.
Conflicts:
hw/pci-hotplug.c sysemu.h
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Monitor: Return before exiting with 'quit'
The 'quit' Monitor command (implemented by do_quit()) callsexit() directly, this is problematic under QMP because QEMUexits before having a chance to send the ok response.
Clients don't know if QEMU exited because of a problem or...
Refactor target specific handling, compile vl.c only once
Move target specific functions and RAM handling to arch_init.c.
Add a flag to QEMUOptions structure to indicate for whicharchitectures the option is allowed, check the flagin run time and remove conditional code in option handling....
error: Trim includes after "Move qemu_error & friends..."
Missed in commit 2f792016.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Revert "Add exit notifiers"
This reverts commit 3b6304f706ef7eebc0b3b3f3a5093ec75448ee19.
This was mistakenly committed.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add exit notifiers
Like atexit() but with state
disentangle tcg and deadline calculation
Just tell main_loop_wait whether to be blocking or nonblocking, so thatthere is no need to call qemu_cpus_have_work from the timer subsystem.Instead, tcg_cpu_exec can say "we want the main loop not to block because...
savevm: Fix -loadvm to report errors to stderr, not the monitor
A monitor may not even exist.
Change load_vmstate() to use qemu_error() instead of monitor_printf().Parameter mon is now unused, remove it.
error: Simplify error sink setup
qemu_error_sink can either point to a monitor or a file. In practice,it always points to the current monitor if we have one, else tostderr. Simply route errors to the current monitor or else to stderr,and remove qemu_error_sink along with the functions to control it....
error: Move qemu_error & friends into their own header
QMP: Introduce RTC_CHANGE event
Emitted whenever the RTC time changes.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load relatedsynchronization points in favor of four(!) generic hooks:
- cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave)...
Monitor: Convert pci_device_hot_add() to cmd_new_ret()
Monitor: Convert pci_device_hot_remove() to cmd_new_ret()
virtio-console: qdev conversion, new virtio-serial-bus
This commit converts the virtio-console device to create a newvirtio-serial bus that can host console and generic serial ports. Thefile hosting this code is now called virtio-serial-bus.c.
The virtio console is now a very simple qdev device that sits on the...
PCI: Convert pci_device_hot_add() to QObject
Return a QDict with information about the just added device.
This commit should not change user output.
Please, note that this patch does not do error handlingconversion. In error conditions the handler still calls...
Rename DriveInfo.onerror to on_write_error
Either rename variables and functions to refer to write errors (which is whatthey actually do) or introduce a parameter to distinguish reads and writes.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Introduce rerror option for drives
rerror controls the action to be taken when an error occurs while accessing theguest image file. It corresponds to werror which already controls the actiontake for write errors.
This purely introduces parsing rerror command line option into the right...
live migration: Allow cleanup after cancellation or error
Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel alive migration. This gives the involved subsystems a chance to clean updynamically allocated resources. Namely, the block migration layer can...
live migration: Propagate output monitor to callback handler
In order to allow proper progress reporting to the monitor thatinitiated the migration, forward the monitor reference through themigration layer down to SaveLiveStateHandler.
monitor: QError support
This commit adds QError support in the Monitor.
A QError member is added to the Monitor struct. This new memberstores error information and is also used to check if an errorhas occurred when the called handler returns.
Additionally, a new macro called qemu_error_new() is introduced....
Block live migration
This patch introduces block migration called during live migration. Blockare being copied to the destination in an async way. First the code willtransfer the whole disk and then transfer all dirty blocks accumulted duringthe migration....
net: move more stuff into net/tap-win32.c, add net/tap.h
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor: Convert do_pci_device_hot_remove() to QObject
Errors are still directly printed, as we are only convertingregular output.
kill dead nic unplug code.
Cleanup on unplug happens via qdev->exit() callback now.
offer right-ctrl as a grab option
Add support for -ctrl-grab to use the right-ctrl button to grab/releasethe mouse in SDL.
The multi-button ctrl-alt and ctrl-alt-shift grab buttons present anaccessibility problem to users who cannot press more than one button...
pci: windup acpi-based hotplug
Switch over acpi-based PCI hotplug for pc over to the newqdev-based pci hotplugging.
drive cleanup fixes.
Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the...
Enable host-clock-based RTC
Switch RTC emulations to the new host_clock instead of vm_clock bydefault. This has the advantage that the emulated RTC will followautomatically the host time while it might be tuned via NTP. vm_clockcan still be selected by passing '-rtc clock=vm' on the command line....
Compile loader only once
Callers must pass ELF machine, byte swapping and symbol LSB clearinginformation to ELF loader. A.out loader needs page size information, passthat too as a parameter.
Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw....
x86: move a declaration to header
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
monitor: Port handler_1 to use QDict
This commit ports command handlers that receive one argument to usethe new monitor's dictionary.
monitor: Port handler_2 to use QDict
This commit ports command handlers that receive two arguments to usethe new monitor's dictionary.
monitor: Port handler_3 to use QDict
This commit ports command handlers that receive three arguments to usethe new monitor's dictionary.
Add wrappers to functions used by the Monitor
Some functions exported to be used by the Monitor as commandhandlers are also called in other places as regular functions.
When those functions got ported to use the Monitor dictionaryto pass argments, the callers will have to setup a dictionary...
switch balloon initialization to -device.
With that patch applied "-balloon virtio,args" becomes a shortcut for"-device virtio-balloon-pci,args".
Side effects: - ballon device gains support for id=<tag>. - ballon device is off by default now. - initialization order changes, which may in different pci slot...
add qemu_error() + friends
This patch adds some functions for error reporting to address theproblem that error messages should be routed to different destinationsdepending on the context of the caller, i.e. monitor command errorsshould go to the monitor, command line errors to stderr....