[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 07/15] libxl: convert libxl_domain_destroy to an async op
Roger Pau Monne writes ("Re: [PATCH v2 07/15] libxl: convert libxl_domain_destroy to an async op"): > Ian Jackson wrote: > > Just a suggestion: rather than this business with *last it might be > > easier to assign a magic error code, or use +1, for "not all done > > yet". (+1 would work since all actual libxl error codes are -ve). > > By my reading of the current interface the return value is not > > meaningful if *last==0 on output, which is the opposite of the usual > > way round. > > This function currently returns two different things, the return value > returns the rc code of any operation that has failed, and the parameter > last marks if all device events are finished. Without the last > parameter, we won't be able to return the failed error code if all > devices had finished, since we had to return 0, so the error code would > be lost. I was suggesting that it should return: rc==0 if all devices completed successfully rc==ERROR_SOMETHING if all devices completed with at least one error rc==+1 if something is still going Or if you prefer rc==ERROR_OPERATION_NOT_YET_COMPLETE if something is still going > Since I think this is not really clear, I will split this function into > two different ones, one that checks if all devices are finished, and > another one that checks if some devices have reported errors. Please don't do that - you'll have to turn it into two loops and it'll be a lot more fiddly. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |