On 24.02.2026 10:28, Teddy Astie wrote: > Le 23/02/2026 à 17:15, Jan Beulich a écrit : >> On 23.02.2026 17:06, Teddy Astie wrote: >>> xc_report_op returns -1 in some error conditions. >>> Make sure it returns -ENOMEM in out of memory errors and -EINVAL >>> in invalid usages errors. >> >> Isn't this a move in the wrong direction? -1 as a return value is quite okay. >> errno wants setting to indicate the cause of the error (if called functions >> don't already set it properly). > > To me, passing error through errno here feels more like a workaround > rather than a proper error handling. It doesn't feel consistent in libxc > overall (some functions returns a negative value corresponding to a > error number while some others -1; in some cases we update errno). > > What are the error handling rules for xenctrl ?
Question goes mainly to Anthony. My take is that library functions should behave properly, and where that isn't the case it wants adjusting. Jan
