On Tue, 2015-12-01 at 11:53 +0000, George Dunlap wrote:
> Add return codes for pci-detach, pci-attach, pci-asssignable-add, and
> pci-assignable-remove.
> 
> Returning error codes makes it easier for shell scripts to tell if a
> command has failed or succeeded.
> 
> Signed-off-by: George Dunlap <george.dun...@eu.citrix.com>
> ---
> CC: Ian Campbell <ian.campb...@citrix.com>
> CC: Ian Jackson <ian.jack...@citrix.com>
> CC: Wei Liu <wei.l...@citrix.com>
> ---
>  tools/libxl/xl_cmdimpl.c | 56 ++++++++++++++++++++++++++++++++--------
> --------
>  1 file changed, 37 insertions(+), 19 deletions(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 72ece2e..5f21c37 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -3495,10 +3495,11 @@ int main_pcilist(int argc, char **argv)
>      return 0;
>  }
>  
> -static void pcidetach(uint32_t domid, const char *bdf, int force)
> +static int pcidetach(uint32_t domid, const char *bdf, int force)
>  {
>      libxl_device_pci pcidev;
>      XLU_Config *config;
> +    int rc = 0;

I think we should probably avoid "rc" for non-libxl error codes even in xl.

Also, I'd forgotten that since 00e110e44a0eb we are trying to have xl
main_* functions return either EXIT_SUCCESS or EXIT_FAILURE rather than 0,
1, -foo etc. That probably applies to many of the  earlier patches which
I've already commented on. I shan't go back and correct myself.

Ian.



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

Reply via email to