From patchwork Fri May 1 06:41:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 466889 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 81AA7140320 for ; Fri, 1 May 2015 16:52:20 +1000 (AEST) Received: from localhost ([::1]:47045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yo4o6-0003qK-Os for incoming@patchwork.ozlabs.org; Fri, 01 May 2015 02:52:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yo4eC-0008SH-Gh for qemu-devel@nongnu.org; Fri, 01 May 2015 02:42:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yo4e8-0001Ki-2f for qemu-devel@nongnu.org; Fri, 01 May 2015 02:42:04 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:47222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yo4e7-0001Hs-PW; Fri, 01 May 2015 02:42:00 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id E180914078A; Fri, 1 May 2015 16:41:53 +1000 (AEST) From: David Gibson To: agraf@suse.de Date: Fri, 1 May 2015 16:41:48 +1000 Message-Id: <1430462510-14195-31-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430462510-14195-1-git-send-email-david@gibson.dropbear.id.au> References: <1430462510-14195-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2401:3900:2:1::2 Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, Tyrel Datwyler , afaerber@suse.de, David Gibson Subject: [Qemu-devel] [PATCH 30/32] spapr_pci: emit hotplug add/remove events during hotplug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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 Reviewed-by: David Gibson Signed-off-by: David Gibson --- 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 3178a70..2e7590c 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1075,6 +1075,9 @@ static void spapr_phb_hot_plug_child(HotplugHandler *plug_handler, error_propagate(errp, local_err); return; } + if (plugged_dev->hotplugged) { + spapr_hotplug_req_add_event(drc); + } } static void spapr_phb_hot_unplug_child(HotplugHandler *plug_handler, @@ -1101,6 +1104,7 @@ static void spapr_phb_hot_unplug_child(HotplugHandler *plug_handler, error_propagate(errp, local_err); return; } + spapr_hotplug_req_remove_event(drc); } }