summaryrefslogtreecommitdiffstats
path: root/sysemu.h
Commit message (Collapse)AuthorAgeFilesLines
* Add MigrationParams structureIsaku Yamahata2012-06-291-1/+2
| | | | Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* qapi: Convert migrateLuiz Capitulino2012-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The migrate command is one of those commands where HMP and QMP completely mix up together. This made the conversion to the QAPI (which separates the command into QMP and HMP parts) a bit difficult. The first important change to be noticed is that this commit completes the removal of the Monitor object from migration code, started by the previous commit. Another important and tricky change is about supporting the non-detached mode. That is, if the user doesn't pass '-d' the migrate command will lock the monitor and will only release it when migration is finished. To support this in the new HMP command (hmp_migrate()), it is necessary to create a timer which runs every second and checks if the migration is still active. If it is, the timer callback will re-schedule itself to run one second in the future. If the migration has already finished, the monitor lock is released and the user can use it normally. All these changes should be transparent to the user. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Purge migration of (almost) everything to do with monitorsLuiz Capitulino2012-03-151-5/+4
| | | | | | | | | | | | | | | | | The Monitor object is passed back and forth within the migration/savevm code so that it can print errors and progress to the user. However, that approach assumes a HMP monitor, being completely invalid in QMP. This commit drops almost every single usage of the Monitor object, all monitor_printf() calls have been converted into DPRINTF() ones. There are a few remaining Monitor objects, those are going to be dropped by the next commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* suspend: make acpi timer wakeup the guest.Gerd Hoffmann2012-02-241-0/+1
| | | | | | | | 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.Gerd Hoffmann2012-02-241-0/+1
| | | | | | | | | Make the rtc wake up the guest when the alarm fires. Add acpi windup to property support RTC_EN, so guests can enable and disable this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: add infrastructureGerd Hoffmann2012-02-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds some infrastructure to handle suspend and resume to qemu. First there are two functions to switch state and second there is a suspend notifier: * qemu_system_suspend_request is supposed to be called when the guest asks for being be suspended, for example via ACPI. * qemu_system_wakeup_request is supposed to be called on events which should wake up the guest. * qemu_register_suspend_notifier can be used to register a notifier which will be called when the guest is suspended. Machine types and device models can hook in there to modify state if needed. * qemu_register_wakeup_notifier can be used to register a notifier which will be called when the guest is woken up. Machine types and device models can hook in there to modify state if needed. * qemu_system_wakeup_enable can be used to enable/disable wakeup events. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* mc146818rtc: Use lost_tick_policy propertyJan Kiszka2012-02-011-1/+0
| | | | | | | | Allow to configure the MC146818 RTC via the new lost tick policy property 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 controlJan Kiszka2012-01-191-1/+0
| | | | | | | | KVM is forced to disable the IRQ0 override when we run with in-kernel irqchip but without IRQ routing support of the kernel. Set the fwcfg value correspondingly. This aligns us with qemu-kvm. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* Add generic drive hotpluggingAlexander Graf2012-01-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | | The monitor command for hotplugging is in i386 specific code. This is just plain wrong, as S390 just learned how to do hotplugging too and needs to get drives for that. So let's add a generic copy to generic code that handles drive_add in a way that doesn't have pci dependencies. All pci specific code can then be handled in a pci specific function. Signed-off-by: Alexander Graf <agraf@suse.de> --- v1 -> v2: - align generic drive_add to pci specific one - rework to split between generic and pci code v2 -> v3: - remove comment
* pcie_aer: adjust do_pcie_aer_inejct_error -> do_pcie_aer_inject_errorZhi Yong Wu2011-12-061-1/+1
| | | | | | | 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.hPaolo Bonzini2011-10-211-2/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* runstate: Allow user to migrate twiceLuiz Capitulino2011-10-191-0/+1
| | | | | | | | | | | | | It should be a matter of allowing the transition POSTMIGRATE -> FINISH_MIGRATE, but it turns out that the VM won't do the transition the second time because it's already stopped. So this commit also adds vm_stop_force_state() which performs the transition even if the VM is already stopped. While there also allow other states to migrate. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi: Convert query-statusLuiz Capitulino2011-10-041-18/+1
| | | | | | | | | Please, note that the RunState type as defined in sysemu.h and its runstate_as_string() function are being dropped in favor of the RunState type generated by the QAPI. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* RunState: Rename enum values as generated by the QAPILuiz Capitulino2011-10-041-14/+14
| | | | | | | | | | | | | | | | | | | | | | | Next commit will convert the query-status command to use the RunState type as generated by the QAPI. In order to "transparently" replace the current enum by the QAPI one, we have to make some changes to some enum values. As the changes are simple renames, I'll do them in one shot. The changes are: - Rename the prefix from RSTATE_ to RUN_STATE_ - RUN_STATE_SAVEVM to RUN_STATE_SAVE_VM - RUN_STATE_IN_MIGRATE to RUN_STATE_INMIGRATE - RUN_STATE_PANICKED to RUN_STATE_INTERNAL_ERROR - RUN_STATE_POST_MIGRATE to RUN_STATE_POSTMIGRATE - RUN_STATE_PRE_LAUNCH to RUN_STATE_PRELAUNCH - RUN_STATE_PRE_MIGRATE to RUN_STATE_PREMIGRATE - RUN_STATE_RESTORE to RUN_STATE_RESTORE_VM - RUN_STATE_PRE_MIGRATE to RUN_STATE_FINISH_MIGRATE Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* RunState: Drop the RSTATE_NO_STATE valueLuiz Capitulino2011-10-041-1/+0
| | | | | | | | | 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 initial state and change qemu_vmstop_requested() to use RSTATE_MAX. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* QMP: query-status: Introduce 'status' keyLuiz Capitulino2011-09-151-0/+1
| | | | | | | This new key reports the current VM status to clients. Please, check the documentation being added in this commit for more details. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Drop the vm_running global variableLuiz Capitulino2011-09-151-1/+1
| | | | | | Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* runstate_set(): Check for valid transitionsLuiz Capitulino2011-09-151-0/+1
| | | | | | | | | | | | This commit could have been folded with the previous one, however doing it separately will allow for easy bisect and revert if needed. Checking and testing all valid transitions wasn't trivial, chances are this will need broader testing to become more stable. This is a transition table as suggested by LluĂ­s Vilanova. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* RunState: Add additional statesLuiz Capitulino2011-09-151-1/+7
| | | | | | | | | | | | 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 possible to also do state transitions when the VM is stopped or running. Additional states are also added and the current state is stored. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Replace the VMSTOP macros with a proper state typeLuiz Capitulino2011-09-151-14/+19
| | | | | | | | | | | | | | | Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMSTOP macros tell why qemu stopped and not exactly what the current VM state is. One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER. This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Move vm_state_notify() prototype from cpus.h to sysemu.hLuiz Capitulino2011-09-151-0/+1
| | | | | | It's where all the state handling functions prototypes are located. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Poll main loop after I/O events were receivedJan Kiszka2011-08-221-1/+1
| | | | | | | | | Polling until select returns empty fdsets helps to reduce the switches between iothread and vcpus. The benefit of this patch is best visible when running an SMP guest on an SMP host in emulation mode. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* showing a splash picture when startwayne2011-07-291-0/+3
| | | | | | | | | | | | | | | 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=T P is jpg/bmp file name or an absolute path, T have a max value of 0xffff, unit is ms. With these two options, if user invoke qemu with menu=on option, then a splash picture would be showed in a given time. For example: qemu -boot menu=on,splash=/root/boot.bmp,splash-time=5000 would make boot.bmp shown as a brand with 5 seconds in the booting up process. This feature need the new seabios's support, which could be got from git. Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Allow silent system resetsJan Kiszka2011-06-161-1/+4
| | | | | | | | | This allows qemu_system_reset to be issued silently for internal purposes, ie. without sending out a monitor event. Convert the system reset 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.Anthony PERARD2011-05-081-0/+2
| | | | | | | | | | | Introduce two functions qemu_shutdown_requested_get and qemu_reset_requested_get to get the value of shutdown/reset_requested without reset it. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* migration: move some declarations to migration.hBlue Swirl2011-04-151-5/+0
| | | | | | Move a few migration related declarations to migration.h. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move CPU related functions to cpus.hBlue Swirl2011-04-151-4/+0
| | | | | | Move declarations of CPU related functions to cpus.h. Adjust the only user. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move clock related functions to qemu-timer.hBlue Swirl2011-04-151-4/+0
| | | | | | Move declarations for clock related functions from sysemu.h to qemu-timer.h. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move generic or OS function declarations to qemu-common.hBlue Swirl2011-04-151-21/+0
| | | | | | | | | | | Move generic or OS related function declarations and macro TFR 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 build breakage. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* report that QEMU process was killed by a signalGleb Natapov2011-03-261-0/+2
| | | | | | | | | Currently when rogue script kills QEMU process (using TERM/INT/HUP signal) it looks indistinguishable from system shutdown. Lets report that QEMU was killed and leave some clues about the killer identity. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce -display noneJes Sorensen2011-03-221-0/+1
| | | | | | | | | New option -display none. This option differs from -nographic by not trying to take control of stdio etc. but instead behaves as if a graphics display is enabled, except that it doesn't show one. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Refactor debug and vmstop request interfaceJan Kiszka2011-02-141-0/+2
| | | | | | | | | | Instead of fiddling with debug_requested and vmstop_requested directly, introduce qemu_system_debug_request and turn qemu_system_vmstop_request into a public interface. This aligns those services with exiting ones in vl.c. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Improve vm_stop reason declarationsJan Kiszka2011-02-141-0/+10
| | | | | | | | | | Define and use dedicated constants for vm_stop reasons, they actually have nothing to do with the EXCP_* defines used so far. At this chance, specify more detailed reasons so that VM state change handlers can evaluate them. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* audio: consolidate audio_init()Isaku Yamahata2011-01-251-15/+0
| | | | | | | | 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_migrateAlex Williamson2011-01-171-0/+1
| | | | | | | | | | | | | | | | | | | The no_migrate save state flag is currently only checked in the last phase of migration. This means that we potentially waste a lot of time and bandwidth with the live state handlers before we ever check the no_migrate flags. The error message printed when we catch a non-migratable device doesn't get printed for a detached migration. And, no_migrate does nothing to prevent an incoming migration to a target that includes a non-migratable device. This attempts to fix all of these. One notable difference in behavior is that an outgoing migration now checks for non-migratable devices before ever connecting to the target system. This means the target will remain listening rather than exit from failure. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Merge remote branch 'origin/master' into pciMichael S. Tsirkin2011-01-101-1/+2
|\
| * Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemuAurelien Jarno2010-12-271-1/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu: vnc/spice: add set_passwd monitor command. vnc: support password expire vnc: auth reject cleanup spice: add qmp 'query-spice' and hmp 'info spice' commands. spice: connection events. spice: add qxl device spice: add qxl vgabios binary.
| | * spice: add qxl deviceGerd Hoffmann2010-12-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qxl is a paravirtual graphics card. The qxl device is the bridge between the guest and the spice server (aka libspice-server). The spice server will send the rendering commands to the spice client, which will actually render them. The spice server is also able to render locally, which is done in case the guest wants read something from video memory. Local rendering is also used to support display over vnc and sdl. qxl is activated using "-vga qxl". qxl supports multihead, additional cards can be added via '-device qxl". [ v2: add copyright to files ] [ v2: use qemu-common.h for standard includes ] [ v2: create separate qxl-vga device for primary ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | pcie/aer: glue aer error injection into qemu monitorIsaku Yamahata2010-12-241-0/+5
|/ / | | | | | | | | | | | | introduce pcie_aer_inject_error command. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Pass boot device list to firmware.Gleb Natapov2010-12-111-0/+1
| | | | | | | | | | Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Add notifier that will be called when machine is fully created.Gleb Natapov2010-12-111-0/+2
| | | | | | | | | | | | | | | | Action that depends on fully initialized device model should register with this notifier chain. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Add bootindex for option roms.Gleb Natapov2010-12-111-1/+5
| | | | | | | | | | | | | | Extend -option-rom command to have additional parameter ,bootindex=. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Add bootindex parameter to net/block/fd deviceGleb Natapov2010-12-111-0/+2
|/ | | | | | | | | If bootindex is specified on command line a string that describes device in firmware readable way is added into sorted list. Later this list will be passed into firmware to control boot order. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use display types for local display only.Gerd Hoffmann2010-09-211-1/+0
| | | | | | | This patch drops DT_VNC. The display types are only used to select select the local display (i.e. curses, sdl, coca, ...). Remote displays (for now only vnc, spice will follow) can be enabled independently.
* migration: Accept 'cont' only after successful incoming migrationAmit Shah2010-07-301-0/+1
| | | | | | | | | | | | | | | | | When a 'cont' is issued on a VM that's just waiting for an incoming migration, the VM reboots and boots into the guest, possibly corrupting its storage since it could be shared with another VM running elsewhere. Ensure that a VM started with '-incoming' is only run when an incoming migration successfully completes. A new qerror, QERR_MIGRATION_EXPECTED, is added to signal that 'cont' failed due to no incoming migration has been attempted yet. Reported-by: Laine Stump <laine@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* pci hotplug: make pci_device_hot_remove() staticIsaku Yamahata2010-07-111-1/+0
| | | | | | 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.Gerd Hoffmann2010-06-141-0/+4
| | | | | | | | | | | | | | Hook up any cleanup work which needs to be done here. Advantages over using 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. (2) You can unregister, say when un-plugging a device. [ v2: move code out of #ifndef _WIN32 ] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori2010-06-141-52/+0
|\ | | | | | | | | Conflicts: hw/pc.c
| * blockdev: Collect block device code in new blockdev.cMarkus Armbruster2010-06-041-49/+0
| | | | | | | | | | | | | | 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>
| * qdev: Move declaration of qdev_init_bdrv() into qdev.hMarkus Armbruster2010-06-041-2/+0
| | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud