summaryrefslogtreecommitdiffstats
path: root/vl.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* vl.c: Introduce getter for shutdown_requested and reset_requested.Anthony PERARD2011-05-081-0/+10
| | | | | | | | | | | 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>
* xen: Add initialisation of XenAnthony PERARD2011-05-081-0/+2
| | | | | | | | 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>
* machine, Add default_machine_opts to QEMUMachine.Anthony PERARD2011-05-081-0/+22
| | | | | | | | | | | With this new field, we can specified which accelerator use to run the machine, if the accelerator is not already specified by either a configuration file or the command line options. Currently, the only use will be made in the xenfv machine. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* Introduce -machine command option.Anthony PERARD2011-05-081-12/+90
| | | | | | | | | | | | | | | | | | | This option gives the ability to switch one "accelerator" like kvm, xen or the default one tcg. We can specify more than one accelerator by separate them by a colon. QEMU will try each one and use the first whose works. So, ./qemu -machine accel=xen:kvm:tcg which would try Xen support first, then KVM and finally TCG if none of the other works. By default, QEMU will use TCG. But we can specify another default in the global configuration file. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* vl.c: Replace -virtfs string manipulation with QemuOptsStefan Hajnoczi2011-04-271-37/+19
| | | | | | | | | | | | | | | The -virtfs option creates an fsdev representing the pass-through file system and a guest-visible virtio-9p-pci device that can access this file system. This patch replaces the string manipulation used to build and reparse option lists with direct QemuOpts calls. Removing the string manipulation code makes it easier to maintain and less error prone. An error message is also updated to use "mount_tag" instead of "mnt_tag". Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
* vl: trivial spelling fixBrad Hards2011-04-261-1/+1
| | | | | 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" -driveMichael Tokarev2011-04-071-1/+3
| | | | | | | | | | | | | | | | | | | | This fixes the problem when qemu continues even if -drive specification is somehow invalid, resulting in a mess. Applicable for both current master and for stable-0.14 (and the same issue exist 0.13 and 0.12 too). The prob can actually be seriuos: when you start guest with two drives and make an error in the specification of one of them, and the guest has something like a raid array on the two drives, guest may start failing that array or kick "missing" drives which may result in a mess - this is what actually happened to me, I did't want a resync at all, and a resync resulted in re-writing (and allocating) a 4TB virtual drive I used for testing, which in turn resulted in my filesystem filling up and whole thing failing badly. Yes it was just testing VM, I experimented with larger raid arrays, but the end result was quite, well, unexpected. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* virtio: use generic name when possibleAlexander Graf2011-04-041-3/+3
| | | | | | | | | | | | We have two different virtio buses: pci and s390. The abstraction path taken in qemu is to have generic aliases for each device type in the architecture specific qdev devices. So let's make use of these aliases whenever we can and define them whenever we can. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* register signal handler after initializing SDL.Gleb Natapov2011-04-041-3/+3
| | | | | | | | | | SDL library initialization mangles signal handlers, so QEMU should register them after initializing SDL. This was the case before and code even have a comment about that. Fix it to be so again. Signed-off-by: Gleb Natapov <gleb@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* vl.c: Tidy up message printed when we exit on a signalPeter Maydell2011-04-041-2/+9
| | | | | | | | | | | Tidy up the message printed when qemu exits due to a signal, so that it's clearer where the message is coming from and that it's not just stray debug output. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* extract I/O handler lists to iohandler.cPaolo Bonzini2011-03-291-101/+5
| | | | | 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 signalGleb Natapov2011-03-261-1/+19
| | | | | | | | | 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>
* vl.c: Fix compilation failure if CONFIG_SDL isn't definedPeter Maydell2011-03-251-6/+7
| | | | | | | | Fix a compilation failure if CONFIG_SDL isn't defined (gcc complained that 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>
* Make VNC support optionalJes Sorensen2011-03-221-4/+22
| | | | | | | Per default VNC is enabled. 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 disabledJes Sorensen2011-03-221-2/+5
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* error message if user specifies SDL cmd line option when SDL is disabledJes Sorensen2011-03-221-0/+8
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add support for -display vncJes Sorensen2011-03-221-0/+14
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce -display noneJes Sorensen2011-03-221-0/+2
| | | | | | | | | 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>
* Introduce -display argumentJes Sorensen2011-03-221-0/+75
| | | | | | | | | This patch introduces a -display argument which consolidates the setting of the display mode. Valid options are: sdl/curses/default Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'qemu-kvm/uq/master' into stagingAnthony Liguori2011-03-211-0/+1
|\
| * Synchronize VCPU states before resetJan Kiszka2011-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 state information. The first user of this will be MCE MSR synchronization which currently works around the missing cpu_synchronize_all_states. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | change all rt_clock references to use millisecond resolution accessorsPaolo Bonzini2011-03-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/' \ $(git grep -l 'new_timer\>.*rt_clock' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | simpletrace: Move st_init() error reportingStefan Hajnoczi2011-03-151-1/+3
|/ | | | | | | | | | | | | User emulator builds do not have error_report() so it should not be used by simpletrace.c. In fact, error reporting inside simpletrace.c is inappropriate and should be done by the caller instead. This patch moves st_init() error reporting out to its caller, vl.c:main(). Reported-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* simpletrace: Thread-safe tracingStefan Hajnoczi2011-03-071-12/+4
| | | | | | | | | | | | | | | | | | Trace events outside the global mutex cannot be used with the simple trace backend since it is not thread-safe. There is no check to prevent them being enabled so people sometimes learn this the hard way. This patch restructures the simple trace backend with a ring buffer suitable for multiple concurrent writers. A writeout thread empties the trace buffer when threshold fill levels are reached. Should the writeout thread be unable to keep up with trace generation, records will simply be dropped. Each time events are dropped a special record is written to the trace file indicating how many events were dropped. The event ID is 0xfffffffffffffffe and its signature is dropped(uint32_t count). Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Move debug exception handling out of cpu_execJan Kiszka2011-02-141-1/+1
| | | | | | | | | | | | | | | To prepare splitting up KVM and TCG CPU entry/exit, move the debug exception into cpus.c and invoke cpu_handle_debug_exception on return from qemu_cpu_exec. This also allows to clean up the debug request signaling: We can assign the job of informing main-loop to qemu_system_debug_request and stop the calling cpu directly in cpu_handle_debug_exception. That means a debug stop will now only be signaled via debug_requested and not additionally via vmstop_requested. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Refactor debug and vmstop request interfaceJan Kiszka2011-02-141-4/+16
| | | | | | | | | | 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-1/+1
| | | | | | | | | | 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>
* Flatten the main loopJan Kiszka2011-02-141-15/+15
| | | | | | | | | | | First of all, vm_can_run is a misnomer, it actually means "no request pending". Moreover, there is no need to check all pending requests twice, the first time via the inner loop check and then again when actually processing the requests. We can simply remove the inner loop and do the checks directly. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
OpenPOWER on IntegriCloud