From 8cacc9ad14759908bed08faad7a4e78f3765a22d Mon Sep 17 00:00:00 2001 From: aliguori Date: Fri, 17 Apr 2009 18:06:34 +0000 Subject: [PATCH] Don't fail PCI hotplug if no NIC model is supplied (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 Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7155 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/pci-hotplug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index fa3a5e0932e..895ba047a98 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(const char *pci_addr, const char *opts) -- 2.39.5