summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-08-24Rearrange block headersHEADmasterBlue Swirl47-13/+51
Changing block.h or blockdev.h resulted in recompiling most objects. Move DriveInfo typedef and BlockInterfaceType enum definitions to qemu-common.h and rearrange blockdev.h use to decrease churn. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-23Merge remote branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-12/+7
2010-08-22compile -fsdev and -virtfs cmd line options unconditionally.Gerd Hoffmann2-8/+13
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22QemuOpts: make most qemu_*_opts staticGerd Hoffmann13-66/+59
Switch tree to lookup-by-name using qemu_find_opts(). Also hook up virtfs options so qemu_find_opts works for them too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22QemuOpts: allow new option groups be registered at runtime.Gerd Hoffmann2-1/+18
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22VGA: Don't register deprecated VBE rangeAlex Williamson1-7/+0
Old versions of the BOCHs VGA BIOS (cira 2003) made use of VBE registers at 0xff80/81. In VBE API version 0xb0c2 these were moved to 0x1ce/cf. Unfortunately, QEMU still registers handlers for the old range. If a guest attempts to assign an I/O device overlapping this region, QEMU exits with a hw_error. Windows guests seem to like to assign I/O devices to the high end of the address space, so it's pretty easy to hot add an rtl8139 to a Win2k8 guest and trigger the bug. I can't find any reason to register these handlers, so let's remove the cruft. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22QMP: Update README fileLuiz Capitulino1-23/+48
A number of changes I prefer to do in one shot: - Fix example - Small clarifications - Add multiple monitors example - Add 'Development Process' section Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22QMP doc: Add 'Stability Considerations' sectionLuiz Capitulino1-2/+24
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22QMP/monitor: update do_info_version() to output broken down version stringMiguel Di Ciurcio Filho1-4/+19
This code was originally developed by Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22QMP: update 'query-version' documentationMiguel Di Ciurcio Filho1-2/+14
Update the documentation of 'query-version' to output the string version broken down. Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write()Yoshiaki Tamura1-1/+1
Setting fd = -1 to qemu_set_fd_handler2() causes bus error at FD_SET in main_loop_wait(). Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22virtio-serial: Cleanup on device hot-unplugAmit Shah3-1/+27
Free malloc'ed memory, unregister from savevm and clean up virtio-common bits on device hot-unplug. This was found performing a migration after device hot-unplug. Reported-by: <lihuang@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22target-i386: svm: Fix MSRPM checkAdam Lackorzynski1-1/+1
Correct the calculation of the offset in the msrpm for the MSR range 0 - 0x1fff. Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22exec: remove code duplication in qemu_ram_alloc() and qemu_ram_alloc_from_ptr()Yoshiaki Tamura1-58/+26
Since most of the code in qemu_ram_alloc() and qemu_ram_alloc_from_ptr() are duplicated, let qemu_ram_alloc_from_ptr() to switch by checking void *host, and change qemu_ram_alloc() to a wrapper. Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22exec: replace tabs by spaces.Yoshiaki Tamura1-28/+28
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22arch_init: replace tabs by spaces.Yoshiaki Tamura1-6/+6
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22pckbd: support for commands 0xf0-0xff: Pulse output bitBernhard Kohl1-3/+20
I have a guest OS which sends the command 0xfd to the keyboard controller during initialization. To get rid of the message "qemu: unsupported keyboard cmd=0x%02x\n" I added support for the pulse output bit commands. I found the following explanation here: http://www.win.tue.nl/~aeb/linux/kbd/scancodes-11.html#ss11.3 Command 0xf0-0xff: Pulse output bit Bits 3-0 of the output port P2 of the keyboard controller may be pulsed low for approximately 6 µseconds. Bits 3-0 of this command specify the output port bits to be pulsed. 0: Bit should be pulsed. 1: Bit should not be modified. The only useful version of this command is Command 0xfe. (For MCA, replace 3-0 by 1-0 in the above.) Command 0xfe: System reset Pulse bit 0 of the output port P2 of the keyboard controller. This will reset the CPU. Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-20Replace qemu_malloc + memset with qemu_malloczBlue Swirl2-4/+2
Replace a qemu_malloc call, followed by a memset, with qemu_mallocz. Found with this Coccinelle semantic patch, adapted from Coccinelle test package rule 94: @@ type T; expression x; expression E; @@ - x = (T)qemu_malloc(E) + x = qemu_mallocz(E) ... ( - memset(x,0,E); | - memset(x,0,sizeof(*x)); ) Some files (tests/*) had to be filtered out. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-20Use ARRAY_SIZE macroBlue Swirl2-2/+2
Replace array size calculations with ARRAY_SIZE macro. Implemented with this Coccinelle semantic patch, adapted from Linux kernel: @@ type T; T[] E; @@ - (sizeof(E)/sizeof(*E)) + ARRAY_SIZE(E) @@ type T; T[] E; @@ - (sizeof(E)/sizeof(E[...])) + ARRAY_SIZE(E) @@ type T; T[] E; @@ - (sizeof(E)/sizeof(T)) + ARRAY_SIZE(E) Some files (*-dis.c, tests/*) had to be filtered out. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-19Remove useless NULL check for qemu_strdup return valueBlue Swirl1-3/+0
Found with this Coccinelle semantic patch: @@ expression E; identifier ptr; identifier fn ~= "qemu_strn?dup"; @@ -ptr = fn(E); -if (ptr == NULL) { ... } - +ptr = fn(E); Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-19Remove useless NULL checks for qemu_malloc return valueBlue Swirl1-12/+0
Found with this Coccinelle semantic patch: @@ expression E; identifier ptr; identifier fn ~= "qemu_mallocz*"; @@ -ptr = fn(E); -if (ptr == NULL) { ... } - +ptr = fn(E); Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-19savevm: Reset last block info at beginning of each saveAlex Williamson1-2/+5
If we save more than once we need to reset the last block info or else only the first save has the actual block info and each subsequent save will only use continue flags, making them unloadable independently. Found-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-19set proper migration status on ->write error (v5)Marcelo Tosatti2-2/+10
If ->write fails, declare migration status as MIG_STATE_ERROR. Also, in buffered_file.c, ->close the object in case of an error. Fixes "migrate -d "exec:dd of=file", where dd fails to open file. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-19rtc: Remove TARGET_I386 from qemu-config.c, enables driftfixAmit Shah1-2/+0
qemu-config.c doesn't contain any target-specific code, and the TARGET_I386 conditional code didn't get compiled as a result. Removing this enables the driftfix parameter for rtc. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-19QEMUFileBuffered: indicate that we're ready when the underlying file is readyAvi Kivity1-0/+8
QEMUFileBuffered stops writing when the underlying QEMUFile is not ready, and tells its producer so. However, when the underlying QEMUFile becomes ready, it neglects to pass that information along, resulting in stoppage of all data until the next tick (a tenths of a second). Usually this doesn't matter, because most QEMUFiles used with QEMUFileBuffered are almost always ready, but in the case of exec: migration this is not true, due to the small pipe buffers used to connect to the target process. The result is very slow migration. Fix by detecting the readiness notification and propagating it. The detection is a little ugly since QEMUFile overloads put_buffer() to send it, but that's the suject for a different patch. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-15sparc escc IUS improvements (SunOS 4.1.4 fix)Artyom Tarasenko1-26/+30
According to scc_escc_um.pdf: - Reset Highest IUS must update irq status to allow processing of the next priority interrupt. - rx interrupt has always higher priority than tx on same channel The documentation only explicitly says that Reset Highest IUS command (0x38) clears IUS bits, not that it clears the corresponding interrupt too, so don't clear interrupts on this command. The patch allows SunOS 4.1.4 to use the serial ports Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-15Fix mingw32 buildBlue Swirl1-3/+4
Don't define qemu_chr_open_eventfd() on Windows. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-15win32: Avoid compiler warning (WIN32_LEAN_AND_MEAN redefined)Stefan Weil1-0/+4
configure adds the macro WIN32_LEAN_AND_MEAN to QEMU_CFLAGS, and SDL_syswm.h defines it, too. This results in a compiler warning (redefinition of WIN32_LEAN_AND_MEAN in SDL_syswm.h. That warning prevents compilations for win32 with warning = error). Fix this by removing the definition of WIN32_LEAN_AND_MEAN before including SDL_syswm.h. [blauwirbel@gmail.com: rebased] Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-15win32: Add missing function setenvStefan Weil2-0/+17
Mingw32 does not provide a declaration and implementation of function setenv (which is used in sdl.c), so this patch adds both. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-15Disable build of ivshmem on non-KVM systemsCam Macdonell1-1/+1
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-15Add kvm_set_ioeventfd_mmio_long definition for non-KVM systemsCam Macdonell1-0/+5
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-15TCG: Revert ppc64 tcg_out_movi32 changeAndreas Färber1-1/+1
3b6dac34161bc0a342336072643c2f6d17e0ec45 apparently broke the ppc64 TCG target compilation in the code path without guest base. Reverting this line fixes the build. Signed-off-by: Andreas F?rber <andreas.faerber@web.de> Cc: malc <av1474@comtv.ru> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: malc <av1474@comtv.ru>
2010-08-15TCG: Fix Darwin/ppc calling convention recognitionAndreas Färber1-1/+1
5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X v10.5 ppc. Apple's GCC 4.0.1 does not define _CALL_DARWIN. Recognize __APPLE__ again as well. Signed-off-by: Andreas F?rber <andreas.faerber@web.de> Cc: malc <av1474@comtv.ru> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: J?rgen Lock <nox@jelal.kn-bremen.de> Cc: Stefan Weil <weil@mail.berlios.de> Signed-off-by: malc <av1474@comtv.ru>
2010-08-10RESEND: Inter-VM shared memory PCI deviceCam Macdonell5-0/+883
resend for bug fix related to removal of irqfd Support an inter-vm shared memory device that maps a shared-memory object as a PCI device in the guest. This patch also supports interrupts between guest by communicating over a unix domain socket. This patch applies to the qemu-kvm repository. -device ivshmem,size=<size in format accepted by -m>[,shm=<shm name>] Interrupts are supported between multiple VMs by using a shared memory server by using a chardev socket. -device ivshmem,size=<size in format accepted by -m>[,shm=<shm name>] [,chardev=<id>][,msi=on][,ioeventfd=on][,vectors=n][,role=peer|master] -chardev socket,path=<path>,id=<id> The shared memory server, sample programs and init scripts are in a git repo here: www.gitorious.org/nahanni Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-10Support marking a device as non-migratableCam Macdonell2-3/+43
A non-migratable device should be removed before migration and re-added after. Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-10Add function to assign ioeventfd to MMIO.Cam Macdonell2-0/+33
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-10Device specification for shared memory PCI deviceCam Macdonell1-0/+96
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-10Add qemu_ram_alloc_from_ptr functionCam Macdonell2-0/+45
Provide a function to add an allocated region of memory to the qemu RAM. This patch is copied from Marcelo's qemu_ram_map() in qemu-kvm and given the clearer name qemu_ram_alloc_from_ptr(). Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-09Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori9-77/+115
2010-08-09microblaze: Fix the target version of stat64 structEdgar E. Iglesias1-6/+8
MicroBlaze needs TARGET_STAT64_HAS_BROKEN_ST_INO. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-08-07audio/sdl: return on errormalc1-0/+1
Signed-off-by: malc <av1474@comtv.ru>
2010-08-06mips: Add support for VInt and VEIC irq modesEdgar E. Iglesias3-1/+51
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-08-06audio/sdl: be more anal about errorsmalc1-3/+18
Signed-off-by: malc <av1474@comtv.ru>
2010-08-06audio: make audio_pt_init block all signalsmalc2-52/+31
Signed-off-by: malc <av1474@comtv.ru>
2010-08-05kvm: remove guest triggerable abort()Gleb Natapov1-12/+4
This abort() condition is easily triggerable by a guest if it configures pci bar with unaligned address that overlaps main memory. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-08-05kvm: Don't walk memory_size == 0 slots in kvm_client_migration_logAlex Williamson1-0/+3
If we've unregistered a memory area, we should avoid calling qemu_get_ram_ptr() on the left over phys_offset cruft in the slot array. Now that we support removing ramblocks, the phys_offset ram_addr_t can go away and cause a lookup fault and abort. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-08-03sparc32: use FW_CFG_CMDLINE_SIZEBlue Swirl1-0/+3
Add support for getting kernel command line size with FW_CFG_CMDLINE_SIZE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-03ide: Avoid canceling IDE DMAAndrea Arcangeli1-2/+21
The reason for not actually canceling the I/O is because with virtualization and lots of VM running, a guest fs may mistake a overload of the host, as an IDE timeout. So rather than canceling the I/O, it's safer to wait I/O completion and simulate that the I/O has completed just before the io cancellation was requested by the guest. This way if ntfs or an app writes data without checking for -EIO retval, and it thinks the write has succeeded, it's less likely to run into troubles. Similar issues for reads. Furthermore because the DMA operation is splitted into many synchronous aio_read/write if there's more than one entry in the SG table, without this patch the DMA would be cancelled in the middle, something we've no idea if it happens on real hardware too or not. Overall this seems a great risk for zero gain. This approach is sure safer than previous code given we can't pretend all guest fs code out there to check for errors and reply the DMA if it was completed partially, given a timeout would never materialize on a real harddisk unless there are defective blocks (and defective blocks are practically only an issue for reads never for writes in any recent hardware as writing to blocks is the way to fix them) or the harddisk breaks as a whole. Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-03block: Change bdrv_eject() not to drop the imageMarkus Armbruster2-3/+5
bdrv_eject() gets called when a device model opens or closes the tray. If the block driver implements method bdrv_eject(), that method gets called. Drivers host_cdrom implements it, and it opens and closes the physical tray, and nothing else. When a device model opens, then closes the tray, media changes only if the user actively changes the physical media while the tray is open. This is matches how physical hardware behaves. If the block driver doesn't implement method bdrv_eject(), we do something quite different: opening the tray severs the connection to the image by calling bdrv_close(), and closing the tray does nothing. When the device model opens, then closes the tray, media is gone, unless the user actively inserts another one while the tray is open, with a suitable change command in the monitor. This isn't how physical hardware behaves. Rather inconvenient when programs "helpfully" eject media to give you a chance to change it. The way bdrv_eject() behaves here turns that chance into a must, which is not what these programs or their users expect. Change the default action not to call bdrv_close(). Instead, note the tray status in new BlockDriverState member tray_open. Use it in bdrv_is_inserted(). Arguably, the device models should keep track of tray status themselves. But this is less invasive. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-03block: Fix bdrv_has_zero_initKevin Wolf5-10/+28
Assuming that any image on a block device is not properly zero-initialized is actually wrong: Only raw images have this problem. Any other image format shouldn't care about it, they initialize everything properly themselves. Signed-off-by: Kevin Wolf <kwolf@redhat.com>