[libvirt] [PATCH 06/13] Convert all files in src/rpc/ to use virReportError()
Eric Blake
eblake at redhat.com
Wed Jul 18 14:20:12 UTC 2012
On 07/18/2012 05:52 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> 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 at redhat.com>
> ---
> +++ 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 at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120718/824d6dc4/attachment-0001.sig>
More information about the libvir-list
mailing list