]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_hotplug: Don't lose 'created' flag in qemuDomainChangeNet()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 24 Jan 2024 17:43:21 +0000 (18:43 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Jan 2024 15:41:12 +0000 (16:41 +0100)
commitccfc5c1e1637d20e479fafde7aa3ea4c6fb29e21
tree0e8147502ef37893c9cedf983d6ddc35a60d8efb
parentb49fb573958dd921b40c4e97f168cbb04bc7ff9b
qemu_hotplug: Don't lose 'created' flag in qemuDomainChangeNet()

After v9.1.0-rc1~116 we track whether it's us who created a
macvtap or not. But when updating a vNIC its definition might be
replaced with a new one (though, ifname is not allowed to
change), e.g. to reflect new QoS, link state, etc.

Now, the fact whether we created macvtap for given vNIC is stored
in net->privateData->created. And replacing definition is done by
simply freeing the old definition and making the pointer point to
the new one. But this does not preserve the 'created' flag, which
in turn means when a domain is shutting off, the macvtap is not
removed (see loop inside of qemuProcessStop()).

Copy this flag into new definition and leave a note in
_qemuDomainNetworkPrivate struct.

Fixes: 61d1b9e6592660121aeda66bf7adbcd39de06aa8
Resolves: https://issues.redhat.com/browse/RHEL-22714
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.h
src/qemu/qemu_hotplug.c