libvirt/src/libxl
Jim Fehlig 44a54eb073 libxl: fix ref counting of libxlMigrationDstArgs
This patch fixes some flawed logic around ref counting the
libxlMigrationDstArgs object.

First, when adding sockets to the event loop with
virNetSocketAddIOCallback(), the generic virObjectFreeCallback()
was registered as a free function, with libxlMigrationDstArgs as
its parameter. A reference was also taken on
libxlMigrationDstArgs for each successful call to
virNetSocketAddIOCallback(). The rational behind this logic was
that the libxlMigrationDstArgs object had to out-live the socket
objects. But virNetSocketAddIOCallback() already takes a
reference on socket objects, ensuring their life until removed
from the event loop and unref'ed in virNetSocketEventFree(). We
only need to ensure libxlMigrationDstArgs lives until
libxlDoMigrateReceive() finishes, which can be done by simply
unref'ing libxlMigrationDstArgs at the end of
libxlDoMigrateReceive().

The second flaw was unref'ing the sockets in the failure path of
libxlMigrateReceive() and at the end of libxlDoMigrateReceive().
As mentioned above, the sockets are already unref'ed by
virNetSocketEventFree() when removed from the event loop.
Attempting to unref the socket a second time resulted in a
libvirtd crash since the socket was previously unref'ed and
disposed.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2015-08-27 15:51:03 -06:00
..
libvirtd_libxl.aug libxl: provide integration with lock manager 2015-04-29 10:51:36 -06:00
libxl_conf.c libxl: Add timestamp to the libxl driver log. 2015-06-12 19:13:59 -06:00
libxl_conf.h libxl: change reservedVNCPorts to reservedGraphicsPorts 2015-05-28 12:40:43 -06:00
libxl_domain.c conf: Pass private data to Parse function of XML options 2015-08-13 15:06:06 +02:00
libxl_domain.h libxl: rework setting the state of virDomainObj 2015-07-08 15:24:48 -06:00
libxl_driver.c libxl: set dom0 state to running 2015-07-10 11:36:57 -06:00
libxl_driver.h libxl: Use standard format for source file copyright notice 2013-09-03 23:53:48 -06:00
libxl_migration.c libxl: fix ref counting of libxlMigrationDstArgs 2015-08-27 15:51:03 -06:00
libxl_migration.h libxl: remove domain when migration prepare fails 2014-07-08 17:14:50 -06:00
libxl.conf libxl: provide integration with lock manager 2015-04-29 10:51:36 -06:00
test_libvirtd_libxl.aug.in libxl: provide integration with lock manager 2015-04-29 10:51:36 -06:00