1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-13 08:58:33 +03:00

lxc: Cleanup improper VIR_ERR_NO_SUPPORT use

s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/

Special case is changes on lxcDomainInterfaceStats, if it's not
implemented on the platform, prints error like:

    lxcError(VIR_ERR_OPERATION_INVALID, "%s",
             _("interface stats not implemented on this platform"));

As the function is supported by driver actually, error like
VIR_ERR_NO_SUPPORT is confused.
This commit is contained in:
Osier Yang 2011-08-23 16:17:10 +08:00
parent 49218c59b2
commit 6ac47762bb

View File

@ -421,7 +421,7 @@ static virDomainPtr lxcDomainDefine(virConnectPtr conn, const char *xml)
goto cleanup;
if ((def->nets != NULL) && !(driver->have_netns)) {
lxcError(VIR_ERR_NO_SUPPORT,
lxcError(VIR_ERR_OPERATION_INVALID,
"%s", _("System lacks NETNS support"));
goto cleanup;
}
@ -728,7 +728,7 @@ static int lxcDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
}
if (driver->cgroup == NULL) {
lxcError(VIR_ERR_NO_SUPPORT,
lxcError(VIR_ERR_OPERATION_INVALID,
"%s", _("cgroups must be configured on the host"));
goto cleanup;
}
@ -1710,7 +1710,7 @@ static int lxcDomainStartWithFlags(virDomainPtr dom, unsigned int flags)
}
if ((vm->def->nets != NULL) && !(driver->have_netns)) {
lxcError(VIR_ERR_NO_SUPPORT,
lxcError(VIR_ERR_OPERATION_INVALID,
"%s", _("System lacks NETNS support"));
goto cleanup;
}
@ -1786,7 +1786,7 @@ lxcDomainCreateAndStart(virConnectPtr conn,
goto cleanup;
if ((def->nets != NULL) && !(driver->have_netns)) {
lxcError(VIR_ERR_NO_SUPPORT,
lxcError(VIR_ERR_OPERATION_INVALID,
"%s", _("System lacks NETNS support"));
goto cleanup;
}
@ -2519,7 +2519,8 @@ static int
lxcDomainInterfaceStats(virDomainPtr dom,
const char *path ATTRIBUTE_UNUSED,
struct _virDomainInterfaceStats *stats ATTRIBUTE_UNUSED)
lxcError(VIR_ERR_NO_SUPPORT, "%s", __FUNCTION__);
lxcError(VIR_ERR_OPERATION_INVALID, "%s",
_("interface stats not implemented on this platform"));
return -1;
}
#endif