From patchwork Sat Feb 12 22:41:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 82952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C0953B7123 for ; Sun, 13 Feb 2011 09:59:01 +1100 (EST) Received: from localhost ([127.0.0.1]:49870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoOHG-0001uo-23 for incoming@patchwork.ozlabs.org; Sat, 12 Feb 2011 17:49:18 -0500 Received: from [140.186.70.92] (port=39314 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoOA5-0005fS-82 for qemu-devel@nongnu.org; Sat, 12 Feb 2011 17:41:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoOA3-0008Ba-M2 for qemu-devel@nongnu.org; Sat, 12 Feb 2011 17:41:52 -0500 Received: from mail-vx0-f173.google.com ([209.85.220.173]:47992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoOA3-0008BU-Gt for qemu-devel@nongnu.org; Sat, 12 Feb 2011 17:41:51 -0500 Received: by vxb40 with SMTP id 40so1996543vxb.4 for ; Sat, 12 Feb 2011 14:41:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=DwXDpQi93z9tF60P2pVSmnLTHmsmAARZctCDF+l06Ho=; b=cPHiyd/+tXwnTuhPh9+VTM4KevBiauK3BO4qvO3AbaBk1MtEfRoV2e2T1dsSKp9O+R kI3bPWuBA34UcOus9D9/orfhQvse/kScinNs1TjbXz8czP5le/XXKBma+NiE0JI1nEiA sssAHJmK8ptvoWNH/+uov3vq8952aXT1sj1qU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=aXs1MB7PskjEV6vbjzNCLgualRDxxs6sckijTKb9G0/OZjzyab2i/KaaFQqqCGZ2+0 hv1H0JWD6ehah9i7S7W1yvNs9iCbMm1NicrzE6MIMDA5mF5KQJkcfNAkwZto/VrZ8wXC ac2sh1TIUEveWFqYRbd5JWu9z/asa3IVRNXxE= Received: by 10.220.70.211 with SMTP id e19mr2686917vcj.204.1297550511102; Sat, 12 Feb 2011 14:41:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.186.7 with HTTP; Sat, 12 Feb 2011 14:41:31 -0800 (PST) From: Blue Swirl Date: Sun, 13 Feb 2011 00:41:31 +0200 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.220.173 Subject: [Qemu-devel] [PATCH 04/10] ne2000_isa: make optional X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Ignore failure with ne2000_isa device creation. Signed-off-by: Blue Swirl --- hw/pc.h | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/pc.h b/hw/pc.h index abdf307..50d9943 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -5,6 +5,7 @@ #include "ioport.h" #include "isa.h" #include "fdc.h" +#include "net.h" /* PC-style peripherals (also used by other machines). */ @@ -176,17 +177,21 @@ void pci_cirrus_vga_init(PCIBus *bus); void isa_cirrus_vga_init(void); /* ne2000.c */ -static inline void isa_ne2000_init(int base, int irq, NICInfo *nd) +static inline bool isa_ne2000_init(int base, int irq, NICInfo *nd) { ISADevice *dev; qemu_check_nic_model(nd, "ne2k_isa"); - dev = isa_create("ne2k_isa"); + dev = isa_try_create("ne2k_isa"); + if (!dev) { + return false; + } qdev_prop_set_uint32(&dev->qdev, "iobase", base); qdev_prop_set_uint32(&dev->qdev, "irq", irq); qdev_set_nic_properties(&dev->qdev, nd); qdev_init_nofail(&dev->qdev); + return true; } /* e820 types */