
On 7/4/24 17:44, Miroslav Los via Devel wrote:
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> --- src/qemu/qemu_hotplug.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> and merged. Congratulations on your first libvirt contribution! Michal