Re: [PATCH 14/33] qemu: Add missing error handling

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

 



On Wed, Jan 24, 2024 at 20:37:34 +0100, Andrea Bolognani wrote:
> qemuDomainGetSCSIControllerModel() can return -1 on failure,
> but qemuDomainFindOrCreateSCSIDiskController() didn't implement
> any handling for this scenario.
> 
> Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
> ---
>  src/qemu/qemu_hotplug.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index 0e45bd53e1..afb720fc0b 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -881,6 +881,11 @@ qemuDomainFindOrCreateSCSIDiskController(virDomainObj *vm,
>      else
>          cont->model = model;
>  
> +    if (cont->model < 0) {
> +        VIR_FREE(cont);
> +        return NULL;
> +    }
> +
>      VIR_INFO("No SCSI controller present, hotplugging one model=%s",
>               virDomainControllerModelSCSITypeToString(cont->model));

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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