Re: [PATCH v2 2/2] qemu_alias: change return type to void if possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/24/21 17:12, Kristina Hanicova wrote:
> These functions always return success so it seems logical to not
> return anything and remove unnecessary checks.
> 
> Signed-off-by: Kristina Hanicova <khanicov@xxxxxxxxxx>
> ---
>  src/qemu/qemu_alias.c   | 78 +++++++++++++++++------------------------
>  src/qemu/qemu_alias.h   | 34 +++++++++---------
>  src/qemu/qemu_hotplug.c | 34 +++++++-----------
>  3 files changed, 61 insertions(+), 85 deletions(-)


Ooops, not rebased onto current master :-) But the conflict resolution
was trivial.

I think I see some more functions that can't fail really (can be fixed
in a follow up), for instance: qemuAssignDeviceChrAlias() can fail if
and only if qemuGetNextChrDevIndex() fails, but that can never happen.
This leaves us with qemuAssignDeviceDiskAlias() and
qemuAssignDeviceMemoryAlias(). In the latter, the error is returned only
in enum overflow (which I believe is a dead code). In the former -1 is
returned if qemuDomainFindSCSIControllerModel() fails, but controllers
should have been autofilled at this point.

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux