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

Re: [Xen-devel] [PATCH 4/4 v2] tools/xc: pass errno to callers of xc_domain_save



Olaf Hering writes ("[PATCH 4/4 v2] tools/xc: pass errno to callers of 
xc_domain_save"):
> @@ -914,13 +915,13 @@ int xc_domain_save(xc_interface *xch, int io_fd, 
> uint32_t dom, uint32_t max_iter
>                              &ctx->max_mfn, &ctx->hvirt_start, 
> &ctx->pt_levels, &dinfo->guest_width) )
>      {
>          ERROR("Unable to get platform info.");
> -        return 1;
> +        goto exit;

This all looks pretty good, thanks.

Can I suggest that these cases could probably benefit from
    assert(errno)
?

That way there is no risk of thinking we have succeeded because some
subfunction with poor error handling has failed but not set errno.

One option for doing centrally would be:

>      /* Success! */
- -    rc = 0;
- +    errno = 0;
  +    goto out_rc;


>   out:
> +    rc = errno;
  +    assert(rc);
  + out_rc:
>      completed = 1;

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.