From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VohUO-0004PT-Sm for qemu-devel@nongnu.org; Thu, 05 Dec 2013 17:33:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VohU9-0004BV-KL for qemu-devel@nongnu.org; Thu, 05 Dec 2013 17:33:44 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:34236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VohU9-0004BE-CH for qemu-devel@nongnu.org; Thu, 05 Dec 2013 17:33:29 -0500 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Dec 2013 15:33:28 -0700 From: Michael Roth Date: Thu, 5 Dec 2013 16:33:05 -0600 Message-Id: <1386282785-466-15-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1386282785-466-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1386282785-466-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v2 14/14] spapr_pci: emit hotplug add/remove events during hotplug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, agraf@suse.de, ncmike@ncultra.org, paulus@samba.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, qemu-ppc@nongnu.org From: Tyrel Datwyler This uses extension of existing EPOW interrupt/event mechanism to notify userspace tools like librtas/drmgr to handle in-guest configuration/cleanup operations in response to device_add/device_del. Userspace tools that don't implement this extension will need to be run manually in response/advance of device_add/device_del, respectively. Signed-off-by: Tyrel Datwyler Signed-off-by: Michael Roth --- hw/ppc/spapr_pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 9b4f829..9821462 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1129,14 +1129,18 @@ static void spapr_device_hotplug_remove(DeviceState *qdev, PCIDevice *dev) static int spapr_device_hotplug(DeviceState *qdev, PCIDevice *dev, PCIHotplugState state) { + int slot = PCI_SLOT(dev->devfn); + if (state == PCI_COLDPLUG_ENABLED) { return 0; } if (state == PCI_HOTPLUG_ENABLED) { spapr_device_hotplug_add(qdev, dev); + spapr_pci_hotplug_add_event(qdev, slot); } else { spapr_device_hotplug_remove(qdev, dev); + spapr_pci_hotplug_remove_event(qdev, slot); } return 0; -- 1.7.9.5