Re: [PATCH 1/2] qemu: Report error on unexpected job stats type

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

 



On Fri, Jun 01, 2018 at 10:46:02 +0200, Jiri Denemark wrote:
> If we ever fail to properly set jobinfo->statsType,
> qemuDomainJobInfoToParams would return -1 without setting an error.
> 
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/qemu/qemu_domain.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 2c51e4c0d8..360379b26c 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -717,10 +717,12 @@ qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo,
>          return qemuDomainDumpJobInfoToParams(jobInfo, type, params, nparams);
>  
>      case QEMU_DOMAIN_JOB_STATS_TYPE_NONE:
> -        break;
> +    default:
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("unexpected type of job stats: %d"),
> +                       jobInfo->statsType);

virReportEnumRangeError?

> +        return -1;

ACK, ... 


>      }
> -
> -    return -1;

.. but only push it during the freeze with the above part dropped. I'm
not going to second-guess which compiler decides that the function will
be missing a return statement.


>  }
>  
>  
> -- 
> 2.17.1
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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