summaryrefslogtreecommitdiffstats
path: root/vl.c
Commit message (Collapse)AuthorAgeFilesLines
* qapi: Convert query-statusLuiz Capitulino2011-10-041-21/+11
| | | | | | | | | 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-59/+59
| | | | | | | | | | | | | | | | | | | | | | | 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-12/+7
| | | | | | | | | 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>
* vl: Change qemu_vmstop_requested() to return a boolLuiz Capitulino2011-10-041-6/+10
| | | | | | | | The stop reason is returned in the RunState argument. This is a preparation for a future commit which will convert the query-status command to the QAPI. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2011-09-201-18/+138
|\
| * QMP: query-status: Introduce 'status' keyLuiz Capitulino2011-09-151-0/+23
| | | | | | | | | | | | | | 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>
| * Monitor/QMP: Don't allow cont on bad VM stateLuiz Capitulino2011-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have two states where issuing cont before system_reset can cause problems: RSTATE_SHUTDOWN (when -no-shutdown is used) and RSTATE_PANICKED (which only happens with kvm). This commit fixes that by doing the following when state is RSTATE_SHUTDOWN or RSTATE_PANICKED: 1. returning an error to the user/client if cont is issued 2. automatically transition to RSTATE_PAUSED during system_reset Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Drop the vm_running global variableLuiz Capitulino2011-09-151-3/+6
| | | | | | | | | | | | Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Drop the incoming_expected global variableLuiz Capitulino2011-09-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | Test against RSTATE_IN_MIGRATE instead. Please, note that the RSTATE_IN_MIGRATE state is only set when all the initial VM setup is done, while 'incoming_expected' was set right in the beginning when parsing command-line options. Shouldn't be a problem as far as I could check. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * runstate_set(): Check for valid transitionsLuiz Capitulino2011-09-151-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | 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-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix termination by signal with -no-shutdownKevin Wolf2011-09-161-0/+1
|/ | | | | | | | On signals such as SIGTERM qemu should exit instead of just stopping the VM even with -no-shutdown. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2011-09-091-1/+1
|\
| * Fix comment (install patch -> install path)Stefan Weil2011-09-091-1/+1
| | | | | | | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | Don't use g_thread_get_initialized.Gerd Hoffmann2011-09-091-0/+1
|/ | | | | | | | | | | Initialize glib threads unconditionally in main() instead of 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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rename qemu_malloc and related to glib names for coherenceFrediano Ziglio2011-09-021-3/+3
| | | | | | 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 threadAnthony Liguori2011-09-021-18/+0
| | | | | | | | | | | | | | | | Enabling the I/O thread by default seems like an important part of declaring 1.0. Besides allowing true SMP support with KVM, the I/O thread means that the TCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which currently requires a (racey) signal based alarm system. I know there have been concerns about performance. I think so far the ones that have come up (virtio-net) are most likely due to secondary reasons like decreased batching. I think we ought to force enabling I/O thread early in 1.0 development and commit to resolving any lingering issues. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori2011-09-021-8/+11
|\
| * trace: add "-trace events" argument to control initial stateLluís2011-09-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | The "-trace events" argument can be used to provide a file with a list of trace event names that will be enabled prior to starting execution, thus providing early tracing. This saves the user from manually toggling event states through the monitor interface or whichever backend-specific interface. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
| * trace: avoid conditional code compilation during option parsingLluís2011-09-011-8/+9
| | | | | | | | | | | | | | | | A default implementation for backend-specific routines is provided in "trace/default.c", which backends can override by setting "trace_default=no" in "configure". Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
| * trace: move backend-specific code into the trace/ directoryLluís2011-09-011-1/+1
| | | | | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
| * trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*Lluís2011-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | Add glib support to main loopAnthony Liguori2011-09-011-0/+74
|/ | | | | | | | | | | | | | | | | | | This allows GSources to be used to register callback events in QEMU. This is useful as it allows us to take greater advantage of glib and also because it allows us to write code that is more easily testable outside of QEMU since we can make use of glib's main loop in unit tests. All new code should use glib's callback mechanisms for registering fd events which are very well documented at: http://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html And: http://developer.gnome.org/gio/stable/ Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Poll main loop after I/O events were receivedJan Kiszka2011-08-221-4/+8
| | | | | | | | | 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>
* Do not drop global mutex for polled main loop runsJan Kiszka2011-08-221-2/+8
| | | | | | | | | | If we call select without a timeout, it's more efficient to keep the global mutex locked as we may otherwise just play ping pong with a vcpu thread contending for it. This is particularly important for TCG mode where we run in lock-step with the vcpu thread. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: qemu_chr_open_opts() -> qemu_chr_new_from_opts()Anthony Liguori2011-08-221-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: rename qemu_chr_open() -> qemu_chr_new()Anthony Liguori2011-08-221-4/+4
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add trace points for g_malloc/g_free functionsAnthony Liguori2011-08-201-0/+27
| | | | | | Derived from a patch submitted by Avi Kivity. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-22/+22
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Reorder default ram_size initializationJan Kiszka2011-08-211-5/+5
| | | | | | | | code_gen_alloc depends on it, and that is now called earlier via configure_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 modeJan Kiszka2011-08-051-7/+7
| | | | | | | | | Do not allocate TCG-only resources like the translation buffer when running over KVM or XEN. Saves a "few" bytes in the qemu address space and is also conceptually cleaner. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'agraf/xen-next' into stagingAnthony Liguori2011-07-291-6/+10
|\
| * vl.c: Check the asked ram_size later.Anthony PERARD2011-07-261-6/+10
| | | | | | | | | | | | | | | | | | | | As a Xen guest can have more than 2GB of RAM on a 32bit host, we move the 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> Signed-off-by: Alexander Graf <agraf@suse.de>
* | Allow to leave type on default in -machineJan Kiszka2011-07-291-1/+4
| | | | | | | | | | | | | | | | | | This allows to specify -machine options without setting an explicit machine type. We will pick the default machine in this case. Requesting the list of available machines is still possible via '-machine ?' e.g. 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-1/+16
|/ | | | | | | | | | | | | | | 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>
* notifier: Pass data argument to callbackJan Kiszka2011-07-231-2/+2
| | | | | | | | | | | This allows to pass additional information to the notifier callback which is useful if sender and receiver do not share any other distinct data structure. Will be used first for the clock reset notifier. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* do not reset no_shutdown after we shutdown the vmWen Congyang2011-07-231-1/+0
| | | | | | | | | | | | | | | | | | | | Daniel P. Berrange sent a libvirt's patch to support reboots with the QEMU driver. He implements it in json model like this: 1. add -no-shutdown in the qemu's option: qemu -no-shutdown xxxx 2. shutdown the vm by monitor command system_powerdown 3. wait for shutdown event 4. reset the vm by monitor command system_reset no_shutdown will be reset to 0 if the vm is powered down. We only can reboot the vm once. If no_shutdown is not reset to 0, we can reboot the vm many times. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vl.c: Don't limit node count by smp countSasha Levin2011-07-231-2/+2
| | | | | | | | | | | | | [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 be limited by amount of CPUs. Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com> Acked-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Generalize -machine command line optionJan Kiszka2011-07-231-17/+26
| | | | | | | | | | | | | | | -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 arbitrary per-machine options to the command line. That will change the internal realization again, but we will be able to keep the user interface stable. Tested-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pxa2xx_lcd: add proper rotation supportVasily Khoruzhick2011-07-041-1/+10
| | | | | | | | Until now, pxa2xx_lcd only supported 90deg rotation, but some 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 resetsJan Kiszka2011-06-161-4/+6
| | | | | | | | | 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>
* Introduce format string for pid_tAndreas Färber2011-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | 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. The predecessor of this patch added another upcast for the simpletrace filename but was not applied to date. Since new uses of pid_t with %d keep creeping in, let's instead define an OS-dependent format string and use that consistently. Cc: Stefan Hajnoczi <stefanha@gmail.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Ingo Weinhold <ingo_weinhold@gmx.de> Cc: Gleb Natapov <gleb@redhat.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Command line support for altering the log file locationMatthew Fernandez2011-06-151-1/+18
| | | | | | | | | | | 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 to the hard-coded path /tmp/qemu.log. This patch adds support for writing the log to a different location by passing the -D option. Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* usb: don't call usb_host_device_open from vl.cGerd Hoffmann2011-06-141-1/+5
| | | | | | | 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 stagingAnthony Liguori2011-06-081-0/+1
|\ | | | | | | | | Conflicts: vl.c
| * qxl: add to the list of devices which disable the default vgaGerd Hoffmann2011-06-061-0/+1
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | isa-vga: Make available with -device, like the other VGA qdevsMarkus Armbruster2011-06-071-0/+1
| | | | | | | | | | | | | | 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=Anthony Liguori2011-06-061-1/+2
|/ | | | | | | | | | | | | Commit 85097db6 changed the timing when kvm_allowed is set until after kvm is initialized. During initialization, the ioeventfd initialization code checks kvm_enabled() and after this change, ioeventfd is effectively disabled. This causes a significant regression in performance. Fix this by setting kvm_allowed before calling init. Reported-by: Khoa Huynh <khoa@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* defaults: ide-cd, ide-hd and scsi-cd devices suppress default CD-ROMMarkus Armbruster2011-05-191-0/+3
| | | | | | | | | | ide-hd has to suppress the default CD-ROM, or else you can't put one on secondary master without -nodefaults. Unlike legacy scsi-disk, scsi-cd suppresses default CD-ROM. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud