This idea derives from the bug reported: https://bugzilla.redhat.com/show_bug.cgi?id=1439147
It is not a extremely critical bug, since as long as the user uses libvirt to migrate, we won't have such an issue at all (we'll have identical command line parameters for QEMU). However it can be an severe one, since it caused data loss (source VM will quit assuming that destination VM is good, while it is not). So it would be good we fix it. Meanwhile, imho the return path may be used for other things as well in the future. This series proposed a solution for the bug - let's enable return path even for precopy when possible, then source can know whether dest is good or not, then it can decide to do something better than quit. The series is marked as RFC for two reasons: One point for RFC is the idea in general that whether we would like to enable return path for precopy. I see it okay since after all it's optional (so it greatly reduces the chance that QEMU command line user will lose the data, and this feature will be automatically off when we are using e.g. "exec:" to migrate to a file). The other one point is that I converted MigrationState into a QObject (actually a QDevice) to let migration codes benefits from some general framework advantages. I got at least one positive feedback on each of the RFC elements mentioned above, so dare I post this to public. Though I guess some migration reviewers may be on PTO recently (I just know it :), I still decided to post this out for a broader rfc review. Smoke test done, and of course I verified this series to fix the bug mentioned. Please review. Thanks. Peter Xu (6): io: only allow return path for socket typed migration: isolate return path on src migration: fix leak of src file on dst migration: shut src return path unconditionally migration: let MigrationState be an QObject migration: enable return path for precopy include/hw/compat.h | 4 ++ include/io/channel.h | 1 + include/migration/migration.h | 27 ++++++++- include/qemu/typedefs.h | 1 - io/channel-socket.c | 1 + migration/migration.c | 133 +++++++++++++++++++++++++++++++----------- migration/postcopy-ram.c | 1 - migration/qemu-file-channel.c | 9 +++ migration/trace-events | 4 +- 9 files changed, 140 insertions(+), 41 deletions(-) -- 2.7.4