From patchwork Tue Jun 15 03:47:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 55601 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 8FBF71007D2 for ; Tue, 15 Jun 2010 13:52:01 +1000 (EST) Received: from localhost ([127.0.0.1]:58028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OONBu-0007K6-BU for incoming@patchwork.ozlabs.org; Mon, 14 Jun 2010 23:51:58 -0400 Received: from [140.186.70.92] (port=39040 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OONBA-0007Js-4j for qemu-devel@nongnu.org; Mon, 14 Jun 2010 23:51:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OONB8-0006H7-Ra for qemu-devel@nongnu.org; Mon, 14 Jun 2010 23:51:12 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:56537) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OONB8-0006Go-E6 for qemu-devel@nongnu.org; Mon, 14 Jun 2010 23:51:10 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 185B2187C1; Tue, 15 Jun 2010 12:51:05 +0900 (JST) Received: (nullmailer pid 5901 invoked by uid 1000); Tue, 15 Jun 2010 03:47:27 -0000 Date: Tue, 15 Jun 2010 12:47:27 +0900 From: Isaku Yamahata To: qemu-devel@nongnu.org Message-ID: <20100615034727.GT23473@valinux.co.jp> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Gerd Hoffmann , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH] pci hotplug: make pci hotplug return value to caller. 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 Make pci hotplug callback return value to caller. There is no reason to discard return value. Signed-off-by: Isaku Yamahata Acked-by: Gerd Hoffmann --- hw/pci.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 7787005..3777c1c 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1623,8 +1623,12 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base) pci_dev->romfile = qemu_strdup(info->romfile); pci_add_option_rom(pci_dev); - if (qdev->hotplugged) - bus->hotplug(bus->hotplug_qdev, pci_dev, 1); + if (qdev->hotplugged) { + rc = bus->hotplug(bus->hotplug_qdev, pci_dev, 1); + if (rc != 0) { + return rc; + } + } return 0; } @@ -1632,8 +1636,7 @@ static int pci_unplug_device(DeviceState *qdev) { PCIDevice *dev = DO_UPCAST(PCIDevice, qdev, qdev); - dev->bus->hotplug(dev->bus->hotplug_qdev, dev, 0); - return 0; + return dev->bus->hotplug(dev->bus->hotplug_qdev, dev, 0); } void pci_qdev_register(PCIDeviceInfo *info)