mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
The libvirt libxl driver has no access to FDs associated with VM disks. The disks are opened by libxl.so and any related FDs are not exposed to applications. The prevents using virtlockd's auto-release feature to release locks when the FD is closed. Acquiring and releasing locks is explicitly handled by the libxl driver. The current logic is structured such that locks are acquired in libxlDomainStart and released in libxlDomainCleanup. This works well except for migration, where the locks must be released on the source host before the domain can be started on the destination host, but the domain cannot be cleaned up until the migration confirmation stage. When libxlDomainCleanup if finally called in the confirm stage, locks are again released resulting in confusing errors from virtlockd and libvirtd virtlockd[8095]: resource busy: Lockspace resource 'xxxxxx' is not locked libvirtd[8050]: resource busy: Lockspace resource 'xxxxxx' is not locked libvirtd[8050]: Unable to release lease on testvm The error is also encountered in some error cases, e.g. when libxlDomainStart fails before acquiring locks and libxlDomainCleanup is still used for cleanup. In lieu of a mechanism to check if a lock has been acquired, this patch takes an easy approach to fixing the unnecessary lock releases by adding an indicator to the libxlDomainPrivate object that can be set when the lock is acquired and cleared when the lock is released. libxlDomainCleanup can then skip releasing the lock in cases where it was previously released or never acquired in the first place. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> |
||
---|---|---|
.. | ||
libvirtd_libxl.aug | ||
libxl_capabilities.c | ||
libxl_capabilities.h | ||
libxl_conf.c | ||
libxl_conf.h | ||
libxl_domain.c | ||
libxl_domain.h | ||
libxl_driver.c | ||
libxl_driver.h | ||
libxl_logger.c | ||
libxl_logger.h | ||
libxl_migration.c | ||
libxl_migration.h | ||
libxl.conf | ||
meson.build | ||
test_libvirtd_libxl.aug.in | ||
virtxend.init.in | ||
virtxend.service.in | ||
virtxend.sysconf | ||
xen_common.c | ||
xen_common.h | ||
xen_xl.c | ||
xen_xl.h | ||
xen_xm.c | ||
xen_xm.h | ||
xenxs_private.h |