[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

Ian Jackson wrote:
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index d2c013c..68d076c 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
+_hidden int libxl__ao_device_check_last(libxl__gc *gc, libxl__ao_device 
+                                        libxl__ao_device *list, int num,
+                                        int *last);

This is a good helper but it could do with a doc comment explaining
what it does.

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.

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.

Xen-devel mailing list



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