From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57020 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdM2b-0006jm-Fv for qemu-devel@nongnu.org; Thu, 13 Jan 2011 07:12:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdM2a-0001Lu-5m for qemu-devel@nongnu.org; Thu, 13 Jan 2011 07:12:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdM2Z-0001Lp-SL for qemu-devel@nongnu.org; Thu, 13 Jan 2011 07:12:32 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0DCCUaW007850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Jan 2011 07:12:30 -0500 Message-ID: <4D2EEC29.1040800@redhat.com> Date: Thu, 13 Jan 2011 13:12:25 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 1/4] pci: allow devices being tagged as not hotpluggable. References: <1294323280-21692-1-git-send-email-kraxel@redhat.com> <1294323280-21692-2-git-send-email-kraxel@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org >> @@ -1620,6 +1620,11 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base) >> info->is_bridge); >> if (pci_dev == NULL) >> return -1; >> + if (qdev->hotplugged&& info->no_hotplug) { >> + qerror_report(QERR_DEVICE_NO_HOTPLUG, info->qdev.name); >> + do_pci_unregister_device(pci_dev); >> + return -1; >> + } > > Any particular reason for not check this before > do_pci_register_device()? Don't remember, probably not. I think can could be moved up (and loose the unregister call) and behavior will not change. cheers, Gerd