]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Account for fact that virDomainDeviceDefCopy() does an inactive copy
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 4 Jan 2022 16:47:00 +0000 (17:47 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 6 Jan 2022 11:30:04 +0000 (12:30 +0100)
commit7d9a7fdcd44eeb874d2bac9255d93d31a832fad2
treeb75d873a0880b1136c9ebc5137695adaddfd85e7
parent2a9264b8b25e5cd9e54196ebf06a11f6d8846823
Account for fact that virDomainDeviceDefCopy() does an inactive copy

In a few places (e.g. device attach/detach/update) we are given a
device XML, parse it but then need a copy of parsed data so that
the original can be passed to function handling the request over
inactive XML and the copy is then passed to function handling the
operation over live XML. Note, both functions consume passed
device on success, hence the need for copy.

The problem is in combination of how the copy is obtained and
where is passed. The copy is done by calling
virDomainDeviceDefCopy() which does only inactive copy, i.e. no
live information is copied over (e.g. no aliases).

Then, this copy (inactive XML effectively) is passed to function
handling live part of the operation (e.g.
qemuDomainUpdateDeviceLive()) and the definition containing all
the juicy, live bits is passed to function handling inactive part
of the operation (e.g. qemuDomainUpdateDeviceConfig()).

This is rather incorrect, and XML copies should be passed to
their respective functions.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2036895
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/lxc/lxc_driver.c
src/qemu/qemu_driver.c