From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48542 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOR7l-0001qn-Rb for qemu-devel@nongnu.org; Tue, 15 Jun 2010 04:03:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOR7k-0007UN-BJ for qemu-devel@nongnu.org; Tue, 15 Jun 2010 04:03:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36654) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOR7k-0007UI-4j for qemu-devel@nongnu.org; Tue, 15 Jun 2010 04:03:56 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5F83tvV001691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 15 Jun 2010 04:03:55 -0400 Date: Tue, 15 Jun 2010 13:35:35 +0530 From: Amit Shah Subject: Re: [Qemu-devel] [PATCH v2] net: Fix hotplug with pci_add Message-ID: <20100615080535.GB20578@amit-laptop.redhat.com> References: <356ef9bdde008d695e7c75dd1566222d6160d4b6.1276011638.git.amit.shah@redhat.com> <20100608172525.GB10305@amit-laptop.redhat.com> <20100609095811.GB20595@amit-laptop.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100609095811.GB20595@amit-laptop.redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Juan Quintela , Gerd Hoffmann , qemu list On (Wed) Jun 09 2010 [15:28:11], Amit Shah wrote: > > Let me rephrase: Behavior changes for -net types without an init() > > method. The only one without an init() method is "none". Before, > > net_client_init() succeeded for it. Now it fails. What's the impact of > > that change? And why does it make sense? > > It makes sense because we don't actually initialise anything. We don't > place anything in the nd_table[] array. That means callers shouldn't > poke in the array for any values. Returning -1 makes sense for that > reason. If we continued to return 0, callers might just assume that init > was successful and that nd_table[0] was set up for use appropriately. > > The thing is that the code doesn't go this far in case of '-net none' > anyway. This was just a potential bug lurking around for any new -net > method which didn't have an init. Hm, I only tested -net none from the monitor, using pci_add. Looks like I skipped testing it from the cmd line. I did that today and found out the VM doesn't start. I've sent a patch to revert to the original behaviour of returning 0, and we'll have to find another way of fixing the 'success or index' return problem. Amit