From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JcJiz-0000tF-C4 for qemu-devel@nongnu.org; Thu, 20 Mar 2008 08:18:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JcJiy-0000t2-1T for qemu-devel@nongnu.org; Thu, 20 Mar 2008 08:18:25 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcJix-0000sz-SX for qemu-devel@nongnu.org; Thu, 20 Mar 2008 08:18:23 -0400 Received: from bzq-179-150-194.static.bezeqint.net ([212.179.150.194] helo=il.qumranet.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JcJix-0002XX-84 for qemu-devel@nongnu.org; Thu, 20 Mar 2008 08:18:23 -0400 Message-ID: <47E2560B.8020902@qumranet.com> Date: Thu, 20 Mar 2008 14:18:19 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] PATCH: dont call exit() from pci_nic_init(), let caller handle References: <20080320001951.GI14060@us.ibm.com> In-Reply-To: <20080320001951.GI14060@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel@lists.sourceforge.net Ryan Harper wrote: > While exploring the PCI hotplug code recently posted, I encountered a > situation where I don't believe the current behavior is ideal. With > hotplug, we can add additional pci-based nic devices like e1000 and > rtl8139 from the qemu monitor. If one mistakenly specifies model=ne2000 > (the ISA version), qemu just exits. If a command is run from the > monitor and specifies bogus values, I don't believe the right behavior > is to exit out of the guest entirely. The attached patch (which doesn't > apply directly against qemu-cvs since hotplug hasn't been merged) > changes pci_nic_init() to return NULL on error instead of exiting > and then I've replaced all callers to check the return value and exit(), > preserving the existing behavior, but allowing flexibility so > hotplug can do the right thing and just report the error rather than > exiting the guest. > > Applied, thanks. [this didn't make it to kvm-devel for some reason?] -- error compiling committee.c: too many arguments to function