From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtBJk-00089F-5b for qemu-devel@nongnu.org; Fri, 15 May 2015 04:50:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtBJg-0006S5-LH for qemu-devel@nongnu.org; Fri, 15 May 2015 04:50:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtBJg-0006S1-Cq for qemu-devel@nongnu.org; Fri, 15 May 2015 04:50:00 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4F8nxxa013495 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 15 May 2015 04:49:59 -0400 From: Markus Armbruster References: <1431432187-10993-1-git-send-email-armbru@redhat.com> <1431432187-10993-16-git-send-email-armbru@redhat.com> <55552089.5040204@redhat.com> Date: Fri, 15 May 2015 10:49:57 +0200 In-Reply-To: <55552089.5040204@redhat.com> (Eric Blake's message of "Thu, 14 May 2015 16:24:09 -0600") Message-ID: <87twvemdhm.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 15/15] tap: Improve -netdev/netdev_add/-net/... tap error reporting 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: >> When -netdev tap fails, it first reports a specific error, then a >> generic one, like this: >> >> $ qemu-system-x86_64 -netdev tap,id=foo >> qemu-system-x86_64: -netdev tap,id=foo: could not configure >> /dev/net/tun: Operation not permitted >> qemu-system-x86_64: -netdev tap,id=foo: Device 'tap' could not >> be initialized >> >> With the command line, the messages go to stderr. In HMP, they go to >> the monitor. In QMP, the second one becomes the error reply, and the >> first one goes to stderr. >> >> Convert net_init_tap() to Error. This suppresses the unwanted second >> message, and and makes the specific error the QMP error reply. > > s/and and/and/ Fixing... >> Signed-off-by: Markus Armbruster >> --- >> net/tap.c | 45 ++++++++++++++++++++++----------------------- >> 1 file changed, 22 insertions(+), 23 deletions(-) >> > > >> @@ -807,15 +807,15 @@ int net_init_tap(const NetClientOptions *opts, const char *name, >> tap->has_vhostfds ? vhost_fds[i] : NULL, >> vnet_hdr, fd, &err); >> if (err) { >> - error_report_err(err); >> + error_propagate(errp, err); >> return -1; >> } >> } >> } else if (tap->has_helper) { >> if (tap->has_ifname || tap->has_script || tap->has_downscript || >> tap->has_vnet_hdr || tap->has_queues || tap->has_vhostfds) { >> - error_report("ifname=, script=, downscript=, and vnet_hdr= " >> - "queues=, and vhostfds= are invalid with helper="); >> + error_setg(errp, "ifname=, script=, downscript=, and vnet_hdr= " >> + "queues=, and vhostfds= are invalid with helper="); > > As long as you are touching this, s/and vnet_hdr=/vnet_hdr=,/ Yes. > Minor enough that I'm okay with fixing it, and adding: > Reviewed-by: Eric Blake Thanks!