qemu: add migration incoming defer support

qemu commandline supports -incoming defer
and qmp supports migrate-incoming uri.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao
2019-06-14 00:24:26 -07:00
parent 27363b1aca
commit f695ddf8f3
4 changed files with 39 additions and 0 deletions

View File

@@ -1349,6 +1349,23 @@ func TestExecuteVirtSerialPortAdd(t *testing.T) {
<-disconnectedCh
}
// Check migration incoming
func TestExecuteMigrationIncoming(t *testing.T) {
connectedCh := make(chan *QMPVersion)
disconnectedCh := make(chan struct{})
buf := newQMPTestCommandBuffer(t)
buf.AddCommand("migrate-incoming", nil, "return", nil)
cfg := QMPConfig{Logger: qmpTestLogger{}}
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
checkVersion(t, connectedCh)
err := q.ExecuteMigrationIncoming(context.Background(), "uri")
if err != nil {
t.Fatalf("Unexpected error %v", err)
}
q.Shutdown()
<-disconnectedCh
}
// Checks migration status
func TestExecuteQueryMigration(t *testing.T) {
connectedCh := make(chan *QMPVersion)