summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-12-20migration: move buffered_file.c code into migration.cJuan Quintela5-282/+235
This only moves the code (also from buffered_file.h to migration.h). Fix whitespace until checkpatch is happy. Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20savevm: New save live migration method: pendingJuan Quintela8-84/+83
Code just now does (simplified for clarity) if (qemu_savevm_state_iterate(s->file) == 1) { vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); qemu_savevm_state_complete(s->file); } Problem here is that qemu_savevm_state_iterate() returns 1 when it knows that remaining memory to sent takes less than max downtime. But this means that we could end spending 2x max_downtime, one downtime in qemu_savevm_iterate, and the other in qemu_savevm_state_complete. Changed code to: pending_size = qemu_savevm_state_pending(s->file, max_size); DPRINTF("pending size %lu max %lu\n", pending_size, max_size); if (pending_size >= max_size) { ret = qemu_savevm_state_iterate(s->file); } else { vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); qemu_savevm_state_complete(s->file); } So what we do is: at current network speed, we calculate the maximum number of bytes we can sent: max_size. Then we ask every save_live section how much they have pending. If they are less than max_size, we move to complete phase, otherwise we do an iterate one. This makes things much simpler, because now individual sections don't have to caluclate the bandwidth (it was implossible to do right from there). Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-20buffered_file: unfold buffered_append in buffered_put_bufferJuan Quintela1-19/+14
It was the only user, and now buffered_put_buffer just do the append Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-20buffered_file: don't flush on put bufferJuan Quintela1-6/+0
We call buffered_put_buffer with iothread held, and buffered_flush() does synchronous writes. We only want to do the synchronous writes outside. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-20buffered_file: Unfold the trick to restart generating migration dataJuan Quintela1-9/+10
This was needed before due to the way that the callbacks worked. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-20migration: just lock migrate_fd_put_readyJuan Quintela2-2/+5
Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20migration: remove unfreeze logicJuan Quintela3-47/+1
Now that we have a thread, and blocking writes, we don't need it. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-20migration: make writes blockingJuan Quintela7-29/+2
Move all the writes to the migration_thread, and make writings blocking. Notice that are still using the iothread for everything that we do. Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20migration: move migration thread init code to migrate_fd_put_readyJuan Quintela2-12/+18
This way everything related with migration is run on the migration thread and no locking is needed. Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20migration: make qemu_fopen_ops_buffered() return voidJuan Quintela4-9/+9
We want the file assignment to happen before the thread is created to avoid locking, so we just do it before creating the thread. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2012-12-20buffered_file: Move from using a timer to use a threadJuan Quintela1-22/+36
We still protect everything except the wait with the iothread lock. But we moved from a timer to a thread. Steps one by one. We also need to detect when we have finished with a variable "complete". Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20protect the ramlist with a separate mutexUmesh Deshpande3-3/+44
Add the new mutex that protects shared state between ram_save_live and the iothread. If the iothread mutex has to be taken together with the ramlist mutex, the iothread shall always be _outside_. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Umesh Deshpande <udeshpan@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2012-12-20add a version number to ram_listUmesh Deshpande3-1/+11
This will be used to detect if last_block might have become invalid across different calls to ram_save_live. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Umesh Deshpande <udeshpan@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2012-12-20exec: sort the memory from biggest to smallestPaolo Bonzini2-32/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20exec: change RAM list to a TAILQPaolo Bonzini6-38/+38
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20exec: change ramlist from MRU order to a 1-item cachePaolo Bonzini3-21/+30
Most of the time, only 2 items will be active (from/to for a string operation, or code/data). But TCG guests likely won't have gigabytes of memory, so this actually goes down to 1 item. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20migration-fd: remove duplicate includeJuan Quintela1-1/+0
Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20migration: include qemu-file.hJuan Quintela4-4/+4
They don't use/know anything about buffered-file. Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20migration: remove double call to migrate_fd_closePaolo Bonzini1-1/+1
The call in buffered_close is enough, because buffered_close is called already by migrate_fd_cleanup. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20buffered_file: do not send more than s->bytes_xfer bytes per tickPaolo Bonzini1-2/+2
Sending more was possible if the buffer was large. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-20migration: fix migration_bitmap leakPaolo Bonzini1-6/+7
Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-19Merge remote-tracking branch 'bonzini/header-dirs' into stagingAnthony Liguori1124-3428/+3155
* bonzini/header-dirs: (45 commits) janitor: move remaining public headers to include/ hw: move executable format header files to hw/ fpu: move public header file to include/fpu softmmu: move remaining include files to include/ subdirectories softmmu: move include files to include/sysemu/ misc: move include files to include/qemu/ qom: move include files to include/qom/ migration: move include files to include/migration/ monitor: move include files to include/monitor/ exec: move include files to include/exec/ block: move include files to include/block/ qapi: move include files to include/qobject/ janitor: add guards to headers qapi: make struct Visitor opaque qapi: remove qapi/qapi-types-core.h qapi: move inclusions of qemu-common.h from headers to .c files ui: move files to ui/ and include/ui/ qemu-ga: move qemu-ga files to qga/ net: reorganize headers net: move net.c to net/ ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-19janitor: move remaining public headers to include/Paolo Bonzini4-0/+0
Headers in the root directory are now used only from within that directory. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19hw: move executable format header files to hw/Paolo Bonzini2-430/+0
Or delete a.out.h which is unused. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19fpu: move public header file to include/fpuPaolo Bonzini26-27/+25
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19softmmu: move remaining include files to include/ subdirectoriesPaolo Bonzini61-61/+61
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19softmmu: move include files to include/sysemu/Paolo Bonzini296-421/+421
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19misc: move include files to include/qemu/Paolo Bonzini496-673/+673
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qom: move include files to include/qom/Paolo Bonzini27-28/+28
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19migration: move include files to include/migration/Paolo Bonzini32-33/+33
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19monitor: move include files to include/monitor/Paolo Bonzini84-87/+87
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19exec: move include files to include/exec/Paolo Bonzini277-456/+456
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19block: move include files to include/block/Paolo Bonzini109-134/+134
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: move include files to include/qobject/Paolo Bonzini119-241/+241
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: add guards to headersPaolo Bonzini50-0/+219
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: make struct Visitor opaquePaolo Bonzini2-40/+40
Move its definition from qapi-visit-core.h to qapi-visit-impl.h. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: remove qapi/qapi-types-core.hPaolo Bonzini10-22/+10
The file is only including error.h and qerror.h. Prefer explicit inclusion of whatever files are needed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: move inclusions of qemu-common.h from headers to .c filesPaolo Bonzini13-1/+14
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19ui: move files to ui/ and include/ui/Paolo Bonzini80-101/+95
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qemu-ga: move qemu-ga files to qga/Paolo Bonzini5-6/+7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19net: reorganize headersPaolo Bonzini99-156/+170
Move public headers to include/net, and leave private headers in net/. Put the virtio headers in include/net/tap.h, removing the multiple copies that existed. Leave include/net/tap.h as the interface for NICs, and net/tap_int.h as the interface for OS-specific parts of the tap backend. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19net: move net.c to net/Paolo Bonzini3-6/+6
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19net: do not include net.h everywherePaolo Bonzini17-16/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19net: move Bluetooth stuff out of net.hPaolo Bonzini8-21/+17
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: do not include qemu-char everywherePaolo Bonzini31-25/+7
Touching char/char.h basically causes the whole of QEMU to be rebuilt. Avoid this, it is usually unnecessary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: do not rely on indirect inclusions of or from qemu-char.hPaolo Bonzini26-0/+27
Various header files rely on qemu-char.h including qemu-config.h or main-loop.h, but they really do not need qemu-char.h at all (particularly interesting is the case of the block layer!). Clean this up, and also add missing inclusions of qemu-char.h itself. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: kill libuserPaolo Bonzini5-35/+6
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: kill libdis, move disassemblers to disas/Paolo Bonzini51-115/+86
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: create ldscripts/Paolo Bonzini14-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: move rules from Makefile to */Makefile.objsPaolo Bonzini5-10/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>