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

Re: [libvirt] [PATCH] qemu: Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_OPERATION_INVALID

On 08/22/2011 08:50 AM, Osier Yang wrote:
But seems it's fine for funcs like below to use that?

int virSecurityManagerSetAllLabel(virSecurityManagerPtr mgr,
virDomainObjPtr vm,
const char *stdin_path)
if (mgr->drv->domainSetSecurityAllLabel)
return mgr->drv->domainSetSecurityAllLabel(mgr, vm, stdin_path);

virSecurityReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);

Uses like this are fine. That is, VIR_ERR_NO_SUPPORT is for use by managers (libvirt.c is a manager, but so is virSecurityManagerSetAllLabel) to report that a function callback is not supported by a driver. Where it is not okay is within a driver (either the driver implemented the callback, so there is no error to report, or the driver does not implement the callback, so the manager already reported the error).

Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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