summaryrefslogtreecommitdiff
path: root/vl.c
AgeCommit message (Collapse)AuthorFilesLines
2008-09-30Add some missing static qualifiersblueswir11-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5363 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-30Silence some warnings about uninitialized variablesblueswir11-1/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5362 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-30Few compile time warnings removed (Stefano Stabellini)blueswir11-3/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5361 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29Refactor QEMUFile for live migrationaliguori1-55/+203
To support live migration, we override QEMUFile so that instead of writing to disk, the save/restore state happens over a network connection. This patch makes QEMUFile read/write operations function pointers so that we can override them for live migration. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5352 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28Add a "null" bluetooth HCI and a header file for bluetooth.balrog1-0/+56
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5342 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28Add to machine structure a flag to use SCSI drives instead of IDE: fixes SS-20blueswir11-6/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5339 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28Optional "precise" VGA retrace supportmalc1-1/+14
Selected via: -vga <name>,retrace=precise git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5336 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28Change the way video graphics adapter is selectedmalc1-19/+27
Instead of having (current)three command line switches -std-vga, -cirrusvga and -vmwarevga, provide one -vga switch which takes an argument, so that: qemu -std-vga becomes qemu -vga std qemu -cirrusvga becomes qemu -vga cirrus qemu -vmwarevga becomes qemu -vga vmware Update documentation accordingly. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5335 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-25Revert r5274 which breaks savevm/loadvmblueswir11-12/+12
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5321 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22Remove unnecessary call to qemu_aio_init (called from bdrv_init)blueswir11-1/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5294 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-20Add signed versions of save/load functionsblueswir11-12/+12
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5274 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-18Add -uuid command line option (Gleb Natapov)blueswir11-0/+29
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5257 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-15Use common objects for qemu-img and qemu-nbdaliguori1-18/+2
Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over the code. It's ugly and causes us to have to build multiple object files for linking against qemu and the tools. This patch introduces a new file, qemu-tool.c which contains enough for qemu-img, qemu-nbd, and QEMU to all share the same objects. This also required getting qemu-nbd to be a bit more Windows friendly. I also changed the Windows block-raw to use normal IO instead of overlapping IO since we don't actually do AIO yet on Windows. I changed the various #if 0's to #if WIN32_AIO to make it easier for someone to eventually fix AIO on Windows. After this patch, there are no longer any #ifdef's related to qemu-img and qemu-nbd. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5226 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-14qemu_next_deadline_dyntick is only used on Linux and Windowsblueswir11-0/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5210 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-14Fix warnings that would be caused by gcc flag -Wwrite-stringsblueswir11-8/+11
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5206 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-14usb: Support for removing device by host addr, improved auto filter syntax ↵aliguori1-0/+3
(Max Krasnyansky) This patch adds support for removing USB devices by host address. Which is usefull for things like libvirtd because there is no easy way to find guest USB address of the host device. In other words you can now do: usb_add host:3.5 ... usb_del host:3.5 Before the patch 'usb_del' did not support 'host:' notation. ---- Syntax for specifying auto connect filters has been improved. Old syntax was host:bus.dev host:pid:vid New syntax is host:auto:bus.dev[:pid:vid] In both the cases any attribute can be set to "*". New syntax is more flexible and lets you do things like host:3.*:5533:* /* grab any device on bus 3 with vendor id 5533 */ It's now possible to remove auto filters. For example: usb_del host:auto:3.*:5533:* Active filters are printed after all host devices in 'info usb' output. Which now looks like this: Device 1.1, speed 480 Mb/s Hub: USB device 1d6b:0002, EHCI Host Controller Device 1.4, speed 480 Mb/s Class 00: USB device 1058:0704, External HDD Auto filters: Device 3.* ID *:* Signed-off-by: Max Krasnyansky <maxk@kernel.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5205 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-10Use signalfd() to work around signal/select racealiguori1-1/+0
This patch introduces signalfd() to work around the signal/select race in checking for AIO completions. For platforms that don't support signalfd(), we emulate it with threads. There was a long discussion about this approach. I don't believe there are any fundamental problems with this approach and I believe eliminating the use of signals is a good thing. I've tested Windows and Linux using Windows and Linux guests. I've also checked for disk IO performance regressions. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5187 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-09Add missing "static"blueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5184 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-02Delete unused variable.ths1-1/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5144 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-28Do not try to use -net user as a default when slirp disabled (Jeremy ↵aliguori1-3/+4
Fitzhardinge) When CONFIG_SLIRP is not defined, we should not try to use -net user as a default. Patch from Jeremy Fitzhardinge <jeremy@goop.org> (who is a Citrix staff member). Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5092 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-24Enable pty/tty functions for BSDs too (initial patch from Xen)blueswir11-4/+17
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5079 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-22Parallel Port Direction Fixaurel321-0/+4
The direction bit in the control register should not be directly set using PPWCONTROL. The kernel gives the following debug message. parport0 (ppdev0): use data_reverse for this! More over setting the data pins to forward mode does not work, perhaps a bug in the Linux PP driver. The right way to do this is to use PPDATADIR to set the direction. The patch checks if the user is toggling the direction bit, and invokes PPDATADIR to do the job. Signed-off-by: Vijay Kumar B <vijaykumar@bravegnu.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5063 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21move GUI_REFRESH_INTERVAL define from vl.c to console.h (Gerd Hoffmann)aliguori1-2/+0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5058 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21add DisplayState->idle (Samuel Thibault)aliguori1-0/+2
Add idle field to DisplayState struct, so drivers can figure the display is idle and take advantage of that. The xen framebuffer driver will use this to communicate the idle state to the guest, so it knows it can stop doing updates to a virtual display which is invisible anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5056 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21Handle terminating signals (Gerd Hoffmann)aliguori1-0/+27
This patch makes qemu handle signals better. It sets the request_shutdown flag, making the main_loop exit and qemu taking the usual exit route, with atexit handlers being called and so on, instead of qemu just being killed by the signal. To avoid calling vm_start() from the signal handler main_loop() got an additional check so qemu_system_shutdown_request() works even when the vm is in stopped state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5055 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21husb: support for USB host device auto connect (Max Krasnyansky)aliguori1-28/+29
QEMU can now automatically grab host USB devices that match the filter. For now I just extended 'host:X.Y' and 'host:VID:PID' syntax to handle wildcards. So for example if you do something like usb_add host:5.* QEMU will automatically grab any non-hub device with host address 5.*. Same with the 'host:PID:*', we grab any device that matches PID. Filtering itself is very generic so we can probably add more elaborate syntax like 'host:BUS.ADDR:VID:PID'. So that we can do 'host:5.*:6000:*'. Anyway, it's implemented using a periodic timer that scans host devices and grabs those that match the filter. Timer is started when the first filter is added. We now keep the list of all host devices that we grabbed to make sure that we do not grab the same device twice. btw It's currently possible to grab the same host device more than once. ie You can just do "usb_add host:1.1" more than once, which of course does not work. So this patch fixes that issue too. Along with auto disconnect patch that I send a minute ago the setup is very seamless now. You can just allocate some usb ports to the VMs and plug/unplug devices at any time. Signed-off-by: Max Krasnyansky <maxk@kernel.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5048 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21husb: support for USB host device auto disconnect (Max Krasnyansky)aliguori1-8/+18
I got really annoyed by the fact that you have to manually do usb_del in the monitor when host device is unplugged and decided to fix it :) Basically we now automatically remove guest USB device when the actual host device is disconnected. At first I've extended set_fd_handlerX() stuff to support checking for exceptions on fds. But unfortunately usbfs code does not wake up user-space process when device is removed, which means we need a timer to periodically check if device is still there. So I removed fd exception stuff and implemented it with the timer. Signed-off-by: Max Krasnyansky <maxk@kernel.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5047 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21Fix OpenBSD linker warningsblueswir11-9/+10
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5044 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-19Revert r4979 since it breaks the monitoraliguori1-14/+13
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5028 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-17Fix some warnings that would be generated by gcc -Wmissing-prototypesblueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5022 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-15Preliminary OpenBSD host support (based on OpenBSD patches by Todd T. Fries)blueswir11-1/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5012 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-12Allow boot without a drive on Sparc machines (partly extracted from Xen)blueswir11-2/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4997 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-11Upgrade emulated UART to 16550A (Stefano Stabellini)aliguori1-0/+31
This patch upgrades the emulated UART to 16550A, the code comes from xen-unstable. The main improvement was introduced with the following patch and subsequent email thread: http://lists.xensource.com/archives/html/xen-devel/2007-12/msg00129.html The changes compared to previous version are: - change clock_gettime to qemu_get_clock - no token bucket anymore; - fixed a small bug handling IRQs; this was the problem that prevented kgdb to work over the serial (thanks to Jason Wessel for the help spotting and reproducing this bug). - many many style fixes; - savevm version number increased; - not including termios.h and sys/ioctl.h anymore, declaring static constants in qemu-char.h instead; Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4993 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-01Set focus to monitor to ask password if line is multiplexed (Laurent Vivier)aliguori1-3/+9
This patch allows to display the "Password:" prompt if we use encrypted disk with "-nographic" option. It also modifies management of "-nographic" to not override user's choices for "-serial", "-parallel" and "-monitor". When qemu has to ask a password with "-nographic" with a multiplexed serial interface, it forces the focus to the monitor and restore original focus after. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4979 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-01Ask password when encrypted disk image is used (Laurent Vivier)aliguori1-13/+14
This patch repairs the management of encrypted disk images and allows to enter the password. Changelog: v2: - move read_password() before do_loadvm() - really start monitor if output is stdio. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4976 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-29Simplify -usbdevice net: syntax, allow VLANs with no NICs.balrog1-23/+28
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4965 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-28Attempt to detect unconnected ptys (Gerd Hoffman)aliguori1-4/+145
This patch moves the pty char device imlementation away from the generic filehandle code. It tries to detect as good as possible whenever there is someone connected to the slave pty device and only send data down the road in case someone is listening. Unfortunaly we have to poll via timer once in a while to check the status because we have to use read() on the master pty to figure the status (returns -EIO when unconnected). Poll intervall for an idle guest is one second, when the guest sends data to the virtual device linked to the pty we check more frequently. The point for all of this is to avoid qemu blocking and not responding any more. Writing to the master pty handle succeeds even when nobody is connected to (and reading from) to the slave end of the pty. The kernel just bufferes the writes. And as soon as the kernel buffer is full the write() call blocks forever ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4956 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-23Save 3MB ioport table memory (Samuel Thibault)aliguori1-26/+39
Save 1.5MB (32bit) or 3MB (64bit) memory by keeping ioport tables sparse and use a test against NULL instead. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4927 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-23Fix -daemonize optionaliguori1-6/+1
When using -daemonize, we want to avoid chdir() until after we've opened the block devices. It's also perfectly fine to use -dameonize along with SDL. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4924 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-19Add Virtual Distributed Ethernet native support, by Luca Bigliardi.ths1-0/+101
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4896 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-18Various NICs: Fix suspend/resume of multiple instances, by Jan Kiszka.ths1-1/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4892 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-18Do not call fcntl(, O_NONBLOCK) pointlessly, by Ian Jackson.ths1-1/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4889 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-18Do not disturb old fd flags (eg O_APPEND) when setting nonblock, byths1-1/+3
Ian Jackson. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4888 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-17Remove the NIC from vlan on usb destroy.balrog1-0/+13
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4885 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-17Add CDC-Ethernet usb NIC (original patch from Thomas Sailer).balrog1-0/+6
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4884 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-03Bail out if -append or -initrd is specified without -kernel, byths1-0/+10
Sebastian Herbszt. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4833 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-01Remove duplicate device index calculations.pbrook1-2/+9
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4818 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-01Implement resolution switching in common console code.pbrook1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4812 c046a42c-6fe2-441c-8c8c-71466251a162
2008-06-30Spelling fixes, spotted by Stuart Brady.ths1-4/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4809 c046a42c-6fe2-441c-8c8c-71466251a162
2008-06-29Add missing file. Fix spelling errors.pbrook1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4800 c046a42c-6fe2-441c-8c8c-71466251a162