Add support for domain migrations
This adds basic support for domain migrations from one hypervisor to another. Migration options, e.g., live, tunneled, compressed, etc.., are specified by the constants described `constants.Migrate*`. Two unknowns remain, Libvirt specifies `RemoteParameters` and `CookieIn`. In testing both values are always set to 0 by `virsh` and the source does not provide clear definitions of their purpose. For now, using the same zero'd values used by `virsh` will be Good Enough.
This commit is contained in:
		| @@ -94,6 +94,19 @@ var testDisconnectReply = []byte{ | ||||
| 	0x00, 0x00, 0x00, 0x00, // status | ||||
| } | ||||
|  | ||||
| var testMigrateReply = []byte{ | ||||
| 	0x00, 0x00, 0x00, 0x20, // length | ||||
| 	0x20, 0x00, 0x80, 0x86, // program | ||||
| 	0x00, 0x00, 0x00, 0x01, // version | ||||
| 	0x00, 0x00, 0x01, 0x31, // procedure | ||||
| 	0x00, 0x00, 0x00, 0x01, // type | ||||
| 	0x00, 0x00, 0x00, 0x00, // serial | ||||
| 	0x00, 0x00, 0x00, 0x00, // status | ||||
|  | ||||
| 	// cookie out: 0 | ||||
| 	0x00, 0x00, 0x00, 0x00, | ||||
| } | ||||
|  | ||||
| var testRunReply = []byte{ | ||||
| 	0x00, 0x00, 0x00, 0x74, // length | ||||
| 	0x20, 0x00, 0x80, 0x87, // program | ||||
| @@ -262,6 +275,8 @@ func (m *MockLibvirt) handleRemote(procedure uint32, conn net.Conn) { | ||||
| 		conn.Write(m.reply(testDomainsReply)) | ||||
| 	case constants.ProcDomainMigrateSetMaxSpeed: | ||||
| 		conn.Write(m.reply(testSetSpeedReply)) | ||||
| 	case constants.ProcMigratePerformParams: | ||||
| 		conn.Write(m.reply(testMigrateReply)) | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user