]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Make IOThread changing more robust
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 7 Jul 2022 15:37:46 +0000 (17:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 13 Jul 2022 09:55:06 +0000 (11:55 +0200)
commit6db9c95a45d4e24cdcd5c009b7fe5da3745b5d59
tree64bdfffe92c9556641db41dd339f88449a9e73de
parent5aa24958546c94a48fb8f8d6022213ca7c07c8a7
qemu: Make IOThread changing more robust

There are three APIs that allow changing IOThreads:

  virDomainAddIOThread()
  virDomainDelIOThread()
  virDomainSetIOThreadParams()

In case of QEMU driver these are handled by
qemuDomainChgIOThread() which attempts to be versatile enough to
work on both inactive and live domain definitions at the same
time. However, it's a bit clumsy - when a change to live
definition succeeds but fails in inactive definition then there's
no rollback. And somewhat rightfully so - changes to live
definition are in general harder to roll back. Therefore, do what
we do elsewhere (qemuDomainAttachDeviceLiveAndConfig(),
qemuDomainDetachDeviceAliasLiveAndConfig(), ...):

  1) do the change to inactive XML first,
  2) in fact, do the change to a copy of inactive XML,
  3) swap inactive XML and its copy only after everything
     succeeded.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c