From 73ac0f5012f6cac512eafc636b0d53d7ded98258 Mon Sep 17 00:00:00 2001 From: Ben LeMasurier Date: Wed, 28 Sep 2016 11:07:03 -0600 Subject: [PATCH] migrate: insert required request structure padding Further testing reveals we need some additional padding on the request passed to libvirt when performing migrations. I believe this is due to the structure alignment normally provided automatically by the compiler. In testing, this fixes an error I was seeing: "Unable to decode message paylaod", returned from libvirt when performing migrations. --- libvirt.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvirt.go b/libvirt.go index 1074e61..d5b57ec 100644 --- a/libvirt.go +++ b/libvirt.go @@ -277,12 +277,14 @@ func (l *Libvirt) Migrate(dom string, dest string, flags MigrateFlags) error { // For now, using the same zero'd values as done by virsh will be Good Enough. payload := struct { Domain Domain + Padding [4]byte DestinationURI string RemoteParameters uint32 CookieIn uint32 Flags MigrateFlags }{ Domain: *d, + Padding: [4]byte{0x0, 0x0, 0x0, 0x1}, DestinationURI: dest, RemoteParameters: 0, CookieIn: 0,