From nobody Sun Feb 8 22:49:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489625709616475.2759470986165; Wed, 15 Mar 2017 17:55:09 -0700 (PDT) Received: from localhost ([::1]:40189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coJh6-00077y-G0 for importer@patchew.org; Wed, 15 Mar 2017 20:55:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coJf8-00067i-OM for qemu-devel@nongnu.org; Wed, 15 Mar 2017 20:53:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coJf7-0006n1-56 for qemu-devel@nongnu.org; Wed, 15 Mar 2017 20:53:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48242) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1coJf6-0006ms-VC for qemu-devel@nongnu.org; Wed, 15 Mar 2017 20:53:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D6110C05AA65; Thu, 16 Mar 2017 00:53:04 +0000 (UTC) Received: from scv.usersys.redhat.com (dhcp-17-221.bos.redhat.com [10.18.17.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id A10CA60F8E; Thu, 16 Mar 2017 00:53:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D6110C05AA65 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jsnow@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D6110C05AA65 From: John Snow To: qemu-devel@nongnu.org Date: Wed, 15 Mar 2017 20:52:57 -0400 Message-Id: <20170316005259.21970-2-jsnow@redhat.com> In-Reply-To: <20170316005259.21970-1-jsnow@redhat.com> References: <20170316005259.21970-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 16 Mar 2017 00:53:05 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-rc1 1/3] ide: qdev: register ide bus unrealize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Li Qiang , jsnow@redhat.com, Li Qiang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Li Qiang we have an idebus unrealize function, but it was being registered as the unrealize function for the IDE Device, so it was not getting invoked on device teardown because nothing is "unrealizing" the IDE devices themselves. Suggested-by: John Snow Signed-off-by: Li Qiang Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 1488449293-80280-2-git-send-email-liqiang6-s@360.cn Signed-off-by: John Snow --- hw/ide/qdev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 4383cd1..299e592 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -31,7 +31,7 @@ /* --------------------------------- */ =20 static char *idebus_get_fw_dev_path(DeviceState *dev); -static void idebus_unrealize(DeviceState *qdev, Error **errp); +static void idebus_unrealize(BusState *qdev, Error **errp); =20 static Property ide_props[] =3D { DEFINE_PROP_UINT32("unit", IDEDevice, unit, -1), @@ -43,14 +43,15 @@ static void ide_bus_class_init(ObjectClass *klass, void= *data) BusClass *k =3D BUS_CLASS(klass); =20 k->get_fw_dev_path =3D idebus_get_fw_dev_path; + k->unrealize =3D idebus_unrealize; } =20 -static void idebus_unrealize(DeviceState *qdev, Error **errp) +static void idebus_unrealize(BusState *bus, Error **errp) { - IDEBus *bus =3D DO_UPCAST(IDEBus, qbus, qdev->parent_bus); + IDEBus *ibus =3D IDE_BUS(bus); =20 - if (bus->vmstate) { - qemu_del_vm_change_state_handler(bus->vmstate); + if (ibus->vmstate) { + qemu_del_vm_change_state_handler(ibus->vmstate); } } =20 @@ -370,7 +371,6 @@ static void ide_device_class_init(ObjectClass *klass, v= oid *data) k->init =3D ide_qdev_init; set_bit(DEVICE_CATEGORY_STORAGE, k->categories); k->bus_type =3D TYPE_IDE_BUS; - k->unrealize =3D idebus_unrealize; k->props =3D ide_props; } =20 --=20 2.9.3