]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: fix leaking of allocated migration ports
authorJim Fehlig <jfehlig@suse.com>
Fri, 14 Oct 2016 17:55:52 +0000 (11:55 -0600)
committerJim Fehlig <jfehlig@suse.com>
Tue, 25 Oct 2016 01:42:10 +0000 (19:42 -0600)
commitf830674bf320522f50a09759fbc568c9f2f436f1
treeedf99a0d354ca62ac7115d21cb40d1cdc181db7d
parentc1be22f971e3aa58afada294066c7636ad624db4
libxl: fix leaking of allocated migration ports

Although the migration port is immediately released in the
finish phase of migration, it was never set in the domain
private object when allocated in the prepare phase. So
libxlDomainMigrationFinish() always released a 0-initialized
migrationPort, leaking any allocated port. After enough
migrations to exhaust the migration port pool, migration would
fail with

error: internal error: Unable to find an unused port in range
       'migration' (49152-49216)

Fix it by setting libxlDomainObjPrivate->migrationPort to the
port allocated in the prepare phase. While at it, also fix
leaking an allocated port if the prepare phase fails.
src/libxl/libxl_migration.c