]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Improve qemuDomainDefaultSCSIControllerModel()
authorAndrea Bolognani <abologna@redhat.com>
Fri, 9 Feb 2024 17:47:34 +0000 (18:47 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 8 Jul 2025 09:05:06 +0000 (11:05 +0200)
commit9bbb8944f5950168f1d2fd12f980a414305bcd71
treefa50ef505cdad31898be8008e478d8c8ccfdb956
parent1fb968eaf1a84c232488d0c6134671da0f9624ad
qemu: Improve qemuDomainDefaultSCSIControllerModel()

Make the helper stateless. This requires the caller to check
whether it needs to be called in the first place instead of
adding this check inside the function, which makes for more
readable, if a little more verbose, code.

We also update callers to check the return value against
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT instead of a
functionally equivalent, but semantically less meaningful,
check for whether the return value is negative.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_hotplug.c
src/qemu/qemu_postparse.c