summaryrefslogtreecommitdiff
path: root/sysemu.h
AgeCommit message (Collapse)AuthorFilesLines
2011-01-25audio: consolidate audio_init()Isaku Yamahata1-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>
2011-01-17savevm: Fix no_migrateAlex Williamson1-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>
2011-01-10Merge remote branch 'origin/master' into pciMichael S. Tsirkin1-1/+2
2010-12-27Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemuAurelien Jarno1-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.
2010-12-24pcie/aer: glue aer error injection into qemu monitorIsaku Yamahata1-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>
2010-12-11Pass boot device list to firmware.Gleb Natapov1-0/+1
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add notifier that will be called when machine is fully created.Gleb Natapov1-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>
2010-12-11Add bootindex for option roms.Gleb Natapov1-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>
2010-12-11Add bootindex parameter to net/block/fd deviceGleb Natapov1-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>
2010-12-09spice: add qxl deviceGerd Hoffmann1-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>
2010-09-21Use display types for local display only.Gerd Hoffmann1-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.
2010-07-30migration: Accept 'cont' only after successful incoming migrationAmit Shah1-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>
2010-07-11pci hotplug: make pci_device_hot_remove() staticIsaku Yamahata1-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>
2010-06-14Add exit notifiers.Gerd Hoffmann1-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>
2010-06-14Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori1-52/+0
Conflicts: hw/pc.c
2010-06-12Move daemonize handling to OS specific filesJes Sorensen1-0/+1
Move daemonize handling from vl.c to OS specific files. Provide dummy stubs 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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-12Introduce OS specific cmdline argument handling and move SMB arg to os-posix.cJes Sorensen1-0/+1
Introduce OS specific cmdline argument handling by calling os_parse_cmd_args() at the end of switch() statement. Move option enum to qemu-options.h and have it included from os-posix.c and os-win32.c in addition to vl.c. In addition move SMB argument to os-posix.c Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-12Move find_datadir to OS specific files.Jes Sorensen1-0/+2
This moves the win32 and POSIX versions of find_datadir() to OS specific files, and removes some #ifdef clutter from vl.c Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-12Rename os_setup_signal_handling() to os_setup_early_signal_handling()Jes Sorensen1-1/+1
Rename os_setup_signal_handling() to os_setup_early_signal_handling() Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-12Move win32 early signal handling setup to os_setup_signal_handling()Jes Sorensen1-0/+2
Move win32 early signal handling setup to os_setup_signal_handling() Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-12vl.c: Move host_main_loop_wait() to OS specific files.Jes Sorensen1-0/+4
Move host_main_loop_wait() to OS specific files. Create qemu-os-posix.h and provide empty inline for the POSIX case. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-12Create qemu-os-win32.h and move WIN32 specific declarations thereJes Sorensen1-16/+1
Create qemu-os-win32.h for WIN32 specific declarations. Move polling handling declaration into this file from sysemu.h Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-04blockdev: Collect block device code in new blockdev.cMarkus Armbruster1-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>
2010-06-04qdev: Move declaration of qdev_init_bdrv() into qdev.hMarkus Armbruster1-2/+0
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-04blockdev: Hide QEMUMachine from drive_init()Markus Armbruster1-1/+2
To pave the way for moving it out of vl.c. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-04blockdev: Belatedly remove driveoptsMarkus Armbruster1-1/+0
Unused since commit 9dfd7c7a. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-04blockdev: Belatedly remove MAX_DRIVESMarkus Armbruster1-1/+0
Unused since commit 751c6a17. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-19sysemu: Export 'no_shutdown'Luiz Capitulino1-0/+1
It's a global variable already, do_quit() will use it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-05-19Revert "Monitor: Return before exiting with 'quit'"Luiz Capitulino1-2/+0
This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d. Next commits will do the same thing in a better way. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-05-19Revert "monitor: Convert do_pci_device_hot_remove() to QObject"Markus Armbruster1-2/+1
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>
2010-05-19Revert "PCI: Convert pci_device_hot_add() to QObject"Markus Armbruster1-2/+1
Short story: We don't want pci_add in QMP. Long story follows. pci_add can do two things: * Hot plug a PCI NIC. device_add is more general. * Hot plug a PCI disk controller, and a drive connected to it. The controller is either virtio-blk-pci (if=virtio) or lsi53c895a (if=scsi). With the latter, the drive is optional. Use drive_add to hotplug additional SCSI drives. Except drive_add is not available in QMP. device_add is more general for controllers and the guest part of drives. I'm working on a more general alternative for the host part of drives. Why am I proposing to remove pci_add from QMP before its replacement is ready? I want it out sooner rather than later, because it isn't fully functional (errors and drive_add are missing), and we do not plan to complete the job. In other words, it's not really usable over QMP now, and it's not what we want for QMP anyway. Since we don't want it to be used over QMP, we should take it out, not leave it around as a trap for the uninitiated. Dan Berrange confirmed that libvirt has no need for pci_add & friends over QMP. This reverts commit 7a344f7ac7bb651d0556a933ed8060d3a9e5d949. Conflicts: hw/pci-hotplug.c sysemu.h Signed-off-by: Markus Armbruster <armbru@redhat.com>
2010-04-26Monitor: Return before exiting with 'quit'Luiz Capitulino1-0/+2
The 'quit' Monitor command (implemented by do_quit()) calls exit() directly, this is problematic under QMP because QEMU exits before having a chance to send the ok response. Clients don't know if QEMU exited because of a problem or because the 'quit' command has been executed. This commit fixes that by moving the exit() call to the main loop, so that do_quit() requests the system to quit, instead of calling exit() directly. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-03-29Refactor target specific handling, compile vl.c only onceBlue Swirl1-4/+0
Move target specific functions and RAM handling to arch_init.c. Add a flag to QEMUOptions structure to indicate for which architectures the option is allowed, check the flag in run time and remove conditional code in option handling. Now that no target dependencies remain, compile vl.c only once for all targets. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27error: Trim includes after "Move qemu_error & friends..."Markus Armbruster1-2/+0
Missed in commit 2f792016. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-21Revert "Add exit notifiers"Anthony Liguori1-5/+0
This reverts commit 3b6304f706ef7eebc0b3b3f3a5093ec75448ee19. This was mistakenly committed. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19Add exit notifiersAnthony Liguori1-0/+5
Like atexit() but with state Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17disentangle tcg and deadline calculationPaolo Bonzini1-1/+1
Just tell main_loop_wait whether to be blocking or nonblocking, so that there 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 we have stuff to do". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-16error: Move qemu_error & friends into their own headerMarkus Armbruster1-8/+0
2010-03-16error: Simplify error sink setupMarkus Armbruster1-3/+0
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 to stderr. Simply route errors to the current monitor or else to stderr, and remove qemu_error_sink along with the functions to control it. Actually, the old code switches the sink slightly later, in handle_user_command() and handle_qmp_command(), than it gets switched now, implicitly, by setting the current monitor in monitor_read() and monitor_control_read(). Likewise, it switches back slightly earlier (same places). Doesn't make a difference, because there are no calls of qemu_error() in between.
2010-03-16savevm: Fix -loadvm to report errors to stderr, not the monitorMarkus Armbruster1-1/+1
A monitor may not even exist. Change load_vmstate() to use qemu_error() instead of monitor_printf(). Parameter mon is now unused, remove it.
2010-03-08QMP: Introduce RTC_CHANGE eventLuiz Capitulino1-0/+2
Emitted whenever the RTC time changes. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-04KVM: Rework VCPU state writeback APIJan Kiszka1-0/+4
This grand cleanup drops all reset and vmsave/load related synchronization points in favor of four(!) generic hooks: - cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave) - cpu_synchronize_all_post_init in qemu_loadvm_state (writeback after vmload) - cpu_synchronize_all_post_init in main after machine init - cpu_synchronize_all_post_reset in qemu_system_reset (writeback after system reset) These writeback points + the existing one of VCPU exec after cpu_synchronize_state map on three levels of writeback: - KVM_PUT_RUNTIME_STATE (during runtime, other VCPUs continue to run) - KVM_PUT_RESET_STATE (on synchronous system reset, all VCPUs stopped) - KVM_PUT_FULL_STATE (on init or vmload, all VCPUs stopped as well) This level is passed to the arch-specific VCPU state writing function that will decide which concrete substates need to be written. That way, no writer of load, save or reset functions that interact with in-kernel KVM states will ever have to worry about synchronization again. That also means that a lot of reasons for races, segfaults and deadlocks are eliminated. cpu_synchronize_state remains untouched, just as Anthony suggested. We continue to need it before reading or writing of VCPU states that are also tracked by in-kernel KVM subsystems. Consequently, this patch removes many cpu_synchronize_state calls that are now redundant, just like remaining explicit register syncs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-02-19Monitor: Convert pci_device_hot_remove() to cmd_new_ret()Luiz Capitulino1-3/+3
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19Monitor: Convert pci_device_hot_add() to cmd_new_ret()Luiz Capitulino1-1/+1
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20virtio-console: qdev conversion, new virtio-serial-busAmit Shah1-6/+0
This commit converts the virtio-console device to create a new virtio-serial bus that can host console and generic serial ports. The file hosting this code is now called virtio-serial-bus.c. The virtio console is now a very simple qdev device that sits on the virtio-serial-bus and communicates between the bus and qemu's chardevs. This commit also includes a few changes to the virtio backing code for pci and s390 to spawn the virtio-serial bus. As a result of the qdev conversion, we get rid of a lot of legacy code. The old-style way of instantiating a virtio console using -virtioconsole ... is maintained, but the new, preferred way is to use -device virtio-serial -device virtconsole,chardev=... With this commit, multiple devices as well as multiple ports with a single device can be supported. For multiple ports support, each port gets an IO vq pair. Since the guest needs to know in advance how many vqs a particular device will need, we have to set this number as a property of the virtio-serial device and also as a config option. In addition, we also spawn a pair of control IO vqs. This is an internal channel meant for guest-host communication for things like port open/close, sending port properties over to the guest, etc. This commit is a part of a series of other commits to get the full implementation of multiport support. Future commits will add other support as well as ride on the savevm version that we bump up here. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12PCI: Convert pci_device_hot_add() to QObjectLuiz Capitulino1-1/+2
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 handling conversion. In error conditions the handler still calls monitor_printf(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03Introduce rerror option for drivesKevin Wolf1-0/+1
rerror controls the action to be taken when an error occurs while accessing the guest image file. It corresponds to werror which already controls the action take for write errors. This purely introduces parsing rerror command line option into the right structures, real support for it in the device emulation is added in the following patches. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03Rename DriveInfo.onerror to on_write_errorKevin Wolf1-2/+4
Either rename variables and functions to refer to write errors (which is what they 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>
2009-12-03live migration: Propagate output monitor to callback handlerJan Kiszka1-5/+5
In order to allow proper progress reporting to the monitor that initiated the migration, forward the monitor reference through the migration layer down to SaveLiveStateHandler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03live migration: Allow cleanup after cancellation or errorJan Kiszka1-0/+1
Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel a live migration. This gives the involved subsystems a chance to clean up dynamically allocated resources. Namely, the block migration layer can now free its device descriptors and pending blocks. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>