From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lu7zW-0008Iu-JF for qemu-devel@nongnu.org; Wed, 15 Apr 2009 12:29:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lu7zR-0008Fv-Np for qemu-devel@nongnu.org; Wed, 15 Apr 2009 12:29:38 -0400 Received: from [199.232.76.173] (port=54428 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lu7zR-0008FO-8B for qemu-devel@nongnu.org; Wed, 15 Apr 2009 12:29:33 -0400 Received: from mail14.svc.cra.dublin.eircom.net ([159.134.118.30]:37195) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Lu7zQ-00062J-KB for qemu-devel@nongnu.org; Wed, 15 Apr 2009 12:29:32 -0400 From: Mark McLoughlin Date: Wed, 15 Apr 2009 17:29:24 +0100 Message-Id: <1239812969-8320-5-git-send-email-markmc@redhat.com> In-Reply-To: <1239812969-8320-4-git-send-email-markmc@redhat.com> References: <1239812969-8320-1-git-send-email-markmc@redhat.com> <1239812969-8320-2-git-send-email-markmc@redhat.com> <1239812969-8320-3-git-send-email-markmc@redhat.com> <1239812969-8320-4-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 4/9] Don't fail PCI hotplug if no NIC model is supplied Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , qemu-devel@nongnu.org, Mark McLoughlin It's perfectly fine to not supply a NIC model when adding a new NIC - we supply the default model to pci_nic_init() and it uses that if one wasn't explicitly supplied. Signed-off-by: Mark McLoughlin --- hw/pci-hotplug.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index d968a14..603d74d 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -37,10 +37,10 @@ static PCIDevice *qemu_pci_hot_add_nic(PCIBus *pci_bus, const char *opts) { int ret; - ret = net_client_init ("nic", opts); - if (ret < 0 || !nd_table[ret].model) + ret = net_client_init("nic", opts); + if (ret < 0) return NULL; - return pci_nic_init (pci_bus, &nd_table[ret], -1, "rtl8139"); + return pci_nic_init(pci_bus, &nd_table[ret], -1, "rtl8139"); } void drive_hot_add(Monitor *mon, const char *pci_addr, const char *opts) -- 1.6.0.6