qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 13/15] tap-solaris: Convert tap_open() to Error
Date: Thu, 14 May 2015 16:00:57 -0600	[thread overview]
Message-ID: <55551B19.5020402@redhat.com> (raw)
In-Reply-To: <1431432187-10993-14-git-send-email-armbru@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1863 bytes --]

On 05/12/2015 06:03 AM, Markus Armbruster wrote:
> Fixes inappropriate use of syslog().
> 
> Not fixed: leaks on error paths, suspicious non-fatal errors.  FIXMEs
> added instead.

At least you're admitting where the code is still bad.

> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  net/tap-solaris.c | 59 ++++++++++++++++++++++++++++---------------------------
>  1 file changed, 30 insertions(+), 29 deletions(-)
> 

> @@ -99,20 +100,20 @@ static int tap_alloc(char *dev, size_t dev_size)
>      strioc_ppa.ic_len = sizeof(ppa);
>      strioc_ppa.ic_dp = (char *)&ppa;
>      if ((ppa = ioctl (tap_fd, I_STR, &strioc_ppa)) < 0)
> -       syslog (LOG_ERR, "Can't assign new interface");
> +        error_report("Can't assign new interface");

I see you're fixing spacing while at it, as well.

>  
>      TFR(if_fd = open("/dev/tap", O_RDWR, 0));
>      if (if_fd < 0) {
> -       syslog(LOG_ERR, "Can't open /dev/tap (2)");
> -       return -1;
> +        error_setg(errp, "Can't open /dev/tap (2)");
> +        return -1;
>      }
>      if(ioctl(if_fd, I_PUSH, "ip") < 0){
> -       syslog(LOG_ERR, "Can't push IP module");

Should you add the space after 'if' while touching this?

> -       return -1;
> +        error_setg(errp, "Can't push IP module");
> +        return -1;
>      }
>  
>      if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
> -	syslog(LOG_ERR, "Can't get flags\n");
> +        error_report("Can't get flags");

What about adding missing {} while touching this file?  Hmm - there's
enough cruft that it may involve a separate patch just to clean up
style. For this patch, I'm not going to hold up review on style.

Reviewed-by: Eric Blake <eblake@redhat.com>

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-05-14 22:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 12:02 [Qemu-devel] [PATCH 00/15] net: Improve error reporting Markus Armbruster
2015-05-12 12:02 ` [Qemu-devel] [PATCH 01/15] net: Improve error message for -net hubport a bit Markus Armbruster
2015-05-14 15:13   ` Eric Blake
2015-05-12 12:02 ` [Qemu-devel] [PATCH 02/15] net: Permit incremental conversion of init functions to Error Markus Armbruster
2015-05-14 15:45   ` Eric Blake
2015-05-12 12:02 ` [Qemu-devel] [PATCH 03/15] net: Improve -net nic error reporting Markus Armbruster
2015-05-14 16:07   ` Eric Blake
2015-05-15  8:38     ` Markus Armbruster
2015-05-12 12:02 ` [Qemu-devel] [PATCH 04/15] net/dump: Improve -net/host_net_add dump " Markus Armbruster
2015-05-14 16:37   ` Eric Blake
2015-05-12 12:02 ` [Qemu-devel] [PATCH 05/15] tap: net_tap_fd_init() can't fail, drop dead error handling Markus Armbruster
2015-05-14 16:48   ` Eric Blake
2015-05-15  8:42     ` Markus Armbruster
2015-05-12 12:02 ` [Qemu-devel] [PATCH 06/15] tap: Improve -netdev/netdev_add/-net/... bridge error reporting Markus Armbruster
2015-05-14 16:56   ` Eric Blake
2015-05-12 12:02 ` [Qemu-devel] [PATCH 07/15] tap: Convert tap_set_sndbuf() to Error Markus Armbruster
2015-05-14 17:02   ` Eric Blake
2015-05-12 12:03 ` [Qemu-devel] [PATCH 08/15] tap: Convert net_init_tap_one() " Markus Armbruster
2015-05-14 17:04   ` Eric Blake
2015-05-12 12:03 ` [Qemu-devel] [PATCH 09/15] tap: Convert launch_script() " Markus Armbruster
2015-05-14 20:21   ` Eric Blake
2015-05-12 12:03 ` [Qemu-devel] [PATCH 10/15] tap: Permit incremental conversion of tap_open() " Markus Armbruster
2015-05-14 21:49   ` Eric Blake
2015-05-12 12:03 ` [Qemu-devel] [PATCH 11/15] tap-linux: Convert " Markus Armbruster
2015-05-14 21:52   ` Eric Blake
2015-05-12 12:03 ` [Qemu-devel] [PATCH 12/15] tap-bsd: " Markus Armbruster
2015-05-14 21:55   ` Eric Blake
2015-05-15  8:44     ` Markus Armbruster
2015-05-12 12:03 ` [Qemu-devel] [PATCH 13/15] tap-solaris: " Markus Armbruster
2015-05-14 22:00   ` Eric Blake [this message]
2015-05-15  8:48     ` Markus Armbruster
2015-05-12 12:03 ` [Qemu-devel] [PATCH 14/15] tap: Finish conversion of " Markus Armbruster
2015-05-14 22:01   ` Eric Blake
2015-05-12 12:03 ` [Qemu-devel] [PATCH 15/15] tap: Improve -netdev/netdev_add/-net/... tap error reporting Markus Armbruster
2015-05-14 22:24   ` Eric Blake
2015-05-15  8:49     ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55551B19.5020402@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).