]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Clean up qemuDomainDefaultUSBControllerModel()
authorAndrea Bolognani <abologna@redhat.com>
Mon, 12 Feb 2024 19:05:42 +0000 (20:05 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Oct 2025 09:16:18 +0000 (11:16 +0200)
commit8bb0f4275a58a74e661039bdf2ae5b01fd41e82a
tree7ec9925a241311f1bfb4cf46373ba26a96495727
parent44a63c2188e2fbdea32955994be2427fbebd0ebf
qemu: Clean up qemuDomainDefaultUSBControllerModel()

Switch from the current approach, in which an initial and
likely poor default is picked and then a better one later
overwrites it, to the more common and easy to reason about
pattern where the value is returned directly as soon as
possible.

To make things easier to understand and more maintainable,
the various architectures for which we have explicit
handling are each taken care of separately, with no falling
through to the default behavior.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c