summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* simplify main loop functionsPaolo Bonzini2011-10-213-44/+41
| | | | | | Provide a clean example of how to use the main loop in the tools. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Revert to a hand-made select loopPaolo Bonzini2011-10-211-53/+1
| | | | | | | This reverts commit c82dc29a9112f34e0a51cad9a412cf6d9d05dfb2 and 4d88a2ac8643265108ef1fb47ceee5d7b28e19f2. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* main-loop: create main-loop.cPaolo Bonzini2011-10-2111-454/+523
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* main-loop: create main-loop.hPaolo Bonzini2011-10-2112-64/+336
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-timer: do not use RunState change handlersPaolo Bonzini2011-10-211-8/+4
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-timer: move more stuff out of qemu-timer.cPaolo Bonzini2011-10-214-31/+32
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-timer: use atexit for quit_timersPaolo Bonzini2011-10-213-9/+8
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-timer: do not refer to runstate_is_running()Paolo Bonzini2011-10-212-4/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-timer: move icount to cpus.cPaolo Bonzini2011-10-216-323/+296
| | | | | | | None of this is needed by tools, and most of it can even be made static inside cpus.c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-timer: more clock functionsPaolo Bonzini2011-10-212-0/+28
| | | | | | | These will be used when moving icount accounting to cpus.c. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-timer: move common code to qemu_rearm_alarm_timerPaolo Bonzini2011-10-211-76/+53
| | | | | Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-timer: remove active_timers arrayPaolo Bonzini2011-10-211-31/+28
| | | | | | | Embed the list in the QEMUClock instead. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* remove unused functionPaolo Bonzini2011-10-212-6/+0
| | | | | Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hw/9pfs: Fix broken compilation caused by wrong trace eventsStefan Weil2011-10-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c572f23a3e7180dbeab5e86583e43ea2afed6271 added trace events with mismatching format string and arguments. gcc reports these errors: In file included from trace.c:2:0: trace.h: In function ‘trace_v9fs_attach’: trace.h:2850:9: error: too many arguments for format [-Werror=format-extra-args] trace.h: In function ‘trace_v9fs_wstat’: trace.h:3039:9: error: too many arguments for format [-Werror=format-extra-args] trace.h: In function ‘trace_v9fs_mkdir’: trace.h:3088:9: error: too many arguments for format [-Werror=format-extra-args] trace.h: In function ‘trace_v9fs_mkdir_return’: trace.h:3095:9: error: too many arguments for format [-Werror=format-extra-args] Fix the format strings and also use %u instead of %d for unsigned values in the changed strings. There are more minor errors of this kind which I did not fix because that would make the review more difficult. v2: Fixed position of } for v9fs_mkdir_return. Cc: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'quintela/migration-pull' into stagingAnthony Liguori2011-10-2013-598/+550
|\
| * migration: make migration-{tcp,unix} consistentJuan Quintela2011-10-202-26/+35
| | | | | | | | | | | | | | | | Files are almost identical in functionality, just remove the differences that make no sense. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: propagate error correctlyJuan Quintela2011-10-202-25/+21
| | | | | | | | | | | | | | | | | | unix and tcp outgoing migration have error values, but didn't returned it. Make them return the error. Notice that EINPROGRESS & EWOULDBLOCK are not considered errors as call will be retry later. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Don't use callback on file defining itJuan Quintela2011-10-202-5/+5
| | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Make state definitions localJuan Quintela2011-10-202-8/+8
| | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Export a function that tells if the migration has finished correctlyJuan Quintela2011-10-203-5/+5
| | | | | | | | | | | | This will allow us to hide the state values. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Pass MigrationState in migration notifiersJuan Quintela2011-10-201-4/+4
| | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Use bandwidth_limit directlyJuan Quintela2011-10-201-7/+8
| | | | | | | | | | | | | | Now that current_migration always exist, there is no reason for max_throotle variable. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: create accessor for current_migrationJuan Quintela2011-10-201-61/+55
| | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Move exported functions to the end of the fileJuan Quintela2011-10-201-96/+91
| | | | | | | | | | | | | | This means we can remove the two forward declarations. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Remove migration cancel() callbackJuan Quintela2011-10-202-6/+4
| | | | | | | | | | | | It is used only in one place Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Remove get_status() accessorJuan Quintela2011-10-202-12/+5
| | | | | | | | | | | | | | It is only used inside migration.c, and fields on that struct are accessed all around the place on that file. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Our release callback was just freeJuan Quintela2011-10-202-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | We called it from a single place, and always with state != MIG_STATE_ACTIVE. Just remove the whole callback. For users of the notifier, notice that this is exactly the case where they don't care, we are just freeing the state from previous failed migration (it can't be a sucessful one, otherwise we would not be running on that machine in the first place). Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Introduce migrate_fd_completed() for consistencyJuan Quintela2011-10-201-7/+13
| | | | | | | | | | | | | | | | This function is a bit different of the others that change the state, in the sense that if migrate_fd_cleanup() returns an error, it set the status to error, not completed. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Refactor and simplify error checking in migrate_fd_put_readyJuan Quintela2011-10-201-11/+10
| | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Introduce MIG_STATE_SETUPJuan Quintela2011-10-202-5/+12
| | | | | | | | | | | | | | | | Use MIG_STATE_ACTIVE only when migration has really started. Use this new state to setup migration parameters. Change defines for an anonymous struct. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: move migrate_new to do_migrateJuan Quintela2011-10-206-100/+46
| | | | | | | | | | | | | | | | Once there, remove all parameters that don't need to be passed to *start_outgoing_migration() functions Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Make all posible migration functions staticJuan Quintela2011-10-202-48/+36
| | | | | | | | | | | | | | I have to move two functions postions to avoid forward declarations Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Refactor MigrationState creationJuan Quintela2011-10-206-70/+32
| | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Rename FdMigrationState MigrationStateJuan Quintela2011-10-206-58/+58
| | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Fold MigrationState into FdMigrationStateJuan Quintela2011-10-206-46/+31
| | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Use FdMigrationState instead of MigrationState when possibleJuan Quintela2011-10-202-26/+24
| | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Make *start_outgoing_migration return FdMigrationStateJuan Quintela2011-10-206-14/+14
| | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: make *save_live return errorsJuan Quintela2011-10-203-11/+29
| | | | | | | | | | | | | | Make *save_live() return negative values when there is one error, and updates all callers to check for the error. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: use qemu_file_get_error() return value when possibleJuan Quintela2011-10-204-16/+24
| | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
| * savevm: Rename has_error to last_error fieldJuan Quintela2011-10-201-8/+8
| | | | | | | | | | | | | | Now the field contains the last error name, so rename acordingly. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: rename qemu_file_has_error to qemu_file_get_errorJuan Quintela2011-10-206-20/+21
| | | | | | | | | | | | | | Now the function returned errno, so it is better the new name. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: return real error codeJuan Quintela2011-10-202-19/+26
| | | | | | | | | | | | | | make functions propagate errno, instead of just using -EIO. Add a comment about what are the return value of qemu_savevm_state_iterate(). Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: change has_error to contain errno valuesJuan Quintela2011-10-206-14/+15
| | | | | | | | | | | | We normally already have an errno value. When not, abuse EIO. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: set error if select return one errorJuan Quintela2011-10-201-0/+4
| | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: don't "write" when migration is not activeJuan Quintela2011-10-201-0/+4
| | | | | | | | | | | | If migration is not active, just ignore writes. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * buffered_file: reuse QEMUFile has_error fieldJuan Quintela2011-10-201-9/+8
| | | | | | | | | | | | | | | | | | Instead of having two has_error fields in QEMUFile & QEMUBufferedFile, reuse the 1st one. Notice that the one in buffered_file is only set after a file operation. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * buffered_file: Use right "opaque"Juan Quintela2011-10-201-1/+1
| | | | | | | | | | | | | | | | | | buffered_close 's' variable is of type QEMUFileBuffered, and wait_for_unfreeze() expect to receive a MigrationState, that 'coincidentaly' is s->opaque. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: If there is one error, it makes no sense to continueJuan Quintela2011-10-201-3/+9
| | | | | | | | | | | | Once there, add a comment about what each error mean. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: add error handling to migrate_fd_put_notify().Yoshiaki Tamura2011-10-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | Although migrate_fd_put_buffer() sets MIG_STATE_ERROR if it failed, since migrate_fd_put_notify() isn't checking error of underlying QEMUFile, those resources are kept open. This patch checks it and calls migrate_fd_error() in case of error. Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: Check that migration is active before cancel itJuan Quintela2011-10-201-2/+2
| | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud