From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmhWg-0000IH-N1 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:48:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmhWZ-0005fW-UE for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:48:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmhWZ-0005fB-NQ for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:48:31 -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 (8.14.4/8.14.4) with ESMTP id t3RBmUcX023442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Apr 2015 07:48:30 -0400 From: Markus Armbruster References: <1428586365-17909-1-git-send-email-thuth@redhat.com> <5526C58F.2050805@redhat.com> <5526D99D.7010103@redhat.com> Date: Mon, 27 Apr 2015 13:48:27 +0200 In-Reply-To: <5526D99D.7010103@redhat.com> (Paolo Bonzini's message of "Thu, 09 Apr 2015 21:57:17 +0200") Message-ID: <87wq0x3i7o.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain 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: Paolo Bonzini Cc: Thomas Huth , mst@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com 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?