From patchwork Wed Oct 15 03:08:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 399707 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 EA5941400AB for ; Wed, 15 Oct 2014 14:17:59 +1100 (EST) Received: from localhost ([::1]:41470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeF65-0002Ho-UO for incoming@patchwork.ozlabs.org; Tue, 14 Oct 2014 23:17:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeEy1-0005zc-64 for qemu-devel@nongnu.org; Tue, 14 Oct 2014 23:09:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XeExu-0004mX-3d for qemu-devel@nongnu.org; Tue, 14 Oct 2014 23:09:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49304 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeExt-0004fZ-Kt for qemu-devel@nongnu.org; Tue, 14 Oct 2014 23:09:29 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 80817ABEF; Wed, 15 Oct 2014 03:09:29 +0000 (UTC) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 15 Oct 2014 05:08:55 +0200 Message-Id: <1413342561-4754-22-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1413342561-4754-1-git-send-email-afaerber@suse.de> References: <1413342561-4754-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PULL 21/47] qdev: Add simple/generic unplug callback for HotplugHandler 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: Igor Mammedov It will be used in shallow conversion from legacy hotplug mechanism and eventually replace all the uses of old mechanism DeviceClass::unplug = qdev_simple_unplug_cb() Signed-off-by: Igor Mammedov Reviewed-by: Paolo Bonzini Signed-off-by: Andreas Färber --- hw/core/qdev.c | 5 +++++ include/hw/qdev-core.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 6479194..9f18520 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -286,6 +286,11 @@ int qdev_simple_unplug_cb(DeviceState *dev) return 0; } +void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) +{ + qdev_simple_unplug_cb(dev); +} /* Like qdev_init(), but terminate program via error_report() instead of returning an error value. This is okay during machine creation. diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 48a96d2..ba812c5 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -265,6 +265,8 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, int required_for_version); void qdev_unplug(DeviceState *dev, Error **errp); int qdev_simple_unplug_cb(DeviceState *dev); +void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp); void qdev_machine_creation_done(void); bool qdev_machine_modified(void);