[libvirt] [PATCH 4/4] qemu: fix a error coverd issue in 2 place

Ján Tomko jtomko at redhat.com
Wed Feb 25 14:51:10 UTC 2015


On Tue, Feb 24, 2015 at 01:52:08PM -0500, John Ferlan wrote:
> 
> 
> On 02/13/2015 02:17 AM, Luyao Huang wrote:
> > we already set a more clearly error in networkGetNetworkAddress,
> > so this error will cover our error in networkGetNetworkAddress.
> > 
> > Signed-off-by: Luyao Huang <lhuang at redhat.com>
> > ---
> >  src/qemu/qemu_command.c | 14 ++++----------
> >  1 file changed, 4 insertions(+), 10 deletions(-)
> > 
> 
> I didn't check every exit patch from networkGetNetworkAddress, but
> perhaps these should change to :
> 
>     if (ret < 0) {
>         if (virGetLastError() == NULL)
>             virReportError(VIR_ERR_XML_ERROR,...);
>         goto error;
>     }
> 
> Just to be sure we don't leave without setting some sort of error.

No.

All the exit paths should be checked to make sure an error was reported
in all cases where we return -1.

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150225/52bf860e/attachment-0001.sig>


More information about the libvir-list mailing list