[libvirt] [PATCH 5/8] remote: Cleanup improper VIR_ERR_NO_SUPPORT use

Daniel P. Berrange berrange at redhat.com
Wed Aug 24 21:44:33 UTC 2011


On Tue, Aug 23, 2011 at 05:39:42PM +0800, Osier Yang wrote:
> ---
>  src/remote/remote_driver.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
> index e5bfa4b..28f333b 100644
> --- a/src/remote/remote_driver.c
> +++ b/src/remote/remote_driver.c
> @@ -2928,7 +2928,7 @@ static int remoteDomainEventRegister(virConnectPtr conn,
>      remoteDriverLock(priv);
>  
>      if (priv->domainEventState->timer < 0) {
> -         remoteError(VIR_ERR_NO_SUPPORT, "%s", _("no event support"));
> +         remoteError(VIR_ERR_OPERATION_INVALID, "%s", _("no event support"));
>           goto done;
>      }
>  

IMHO the original error code was correct here. While the driver method
exists, we're not able to use it since not event loop is available.

> @@ -3277,7 +3277,7 @@ remoteSecretGetValue (virSecretPtr secret, size_t *value_size,
>  
>      /* internalFlags intentionally do not go over the wire */
>      if (internalFlags) {
> -        remoteError(VIR_ERR_NO_SUPPORT, "%s", _("no internalFlags support"));
> +        remoteError(VIR_ERR_OPERATION_INVALID, "%s", _("no internalFlags support"));
>          goto done;
>      }
>  

This feels like it should be an INTERNAL_ERROR, since internalFlags are
not something the app can specify.

> @@ -3541,7 +3541,7 @@ static int remoteDomainEventRegisterAny(virConnectPtr conn,
>      remoteDriverLock(priv);
>  
>      if (priv->domainEventState->timer < 0) {
> -         remoteError(VIR_ERR_NO_SUPPORT, "%s", _("no event support"));
> +         remoteError(VIR_ERR_OPERATION_INVALID, "%s", _("no event support"));
>           goto done;
>      }

Again I think the original code was correct here

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list