Re: [PATCH v3 4/4] util: Report error in virFileWrapperFdClose()

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

 



On Tue, 2019-02-19 at 16:58 +0000, Daniel P. Berrangé wrote:
> On Tue, Feb 19, 2019 at 05:52:31PM +0100, Andrea Bolognani wrote:
[...]
> > @@ -337,8 +337,12 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd)
> >  
> >      ret = virCommandWait(wfd->cmd, NULL);
> >  
> > +    /* If the command used to process IO has produced errors, it's fair
> > +     * to assume those will be more relevant to the user than whatever
> > +     * eg. QEMU can figure out on its own, so it's okay if we end up
> > +     * discarding an existing error */
> >      if (wfd->err_msg && *wfd->err_msg)
> > -        VIR_WARN("iohelper reports: %s", wfd->err_msg);
> > +        virReportError(VIR_ERR_OPERATION_FAILED, "%s", wfd->err_msg);
> 
> ret needs to be set to -1 in this case

I expect that a command who produced output on stderr also exited
with a non-zero return code, but explicitly erroring out if the
former condition is detected can't possibly hurt I guess.

-- 
Andrea Bolognani / Red Hat / Virtualization


[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