参考 http://www.linux-kvm.org/page/Migration
同一台机器:
启动原guest:
~/git/qemu/i386-softmmu/qemu-system-i386 -enable-kvm -drive file=ubuntu.qcow2 -boot dc -m 512 -monitor stdio -netdev user,id=usernet -device rtl8139,netdev=usernet
启动目的guest:
~/git/qemu/i386-softmmu/qemu-system-i386 -enable-kvm -drive file=ubuntu.qcow2 -boot dc -m 512 -monitor stdio -netdev user,id=usernet -device rtl8139,netdev=usernet -incoming tcp:0:4444
在原机器的monitor中输入:
migrate -d tcp:0:4444
查看迁移情况:
info migrate
算法
参考 http://www.linux-kvm.org/page/Migration
1. Setup
2. Transfer Memory
3. Stop the guest
4. Transfer State
5. Continue the guest
一些log
htab_save_iterate(): first_pass=1
htab_save_iterate(): first_pass=1
htab_save_iterate(): first_pass=1
htab_save_iterate(): first_pass=0
htab_save_iterate(): first_pass=0
htab_save_iterate(): first_pass=0
htab_save_iterate(): first_pass=0
Hash table migration complete
First pass (3 iterations): 34147 chunks, 34997 valid, 489291 invalid
Middle passes (4 iterations): 0 chunks, 0 valid, 0 invalid
Final transfer: 0 chunks, 0 valid, 0 invalid
Qemu的一些接口
http://www.linux-kvm.org/page/MigrationQemu0.8.2
和例子中的接口是两套。