Received: from eggs.gnu.org ([2001:4830:134:3::10]:37340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymkog-0002kc-70 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 11:19:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymkoc-00035S-Va for qemu-devel@nongnu.org; Mon, 27 Apr 2015 11:19:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymkoc-000350-QZ for qemu-devel@nongnu.org; Mon, 27 Apr 2015 11:19:22 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id BCB008E3F1 for ; Mon, 27 Apr 2015 15:19:21 +0000 (UTC) Date: Mon, 27 Apr 2015 17:19:12 +0200 From: Thomas Huth Message-ID: <20150427171912.681b313c@thh440s> In-Reply-To: <87wq0x3i7o.fsf@blackfin.pond.sub.org> References: <1428586365-17909-1-git-send-email-thuth@redhat.com> <5526C58F.2050805@redhat.com> <5526D99D.7010103@redhat.com> <87wq0x3i7o.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix crash with illegal "-net nic, model=xxx" option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Paolo Bonzini , jasowang@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com On Mon, 27 Apr 2015 13:48:27 +0200 Markus Armbruster wrote: > Paolo Bonzini writes: > > > On 09/04/2015 20:31, Eric Blake wrote: > >>> diff --git a/hw/pci/pci.c b/hw/pci/pci.c > >>> index 6941a82..b3d5100 100644 > >>> --- a/hw/pci/pci.c > >>> +++ b/hw/pci/pci.c > >>> @@ -1660,7 +1660,9 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, > >>> > >>> res = pci_nic_init(nd, rootbus, default_model, default_devaddr, &err); > >>> if (!res) { > >>> - error_report_err(err); > >>> + if (err) { > >>> + error_report_err(err); > >>> + } > >>> exit(1); > >> > >> Doesn't this mean the program can exit without an error message, if > >> pci_nic_init returns failure but failed to set err? Shouldn't you at > >> least print something in that case as an else branch? > > > > git grep 'Unsupported NIC model' shows that the error is printed with > > error_report; same for other errors produced by pci_nic_init. > > > > This is not beautiful compared to correct propagation of Error*, but > > it's okay because -net is only used at startup. It's good enough for rc3. > > Thomas, can you clean this up now 2.3 is out? Sure, I'll have a look. Thomas