From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtBIV-0006XQ-7X for qemu-devel@nongnu.org; Fri, 15 May 2015 04:48:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtBIR-00067l-R9 for qemu-devel@nongnu.org; Fri, 15 May 2015 04:48:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtBIR-00067X-IK for qemu-devel@nongnu.org; Fri, 15 May 2015 04:48:43 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4F8mgw5009886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 15 May 2015 04:48:42 -0400 From: Markus Armbruster References: <1431432187-10993-1-git-send-email-armbru@redhat.com> <1431432187-10993-14-git-send-email-armbru@redhat.com> <55551B19.5020402@redhat.com> Date: Fri, 15 May 2015 10:48:38 +0200 In-Reply-To: <55551B19.5020402@redhat.com> (Eric Blake's message of "Thu, 14 May 2015 16:00:57 -0600") Message-ID: <87y4kqmdjt.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 13/15] tap-solaris: Convert tap_open() to Error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, stefanha@redhat.com Eric Blake writes: > 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. Actually, git-rm felt pretty tempting. >> Signed-off-by: Markus Armbruster >> --- >> 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? Fixing up just enough to make checkpatch happy. Also keeps git-blame useful even without -w. >> - 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 Thanks!