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

Re: [Xen-devel] [PATCH v3 5/6] xl: Return error codes for pci* commands



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.dunlap@xxxxxxxxxxxxx>
> ---
> CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
> CC: Ian Jackson <ian.jackson@xxxxxxxxxx>
> CC: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> Â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@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®.