From nobody Tue Apr 8 22:27:31 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1644602613; cv=none; d=zohomail.com; s=zohoarc; b=VWJkD7MFcaeQHIMnzsIV0Ms1syh4tXUJsIDQumo4RG08XenrGWiXPDqo3TavFr3yFT9R6WSFYQpvgYaPqkuLTuIX1fhLhwNklQh7RixveVge3lrkzZJCGZzk66g9u/uTB7hWtsLj9OAhhKk9QijJrvKBhYHxXl5dV3hqxCLqJgo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644602613; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SC0MXzNV7/lfbUou57ztb9IDPIkw/4VrP4cuaPBM/kY=; b=CNFJ5lhXphL/LB+vDsZWSRyipbd4PnpPXFy1pSwIQ7lPolzRaPs9beGhiNyosJbdOthhSk+CPCnyBKT09KkBJO2RdA1emYEGZZmaIfhg2mRgqfw54nmB93xccdkoiaYkytHcAToNNAZe9uSAsI46qvwBhDfJncYNtMvU3REyR2s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644602613387785.8027817518612; Fri, 11 Feb 2022 10:03:33 -0800 (PST) Received: from localhost ([::1]:58486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIaGa-0006Af-2s for importer@patchew.org; Fri, 11 Feb 2022 13:03:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIaCQ-0003Ke-D5 for qemu-devel@nongnu.org; Fri, 11 Feb 2022 12:59:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIaCN-0006iY-7q for qemu-devel@nongnu.org; Fri, 11 Feb 2022 12:59:14 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-505-Rjq6OqB2PkuIep8FddJRgQ-1; Fri, 11 Feb 2022 12:59:07 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 479FE84DA41; Fri, 11 Feb 2022 17:59:06 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BF1B78ABA; Fri, 11 Feb 2022 17:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644602350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SC0MXzNV7/lfbUou57ztb9IDPIkw/4VrP4cuaPBM/kY=; b=Tey8t7aeY+6fVsKh4RLUCpRGqUi97G5QNrQFFYaoDoPitbQObXDCoZK4Fo5GezZQZS506a 8Ml5ReuqvAdfA0ZxHrFrhDZV2eN4A37DPpgVXzDCfi1T6TyJ+xLs+M5kQQ4kGG+MHfPD5c GGgrM2sHNExKHuJh3B7kN0PnmKf3OiY= X-MC-Unique: Rjq6OqB2PkuIep8FddJRgQ-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 1/3] block: Lock AioContext for drain_end in blockdev-reopen Date: Fri, 11 Feb 2022 18:58:52 +0100 Message-Id: <20220211175854.153798-2-kwolf@redhat.com> In-Reply-To: <20220211175854.153798-1-kwolf@redhat.com> References: <20220211175854.153798-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644602614656100001 Content-Type: text/plain; charset="utf-8" bdrv_subtree_drained_end() requires the caller to hold the AioContext lock for the drained node. Not doing this for nodes outside of the main AioContext leads to crashes when AIO_WAIT_WHILE() needs to wait and tries to temporarily release the lock. Fixes: 3908b7a8994fa5ef7a89aa58cd5a02fc58141592 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2046659 Reported-by: Qing Wang Signed-off-by: Kevin Wolf Message-Id: <20220203140534.36522-2-kwolf@redhat.com> Reviewed-by: Hanna Reitz Signed-off-by: Kevin Wolf --- blockdev.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 8197165bb5..42e098b458 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3530,6 +3530,7 @@ void qmp_blockdev_reopen(BlockdevOptionsList *reopen_= list, Error **errp) { BlockReopenQueue *queue =3D NULL; GSList *drained =3D NULL; + GSList *p; =20 /* Add each one of the BDS that we want to reopen to the queue */ for (; reopen_list !=3D NULL; reopen_list =3D reopen_list->next) { @@ -3579,7 +3580,15 @@ void qmp_blockdev_reopen(BlockdevOptionsList *reopen= _list, Error **errp) =20 fail: bdrv_reopen_queue_free(queue); - g_slist_free_full(drained, (GDestroyNotify) bdrv_subtree_drained_end); + for (p =3D drained; p; p =3D p->next) { + BlockDriverState *bs =3D p->data; + AioContext *ctx =3D bdrv_get_aio_context(bs); + + aio_context_acquire(ctx); + bdrv_subtree_drained_end(bs); + aio_context_release(ctx); + } + g_slist_free(drained); } =20 void qmp_blockdev_del(const char *node_name, Error **errp) --=20 2.34.1 From nobody Tue Apr 8 22:27:31 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1644602605; cv=none; d=zohomail.com; s=zohoarc; b=dn+JyCrq3mr52P9g2pih5PaXkwHIhUsTAPuX2bkEBkC9YbS4mlx8uhl5J4xk5jMauZZTw0gatO8yuq6u51i44SFBbuLlJVN41b6WG7krdhqozQtnd5LUUdHKIQPI+QnbVvUgwa8UbBqUeaoBjLF0WSBwZYgpmUwfeH63GzzqqzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644602605; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9LWXpA22M8SUlq+VOsvNNqWuUt8VRTi/D2NGo2pc2tw=; b=NX5yUBnii/xHSjhUpsqfKniyWmlBM7xK6BQgWtubp7Kv+VSz6xBLyfnMIomOhWjyZVHPV3BZnJXLRdcg6Sa2Kpoz8kYJUD0gHFuC9JHYfd9e8mu23PKxAEDsuwpI6j6SSmg9bvwQQkAXJiEyjsiv8KS9Rwllbbqhmv7ZTaV2RUA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644602605728846.0881216510054; Fri, 11 Feb 2022 10:03:25 -0800 (PST) Received: from localhost ([::1]:58262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIaGS-00061z-AW for importer@patchew.org; Fri, 11 Feb 2022 13:03:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIaCO-0003Ft-Qm for qemu-devel@nongnu.org; Fri, 11 Feb 2022 12:59:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIaCN-0006iT-2J for qemu-devel@nongnu.org; Fri, 11 Feb 2022 12:59:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-Q7jyWIzqOhKF-eRe0Dbqvg-1; Fri, 11 Feb 2022 12:59:08 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 90C5B1006AA3; Fri, 11 Feb 2022 17:59:07 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9317D78AB8; Fri, 11 Feb 2022 17:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644602350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9LWXpA22M8SUlq+VOsvNNqWuUt8VRTi/D2NGo2pc2tw=; b=I/5Y+1CMDNV9v2V5M87UTPn/T98FQF/nyfGC4xNtSHjWt0nPBmZbzirQQTFEwHzGaHNFYA +6AQazV29t73/MmCQS/Zarj72lbXd76Ep6uzEGJoZTdqyIOmaRxvZJqlxPGpEQeo7jja0k 73M3h7NIdMpyi38DtB080yw/D3I2iSA= X-MC-Unique: Q7jyWIzqOhKF-eRe0Dbqvg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 2/3] iotests: Test blockdev-reopen with iothreads and throttling Date: Fri, 11 Feb 2022 18:58:53 +0100 Message-Id: <20220211175854.153798-3-kwolf@redhat.com> In-Reply-To: <20220211175854.153798-1-kwolf@redhat.com> References: <20220211175854.153798-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644602606626100003 Content-Type: text/plain; charset="utf-8" The 'throttle' block driver implements .bdrv_co_drain_end, so blockdev-reopen will have to wait for it to complete in the polling loop at the end of qmp_blockdev_reopen(). This makes AIO_WAIT_WHILE() release the AioContext lock, which causes a crash if the lock hasn't correctly been taken. Signed-off-by: Kevin Wolf Message-Id: <20220203140534.36522-3-kwolf@redhat.com> Reviewed-by: Hanna Reitz Signed-off-by: Kevin Wolf --- tests/qemu-iotests/245 | 36 +++++++++++++++++++++++++++++++++--- tests/qemu-iotests/245.out | 4 ++-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index 24ac43f70e..8cbed7821b 100755 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -1138,12 +1138,13 @@ class TestBlockdevReopen(iotests.QMPTestCase): self.assertEqual(self.get_node('hd1'), None) self.assert_qmp(self.get_node('hd2'), 'ro', True) =20 - def run_test_iothreads(self, iothread_a, iothread_b, errmsg =3D None): - opts =3D hd_opts(0) + def run_test_iothreads(self, iothread_a, iothread_b, errmsg =3D None, + opts_a =3D None, opts_b =3D None): + opts =3D opts_a or hd_opts(0) result =3D self.vm.qmp('blockdev-add', conv_keys =3D False, **opts) self.assert_qmp(result, 'return', {}) =20 - opts2 =3D hd_opts(2) + opts2 =3D opts_b or hd_opts(2) result =3D self.vm.qmp('blockdev-add', conv_keys =3D False, **opts= 2) self.assert_qmp(result, 'return', {}) =20 @@ -1194,6 +1195,35 @@ class TestBlockdevReopen(iotests.QMPTestCase): def test_iothreads_switch_overlay(self): self.run_test_iothreads('', 'iothread0') =20 + def test_iothreads_with_throttling(self): + # Create a throttle-group object + opts =3D { 'qom-type': 'throttle-group', 'id': 'group0', + 'limits': { 'iops-total': 1000 } } + result =3D self.vm.qmp('object-add', conv_keys =3D False, **opts) + self.assert_qmp(result, 'return', {}) + + # Options with a throttle filter between format and protocol + opts =3D [ + { + 'driver': iotests.imgfmt, + 'node-name': f'hd{idx}', + 'file' : { + 'node-name': f'hd{idx}-throttle', + 'driver': 'throttle', + 'throttle-group': 'group0', + 'file': { + 'driver': 'file', + 'node-name': f'hd{idx}-file', + 'filename': hd_path[idx], + }, + }, + } + for idx in (0, 2) + ] + + self.run_test_iothreads('iothread0', 'iothread0', None, + opts[0], opts[1]) + if __name__ =3D=3D '__main__': iotests.activate_logging() iotests.main(supported_fmts=3D["qcow2"], diff --git a/tests/qemu-iotests/245.out b/tests/qemu-iotests/245.out index 4eced19294..a4e04a3266 100644 --- a/tests/qemu-iotests/245.out +++ b/tests/qemu-iotests/245.out @@ -17,8 +17,8 @@ read 1/1 bytes at offset 262152 read 1/1 bytes at offset 262160 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 -............... +................ ---------------------------------------------------------------------- -Ran 25 tests +Ran 26 tests =20 OK --=20 2.34.1 From nobody Tue Apr 8 22:27:31 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1644602772; cv=none; d=zohomail.com; s=zohoarc; b=AyHs4OZGFJfm5hjPNllqpjRZvvVMP1ZPdEok1fnKjBsT8FucvQen0PF/5F7Woa4gJELSjXhfu3mWqNZnzT4pKmpMtOoaL/nbC1jqPKfBtkLFc/8t9IxB4nvhepun/48NWNACPQ98GdyvUX56xyK6VrwEl8yIf3PSxfpF1DG0DKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644602772; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Wcn3gBRK6/6VKzHT3P18Rq/BFY2mvRFLMNI6yx9CnAE=; b=LgqgfxRzM91lYhTFA6buzdKeHcNDw4znBeZNYbdWM4PhQnxny2MdomCAzu+d0svRvBrqmclXSXE3OQ6J0owrNAv49HIMLDtidj7S3tf45Peuj/Jj3/Io2M58UjVlhmMc/4BQSwqNjzEGocU2stTrr8CgcXBysUA7MyxP8UIQLAI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644602772102957.7474023691105; Fri, 11 Feb 2022 10:06:12 -0800 (PST) Received: from localhost ([::1]:35752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIaJ9-0001Yp-2P for importer@patchew.org; Fri, 11 Feb 2022 13:06:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIaCU-0003Tx-5H for qemu-devel@nongnu.org; Fri, 11 Feb 2022 12:59:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIaCS-0006jr-LT for qemu-devel@nongnu.org; Fri, 11 Feb 2022 12:59:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-302-kdXwbZ-VNtqOWNwyfywdZQ-1; Fri, 11 Feb 2022 12:59:09 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E007A1006AA4; Fri, 11 Feb 2022 17:59:08 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE5AD78AA7; Fri, 11 Feb 2022 17:59:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644602355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wcn3gBRK6/6VKzHT3P18Rq/BFY2mvRFLMNI6yx9CnAE=; b=LezG+I3yCW8K/HoXYRv6ccMaTnSCVZzr9XITmNesCuix6vF+9F4DDm/WOd/Edu1yzB9Plb bdH8+f0NTZ3l2AduUW2mkvnjvT0exALAfO5KOnrKqxY3RzUtvIWD6z91q1tTH5Vbw0CmuX NumJnTd+2Ulf9N2izl29FKAzYMXheoY= X-MC-Unique: kdXwbZ-VNtqOWNwyfywdZQ-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 3/3] hw/block/fdc-isa: Respect QOM properties when building AML Date: Fri, 11 Feb 2022 18:58:54 +0100 Message-Id: <20220211175854.153798-4-kwolf@redhat.com> In-Reply-To: <20220211175854.153798-1-kwolf@redhat.com> References: <20220211175854.153798-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644602773457100001 From: Bernhard Beschow Other ISA devices such as serial-isa use the properties in their build_aml functions. fdc-isa not using them is probably an oversight. Signed-off-by: Bernhard Beschow Message-Id: <20220209191558.30393-1-shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Kevin Wolf --- hw/block/fdc-isa.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index 3bf64e0665..ab663dce93 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -216,6 +216,7 @@ int cmos_get_fd_drive_type(FloppyDriveType fd0) =20 static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope) { + FDCtrlISABus *isa =3D ISA_FDC(isadev); Aml *dev; Aml *crs; int i; @@ -227,11 +228,13 @@ static void fdc_isa_build_aml(ISADevice *isadev, Aml = *scope) }; =20 crs =3D aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04)); - aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01)); - aml_append(crs, aml_irq_no_flags(6)); aml_append(crs, - aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2)); + aml_io(AML_DECODE16, isa->iobase + 2, isa->iobase + 2, 0x00, 0x04)= ); + aml_append(crs, + aml_io(AML_DECODE16, isa->iobase + 7, isa->iobase + 7, 0x00, 0x01)= ); + aml_append(crs, aml_irq_no_flags(isa->irq)); + aml_append(crs, + aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, isa->d= ma)); =20 dev =3D aml_device("FDC0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700"))); --=20 2.34.1