]> xenbits.xensource.com Git - libvirt.git/commit
qemuDomainChangeNet: check virtio options for non-virtio models
authorMiroslav Los via Devel <devel@lists.libvirt.org>
Thu, 4 Jul 2024 15:44:54 +0000 (15:44 +0000)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 9 Jul 2024 11:20:05 +0000 (13:20 +0200)
commit8515a178f8499e3420b430086844f7d1613e4a69
treef18a270dbdc592dc44b6ca37ee025119e71dca58
parent9fade1d6fb66673daecd4349ad651351993b5210
qemuDomainChangeNet: check virtio options for non-virtio models

In a domain created with an interface with a <driver> subelement,
the device contains a non-NULL virDomainVirtioOptions struct, even
for non-virtio NIC models. The subelement need not be present again
after libvirt restarts, or when the interface is passed to clients.

When clients such as virsh domif-setlink put back the modified
interface XML, the new device's virtio attribute is NULL. This may
fail the equality checks for virtio options in qemuDomainChangeNet,
depending on whether libvird was restarted since define or not.

This patch modifies the check for non-virtio models, to ignore olddev
value of virtio (assumed valid), and to allow either NULL or a struct
with all values ABSENT in the new virtio options.

Signed-off-by: Miroslav Los <mirlos@cisco.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_hotplug.c