]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Pass correct qemuCaps to virDomainDeviceDefPostParse
authorJiri Denemark <jdenemar@redhat.com>
Thu, 8 Aug 2019 13:36:00 +0000 (15:36 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 9 Aug 2019 11:55:54 +0000 (13:55 +0200)
commitb449c270416468ec8b73670b49a9aff87c8902a2
tree971c73aec4bf2651ebfc0beb8ca760f8a7d0ae5f
parent577a1f98fc84e4152c246695942502ef9a45c7f7
qemu: Pass correct qemuCaps to virDomainDeviceDefPostParse

Since qemuDomainDeviceDefPostParse callback requires qemuCaps, we need
to make sure it gets the capabilities stored in the domain's private
data if the domain is running. Passing NULL may cause QEMU capabilities
probing to be triggered in case QEMU binary changed in the meantime.
When this happens while a running domain object is locked, QMP event
delivered to the domain before QEMU capabilities probing finishes will
deadlock the event loop.

QEMU capabilities lookup (via domainPostParseDataAlloc callback) is
hidden inside virDomainDeviceDefPostParseOne with no way to pass
qemuCaps to virDomainDeviceDef* functions. This patch fixes all
remaining paths leading to virDomainDeviceDefPostParse.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libxl/libxl_driver.c
src/lxc/lxc_driver.c
src/openvz/openvz_driver.c
src/phyp/phyp_driver.c
src/qemu/qemu_driver.c
src/vbox/vbox_common.c
tests/qemuhotplugtest.c