Received: from eggs.gnu.org ([2001:4830:134:3::10]:39232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymzv1-0001fY-Jm for qemu-devel@nongnu.org; Tue, 28 Apr 2015 03:27:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymzuy-0001qQ-BX for qemu-devel@nongnu.org; Tue, 28 Apr 2015 03:26:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymzuy-0001q6-1N for qemu-devel@nongnu.org; Tue, 28 Apr 2015 03:26:56 -0400 Date: Tue, 28 Apr 2015 09:26:47 +0200 From: Thomas Huth Message-ID: <20150428092647.33360532@thh440s> In-Reply-To: References: <1430157117-26104-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pci: Clean up error reporting in pci_nic_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Markus Armbruster , "qemu-devel@nongnu.org Developers" , "Michael S. Tsirkin" On Mon, 27 Apr 2015 10:55:41 -0700 Peter Crosthwaite wrote: > On Mon, Apr 27, 2015 at 10:51 AM, Thomas Huth wrote: > > The error reporting in pci_nic_init() is quite erratic: Some errors > > are printed directly with error_report(), and some are passed back > > to the (only) caller pci_nic_init_nofail() via an Error pointer. > > Let's fix up this inconsistency by always printing the error in > > pci_nic_init() and by getting rid of the Error pointer this way. > > > > Can it be made consistent the other way? - always propagate? Usually > we move towards consistent error propagation rather that > deep-call-chain error reports. In that case, I'd need to rework qemu_find_nic_model() in net/net.c, too, since this is also printing errors directly. ... I could certainly do that, too, but I slowly start wondering whether this all is worth the effort, just to make the code for the _legacy_ "-net" option a little bit nicer. Maybe we should rather focus on thinking about ways to finally get rid of "-net" one day? Another idea: What about merging pci_nic_init() into pci_nic_init_no_fail()? pci_nic_init() is only used by the _no_fail() function, so there seems very few benefit by having this code in a separate function. If they got merged, the error printing inconsistency would be solved, too. Thomas