From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXRqV-0001d8-Pt for qemu-devel@nongnu.org; Fri, 26 Sep 2014 05:29:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXRqP-0007eS-E9 for qemu-devel@nongnu.org; Fri, 26 Sep 2014 05:29:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXRqP-0007dW-5g for qemu-devel@nongnu.org; Fri, 26 Sep 2014 05:29:41 -0400 From: Igor Mammedov Date: Fri, 26 Sep 2014 09:28:21 +0000 Message-Id: <1411723721-20484-17-git-send-email-imammedo@redhat.com> In-Reply-To: <1411723721-20484-1-git-send-email-imammedo@redhat.com> References: <1411723721-20484-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v2 16/36] qdev: add simple/generic unplug callback for HotplugHandler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: cornelia.huck@de.ibm.com, mst@redhat.com, amit.shah@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, kraxel@redhat.com, dmitry@daynix.com, pbonzini@redhat.com, rth@twiddle.net 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 --- 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 c89d781..1d1b113 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); -- 1.8.3.1