libxl: remove domain when migration prepare fails
In libxlDomainMigrationPrepare(), a new virDomainObj is created from the incoming domain def and added to the driver's domain list, but never removed if there are subsequent failures during the prepare phase. targethost# virsh list --all sourcehost# virsh migrate --live dom xen+ssh://targethost/system error: operation failed: Fail to create socket for incoming migration. targethost# virsh list --all error: Failed to list domains error: name in virGetDomain must not be NULL After adding code to remove the domain on prepare failure, noticed that libvirtd crashed due to double free of the virDomainDef. Similar to the qemu driver, pass a pointer to virDomainDefPtr so it can be set to NULL once a virDomainObj is created from it.
Showing
想要评论请 注册 或 登录