aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2009-05-22usb-serial: implement break event.Jason Wessel1-2/+10
Implement the serial break via usb serial. The second data byte in ftdi status packet contains the break status. The values were already defined in usb-serial.c so it was a matter of making use of the event_trigger to form a urb to send over to the host controller with the serial break status set. This was tested against a linux development image which enables sysrq via a serial break on the ftdi usb console. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2009-05-22slirp: Reassign same address to same DHCP clientJan Kiszka1-3/+5
In case a client restarts a DHCP recovery without releasing its old address, reassign the same address to prevent consuming free addresses and moving away from the standard client address. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2009-05-22kvm: x86: Save/restore KVM-specific CPU statesJan Kiszka5-3/+49
Save and restore all so far neglected KVM-specific CPU states. Handling the TSC stabilizes migration in KVM mode. The interrupt_bitmap and mp_state are currently unused, but will become relevant for in-kernel irqchip support. By including proper saving/restoring already, we avoid having to increment CPU_SAVE_VERSION later on once again. v2: - initialize mp_state runnable (for the boot CPU) Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22kvm: Rework VCPU resetJan Kiszka2-2/+8
Use standard callback with highest order to synchronize VCPU on reset after all device callbacks were execute. This allows to remove the special kvm hook in qemu_system_reset. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Introduce reset notifier orderJan Kiszka74-105/+109
Add the parameter 'order' to qemu_register_reset and sort callbacks on registration. On system reset, callbacks with lower order will be invoked before those with higher order. Update all existing users to the standard order 0. Note: At least for x86, the existing users seem to assume that handlers are called in their registration order. Therefore, the patch preserves this property. If someone feels bored, (s)he could try to identify this dependency and express it properly on callback registration. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22kvm: Fix framebuffer dirty log syncJan Kiszka1-4/+1
kvm_physical_sync_dirty_bitmap() takes the end address as second argument, not the region size. Moverover, the kvm API should not be used directly here, but cpu_physical_sync_dirty_bitmap(). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22kvm: Add missing bits to support live migrationJan Kiszka4-1/+21
This patch adds the missing hooks to allow live migration in KVM mode. It adds proper synchronization before/after saving/restoring the VCPU states (note: PPC is untested), hooks into cpu_physical_memory_set_dirty_tracking() to enable dirty memory logging at KVM level, and synchronizes that drity log into QEMU's view before running ram_live_save(). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22kvm: Rework dirty bitmap synchronizationJan Kiszka4-36/+52
Extend kvm_physical_sync_dirty_bitmap() so that is can sync across multiple slots. Useful for updating the whole dirty log during migration. Moreover, properly pass down errors the whole call chain. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22kvm: Fix dirty log temporary buffer sizeJan Kiszka1-1/+1
The buffer passed to KVM_GET_DIRTY_LOG requires one bit per page. Fix the size calculation in kvm_physical_sync_dirty_bitmap accordingly, avoiding allocation of extremly oversized buffers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22kvm: Introduce kvm_set_migration_logJan Kiszka2-7/+40
Introduce a global dirty logging flag that enforces logging for all slots. This can be used by the live migration code to enable/disable global logging withouth destroying the per-slot setting. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22kvm: Conditionally apply workaround for KVM slot handling bugJan Kiszka1-1/+11
Only apply the workaround for broken slot joining in KVM when the capability was not found that signals the corresponding fix existence. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22qcow2: Allow different cluster sizesKevin Wolf2-5/+49
Add an option to specify the cluster size of a newly created qcow2 image. Default is 4k which is the same value that was hard-coded before. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Convert qemu-img convert to new bdrv_createKevin Wolf1-32/+65
This is part two of the qemu-img conversion. This really works the same as the previous conversion of qemu-img create: It introduces a new -o option for the generic approach and adds the old-style options to this option set. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Convert qemu-img create to new bdrv_createKevin Wolf1-46/+87
This patch changes qemu-img to actually use the new bdrv_create interface. It translates the old-style qemu-img options which have been bdrv_create2 parameters or flags so far to option structures. As the generic approach, it introduces an -o option which accepts any parameter the driver knows. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Convert all block drivers to new bdrv_createKevin Wolf12-55/+214
Now we can make use of the newly introduced option structures. Instead of having bdrv_create carry more and more parameters (which are format specific in most cases), just pass a option structure as defined by the driver itself. bdrv_create2() contains an emulation of the old interface to simplify the transition. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Create qemu-option.hKevin Wolf5-40/+418
This patch creates a new header file and the corresponding implementation file for parsing of parameter strings for options (like used in -drive). Part of this is code moved from vl.c (so qemu-img can use it later). The idea is to have a data structure describing all accepted parameters. When parsing a parameter string, the structure is copied and filled with the parameter values. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22allow changing the speed of a running migrationGlauber Costa1-0/+7
This patch allow us to call migrate_set_speed on running migrations. This should allow mgmt tools to increase the allocated bandwidth of a running migration if there is no progress, and they really want the migration to succeed. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22introduce set_rate_limit function for QEMUFileGlauber Costa3-10/+43
This patch converts the current callers of qemu_fopen_ops(). Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22augment info migrate with page statusGlauber Costa3-1/+27
This patch augments info migrate output with status about: * ram bytes remaining * ram bytes transferred * ram bytes total This should be enough for management tools to realize whether or not there is progress in migration. We can add more information later on, if the need arrives [v2: fixes bytes_transferred type] Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Don't send all gratuitous packets at once.Gleb Natapov1-5/+19
Use timer to separate them in time. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Minimal ethernet frame length is 64 bytes.Gleb Natapov1-1/+2
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Fix segv when passing an unknown protocolAnthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Partially revert e20a8dff4c0da3827764924139d3bb73962f5d5aAnthony Liguori2-8/+5
From Paul Brook: "the fdc is tied to the ISA DMA engine. We don't currently have a target independent method of handling inter-device data transfer." Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Revert "Fix arm-softmmu breakage"Anthony Liguori1-2/+2
This reverts commit ec6bd8dea77478f32981a5df49f66ca2430ad19d. This broke any target that uses virtio. Virtio devices live in libhw and without whole-archive, the constructors will never be called for virtio. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21Introduce is_default field for QEMUMachineAnthony Liguori11-3/+24
f80f9ec changed the order that machines are registered which had the effect of changing the default machine. This changeset introduces a new is_default field so that machine types can declare that they are the default for an architecture. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21Refactor how display drivers are selectedAnthony Liguori5-49/+58
My previous commit, f92f8afebe, broke -vnc (spotted by Glauber Costa). This is because it's necessary to tell when the no special display parameters have been passed and default to SDL or VNC appropriately. This refactors the display selection logic to be less complicated which has the effect of fixing the regression mentioned above. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21Fix arm-softmmu breakageBlue Swirl1-2/+2
Don't use whole-archive for hwlib or libqemu objects Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-05-21Compile most Xen files only onceBlue Swirl4-2/+14
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-05-21Compile fdc, escc and SCSI controllers only onceBlue Swirl3-12/+16
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-05-21Let the venomous poison spread to more identifiersBlue Swirl1-0/+23
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-05-21Convert machine registration to use module init functionsAnthony Liguori45-263/+321
This cleans up quite a lot of #ifdefs, extern variables, and other ugliness. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21Eliminate --disable-gfx-check and make VNC default when SDL not availableAnthony Liguori4-33/+36
--disable-gfx-check predates VNC server support. It made sense back then because the only thing you could do without SDL was use -nographic mode or similar tricks. Since this is a very advanced mode of operation, gfx-check provided a good safety net for casual users. A casual user is very likely to use VNC to interact with a guest. In fact, it's often frustrating to install QEMU on a server and have to specify disable-gfx-check when you only want to use VNC. This patch eliminates disable-gfx-check and makes SDL behave like every other optional dependency. If SDL is not available, instead of failing ungracefully if no special options are specified, we default to -vnc localhost:0,to=99. When we do default to VNC, we also print a message to tell the user that we've done this include which port we're currently listening on. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21Do not attempt to allocate sn_tab when there are no snapshotsmalc1-0/+5
This was caught by a7d27b536ffc0773028a90f14580552c0c3ddb2a which aborted on this attempt, thanks to Alex Ivanov for report. Signed-off-by: malc <av1474@comtv.ru>
2009-05-21Cast pointer arguments of get/setsockopt, send to void * to keep GCCmalc3-3/+4
from producing a warning about pointer type mismatches with Winsock Signed-off-by: malc <av1474@comtv.ru>
2009-05-20kvm: add error message for when SMP is requestedMark McLoughlin1-1/+3
Right now, if you try e.g. '-smp 2' you just get 'failed to initialize KVM'. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-05-20Remove initrd warning messageRichard W.M. Jones1-3/+0
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2009-05-20initialize struct sigevent before timer_createJean-Christophe Dubois1-0/+5
When qemu is run under valgrind, valgrind shows the following output on exit: ==3648== 1 errors in context 2 of 2: ==3648== Syscall param timer_create(evp) points to uninitialised byte(s) ==3648== at 0x54E936A: timer_create (in /lib/librt-2.9.so) ==3648== by 0x405DCF: dynticks_start_timer (vl.c:1549) ==3648== by 0x40A966: main (vl.c:1726) ==3648== Address 0x7fefffb34 is on thread 1's stack ==3648== Uninitialised value was created by a stack allocation ==3648== at 0x405D60: dynticks_start_timer (vl.c:1534) This patch is a simple fix to remove this potential problem. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
2009-05-20Fix NULL alarm_timer pointer at exitJean-Christophe Dubois1-2/+2
This fixes a SIGSEGV error on qemu exit. Here is the valgrind output related to this error ==3648== Process terminating with default action of signal 11 (SIGSEGV) ==3648== Access not within mapped region at address 0x8 ==3648== at 0x40636B: host_alarm_handler (vl.c:1345) ==3648== by 0x52D807F: (within /lib/libpthread-2.9.so) ==3648== by 0x5C0A12E: tcsetattr (in /lib/libc-2.9.so) ==3648== by 0x4DD601: term_exit (qemu-char.c:700) ==3648== by 0x5B636EC: exit (in /lib/libc-2.9.so) ==3648== by 0x5B4B5AC: (below main) (in /lib/libc-2.9.so) This simple fix check for a valid pointer as host_alarm_handler is also called after alarm_timer is released in the exit path. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
2009-05-20keep initrd in below 4g area.Glauber Costa1-4/+5
initrd must be kept on the memory area below 4g. By not doing this, we're seeing guests break while using -initrd and values of -mem superior to 4096. Signed-off-by: Glauber Costa <glommer@redhat.com>
2009-05-20migrate.c: migrate_fd_put_buffer: Do not busyloop: stop writing if EWOULDBLOCKUri Lublin1-1/+1
The migration code is non-blocking, designed for live migration. Practically migrate_fd_put_buffer busy-loops trying to write, as on many machines EWOULDBLOCK==EAGAIN (look in include/asm-generic/errno.h). Signed-off-by: Uri Lublin <uril@redhat.com>
2009-05-20kvm: work around supported cpuid ioctl() brokennessMark McLoughlin1-0/+3
KVM_GET_SUPPORTED_CPUID has been known to fail to return -E2BIG when it runs out of entries. Detect this by always trying again with a bigger table if the ioctl() fills the table. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-05-20remove gcc 3.x requirement from documentationHollis Blanchard1-10/+0
This text is no longer accurate. After the patch is applied, the generated version at http://www.nongnu.org/qemu/qemu-doc.html should be regenerated. This patch is also a candidate for the stable branch. (The URL above is probably generated from the stable branch anyways, so maybe it goes without saying.) Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
2009-05-20Remove dead codemalc1-14/+7
Signed-off-by: malc <av1474@comtv.ru>
2009-05-19Format per CODING_STYLEmalc1-6/+10
Signed-off-by: malc <av1474@comtv.ru>
2009-05-19Abort on attempts to allocate zero bytesmalc1-2/+7
http://marc.info/?t=124267873300015&r=1&w=2 Signed-off-by: malc <av1474@comtv.ru>
2009-05-19Unbreak out-of-tree buildsmalc1-1/+1
Signed-off-by: malc <av1474@comtv.ru>
2009-05-19Hardware convenience libraryPaul Brook18-133/+248
The only target dependency for most hardware is sizeof(target_phys_addr_t). Build these files into a convenience library, and use that instead of building for every target. Remove and poison various target specific macros to avoid bogus target dependencies creeping back in. Big/Little endian is not handled because devices should not know or care about this to start with. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-19Disable >4G ram support on 32-bit targetsPaul Brook1-0/+4
If the target only has a 32-bit physical address space then the code to map >4G ram breaks horribly, and causes compiler warnings. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-19Only define __llseek if it is going to be usedPaul Brook1-1/+1
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-19Avoid implicit truncation compiler warningsPaul Brook1-2/+2
Signed-off-by: Paul Brook <paul@codesourcery.com>