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 ?

> Also nit: s/xc_report_op/xc_resource_op/ .
>

ack

> Jan
>

Teddy


--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



Reply via email to