Re: [PATCH 06/13] Convert all files in src/rpc/ to use virReportError()

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

 



On 07/18/2012 05:52 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> This rmoves all the per-file error reporting macros

s/rmoves/removes/

> from the code in src/rpc/
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---

> +++ b/src/rpc/virnetserver.c
> @@ -261,7 +258,7 @@ static int virNetServerDispatchNewClient(virNetServerServicePtr svc ATTRIBUTE_UN
>      virNetServerLock(srv);
>  
>      if (srv->nclients >= srv->nclients_max) {
> -        virNetError(VIR_ERR_RPC,
> +        virReportError(VIR_ERR_RPC,
>                      _("Too many active clients (%zu), dropping connection from %s"),
>                      srv->nclients_max, virNetServerClientRemoteAddrString(client));

Did you intentionally skip re-indenting this file?  4 of the 5 hunks you
touched end up with odd indents.

> +++ b/src/rpc/virnetserverclient.c
> @@ -775,7 +772,7 @@ static ssize_t virNetServerClientRead(virNetServerClientPtr client)
>      ssize_t ret;
>  
>      if (client->rx->bufferLength <= client->rx->bufferOffset) {
> -        virNetError(VIR_ERR_RPC,
> +        virReportError(VIR_ERR_RPC,
>                      _("unexpected zero/negative length request %lld"),
>                      (long long int)(client->rx->bufferLength - client->rx->bufferOffset));

And another missed reindent, 1 out of 2 hunks in this file.

> +++ b/src/rpc/virnetservermdns.c
> @@ -367,8 +364,8 @@ static AvahiTimeout *virNetServerMDNSTimeoutNew(const AvahiPoll *api ATTRIBUTE_U
>      t->userdata = userdata;
>  
>      if (t->timer < 0) {
> -        virNetError(VIR_ERR_INTERNAL_ERROR,
> -                    _("Failed to add timer with timeout %d"), (int)timeout);
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("Failed to add timer with timeout %d"), (int)timeout);

Why are we casting to int, instead of pairing this with %lld in the
first place?

ACK.  Again, nits can be squashed here, or done as a separate patch.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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