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

Osier Yang jyang at redhat.com
Mon Aug 22 14:50:17 UTC 2011


于 2011年08月22日 21:54, Eric Blake 写道:
> On 08/22/2011 08:12 AM, Osier Yang wrote:
>> * src/qemu/qemu_monitor_text.c: Error like "this function is not
>> supported by the connection driver" is confused obviously.
>> ---
>> src/qemu/qemu_monitor_text.c | 6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> ACK.
>
> You are correct that VIR_ERR_NO_SUPPORT should only be used in 
> libvirt.c, and not in any of the drivers.
>

# grep VIR_ERR_NO_SUPPORT * -r --exclude="libvirt.c" | grep -v '^Binary' 
| wc -l
115

Agree, seems we need to do a big cleanup.

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__);
return -1;
}

Osier




More information about the libvir-list mailing list