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

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

 



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 :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]