[libvirt] [PATCH 11/13] Replace use of virNWFilterReportError with virReportError
Eric Blake
eblake at redhat.com
Wed Jul 18 19:40:47 UTC 2012
On 07/18/2012 05:52 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> Update the network filter driver to use virReportError instead
> of the virNWFilterReportError custom macro
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
> +++ b/src/nwfilter/nwfilter_dhcpsnoop.c
> @@ -1097,35 +1093,35 @@ virNWFilterSnoopDHCPOpen(const char *ifname, virMacAddr *mac,
> handle = pcap_create(ifname, pcap_errbuf);
>
> if (handle == NULL) {
> - virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
> - _("pcap_create failed"));
> + virReportError(VIR_ERR_INTERNAL_ERROR,
> + _("pcap_create failed"));
Missing a %s.
> goto cleanup_nohandle;
> }
>
> if (pcap_set_snaplen(handle, PCAP_PBUFSIZE) < 0 ||
> pcap_set_buffer_size(handle, PCAP_BUFFERSIZE) < 0 ||
> pcap_activate(handle) < 0) {
> - virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
> - _("setup of pcap handle failed"));
> + virReportError(VIR_ERR_INTERNAL_ERROR,
> + _("setup of pcap handle failed"));
and again.
> +++ b/src/nwfilter/nwfilter_ebiptables_driver.c
> @@ -2683,8 +2680,8 @@ ebiptablesCreateRuleInstance(enum virDomainNetType nettype ATTRIBUTE_UNUSED,
> break;
>
> case VIR_NWFILTER_RULE_PROTOCOL_LAST:
> - virNWFilterReportError(VIR_ERR_OPERATION_FAILED,
> - "%s", _("illegal protocol type"));
> + virReportError(VIR_ERR_OPERATION_FAILED,
> + "%s", _("illegal protocol type"));
I hate the word 'illegal' in error messages - the user didn't break a
law, they just violated constraints. 'invalid' is nicer. But that's a
separate cleanup.
> +++ b/src/nwfilter/nwfilter_learnipaddr.c
> @@ -151,17 +148,17 @@ virNWFilterLockIface(const char *ifname) {
> if (virStrcpyStatic(ifaceLock->ifname, ifname) == NULL) {
> - virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
> - _("interface name %s does not fit into "
> - "buffer "),
> - ifaceLock->ifname);
> + virReportError(VIR_ERR_INTERNAL_ERROR,
> + _("interface name %s does not fit into "
> + "buffer "),
This might fit in 80 columns without the split format string now. But
rewrapping format strings is not necessary for this series.
ACK.
--
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/e4b6655b/attachment-0001.sig>
More information about the libvir-list
mailing list