Il 20/02/2013 07:32, Kazuya Saito ha scritto: > Signed-off-by: Kazuya Saito <saito.kaz...@jp.fujitsu.com>
Unfortunately, this conflicts with my series to simplify migration.c (branch migration-thread-20130115 in git://github.com/bonzini/qemu.git). I'm not sure how to proceed here, because migrate_set_state doesn't exist anymore. Probably you need many different tracepoints. Paolo > --- > include/migration/migration.h | 2 ++ > migration.c | 19 +++++++++++++------ > trace-events | 3 +++ > 3 files changed, 18 insertions(+), 6 deletions(-) > > diff --git a/include/migration/migration.h b/include/migration/migration.h > index a8c9639..3d8b2a8 100644 > --- a/include/migration/migration.h > +++ b/include/migration/migration.h > @@ -132,4 +132,6 @@ int migrate_use_xbzrle(void); > int64_t migrate_xbzrle_cache_size(void); > > int64_t xbzrle_cache_resize(int64_t new_size); > + > +void migrate_set_state(MigrationState *s, int new_state); > #endif > diff --git a/migration.c b/migration.c > index b1ebb01..c52d634 100644 > --- a/migration.c > +++ b/migration.c > @@ -23,6 +23,7 @@ > #include "migration/block.h" > #include "qemu/thread.h" > #include "qmp-commands.h" > +#include "trace.h" > > //#define DEBUG_MIGRATION > > @@ -277,7 +278,7 @@ static int migrate_fd_cleanup(MigrationState *s) > void migrate_fd_error(MigrationState *s) > { > DPRINTF("setting error state\n"); > - s->state = MIG_STATE_ERROR; > + migrate_set_state(s, MIG_STATE_ERROR); > notifier_list_notify(&migration_state_notifiers, s); > migrate_fd_cleanup(s); > } > @@ -286,9 +287,9 @@ static void migrate_fd_completed(MigrationState *s) > { > DPRINTF("setting completed state\n"); > if (migrate_fd_cleanup(s) < 0) { > - s->state = MIG_STATE_ERROR; > + migrate_set_state(s, MIG_STATE_ERROR); > } else { > - s->state = MIG_STATE_COMPLETED; > + migrate_set_state(s, MIG_STATE_COMPLETED); > runstate_set(RUN_STATE_POSTMIGRATE); > } > notifier_list_notify(&migration_state_notifiers, s); > @@ -320,7 +321,7 @@ static void migrate_fd_cancel(MigrationState *s) > > DPRINTF("cancelling migration\n"); > > - s->state = MIG_STATE_CANCELLED; > + migrate_set_state(s, MIG_STATE_CANCELLED); > notifier_list_notify(&migration_state_notifiers, s); > qemu_savevm_state_cancel(); > > @@ -381,7 +382,7 @@ static MigrationState *migrate_init(const > MigrationParams *params) > s->xbzrle_cache_size = xbzrle_cache_size; > > s->bandwidth_limit = bandwidth_limit; > - s->state = MIG_STATE_SETUP; > + migrate_set_state(s, MIG_STATE_SETUP); > s->total_time = qemu_get_clock_ms(rt_clock); > > return s; > @@ -769,7 +770,7 @@ static const QEMUFileOps buffered_file_ops = { > > void migrate_fd_connect(MigrationState *s) > { > - s->state = MIG_STATE_ACTIVE; > + migrate_set_state(s, MIG_STATE_ACTIVE); > s->bytes_xfer = 0; > s->buffer = NULL; > s->buffer_size = 0; > @@ -784,3 +785,9 @@ void migrate_fd_connect(MigrationState *s) > QEMU_THREAD_DETACHED); > notifier_list_notify(&migration_state_notifiers, s); > } > + > +void migrate_set_state(MigrationState *s, int new_state) > +{ > + s->state = new_state; > + trace_migrate_set_state(new_state); > +} > diff --git a/trace-events b/trace-events > index bf508f0..1be907e 100644 > --- a/trace-events > +++ b/trace-events > @@ -1091,3 +1091,6 @@ css_io_interrupt(int cssid, int ssid, int schid, > uint32_t intparm, uint8_t isc, > # hw/s390x/virtio-ccw.c > virtio_ccw_interpret_ccw(int cssid, int ssid, int schid, int cmd_code) > "VIRTIO-CCW: %x.%x.%04x: interpret command %x" > virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const > char *devno_mode) "VIRTIO-CCW: add subchannel %x.%x.%04x, devno %04x (%s)" > + > +# migration.c > +migrate_set_state(int new_state) "new state %d" >