diff options
author | zhanghailiang | 2018-09-03 06:38:58 +0200 |
---|---|---|
committer | Jason Wang | 2018-10-19 05:15:03 +0200 |
commit | 7b3435309d27910587c7e6e8ba07e4070fb37bbb (patch) | |
tree | 96746acf0100f607b690f9ad8fa0dd1aa0eeed03 /migration | |
parent | filter-rewriter: handle checkpoint and failover event (diff) | |
download | qemu-7b3435309d27910587c7e6e8ba07e4070fb37bbb.tar.gz qemu-7b3435309d27910587c7e6e8ba07e4070fb37bbb.tar.xz qemu-7b3435309d27910587c7e6e8ba07e4070fb37bbb.zip |
COLO: notify net filters about checkpoint/failover event
Notify all net filters about the checkpoint and failover event.
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/colo.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/migration/colo.c b/migration/colo.c index 59bb507189..57a85424fc 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -31,6 +31,7 @@ #include "qapi/qapi-events-migration.h" #include "qapi/qmp/qerror.h" #include "sysemu/cpus.h" +#include "net/filter.h" static bool vmstate_loading; static Notifier packets_compare_notifier; @@ -83,6 +84,12 @@ static void secondary_vm_do_failover(void) error_report_err(local_err); } + /* Notify all filters of all NIC to do checkpoint */ + colo_notify_filters_event(COLO_EVENT_FAILOVER, &local_err); + if (local_err) { + error_report_err(local_err); + } + if (!autostart) { error_report("\"-S\" qemu option will be ignored in secondary side"); /* recover runstate to normal migration finish state */ @@ -782,6 +789,14 @@ void *colo_process_incoming_thread(void *opaque) goto out; } + /* Notify all filters of all NIC to do checkpoint */ + colo_notify_filters_event(COLO_EVENT_CHECKPOINT, &local_err); + + if (local_err) { + qemu_mutex_unlock_iothread(); + goto out; + } + vmstate_loading = false; vm_start(); trace_colo_vm_state_change("stop", "run"); |