From nobody Sat Nov 15 20:33:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1596701488; cv=none; d=zohomail.com; s=zohoarc; b=hiqrpCi1sIgZTOkPdXxSFxIylE6zy8olsUbhuk3luD9J02XB5D8gItTBt3HaiAcSBKcQQN4hs5nxxNpaLoc0DXfn/GVVka7H1hnXYu3dwNqKobFQY014MQQWXIJK9AhEcRZ56J/AXU+5IDqkZU5+ZHf1Ehx4Rgu7iyTmuz1qMJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596701488; 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=7eAZ0/8yiggvPhkOUdkJ91QA34FcT2pw/7CIAHLDBoI=; b=Rpa4AO1sGVjknvrSNj1QbcpJ7tS5Aj2R6P3S5gH7fEol/DdkOv5cye5PO06+KA+idncCgHVjanMbPlK2fuMWY4deCCe9xmMMNW32NFDBcqZX/UlUlf8DqBTvoTJ+keSoY91t1+4qn28teRHtdN2umZf6DSUbP7XaG3CCX4Lvpwo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159670148835856.56656969646019; Thu, 6 Aug 2020 01:11:28 -0700 (PDT) Received: from localhost ([::1]:59332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3azn-0007hO-6a for importer@patchew.org; Thu, 06 Aug 2020 04:11:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3ax5-0002UQ-AM; Thu, 06 Aug 2020 04:08:39 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:33009) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3ax3-0005gs-Jo; Thu, 06 Aug 2020 04:08:38 -0400 Received: by mail-wr1-x431.google.com with SMTP id p20so8172616wrf.0; Thu, 06 Aug 2020 01:08:36 -0700 (PDT) Received: from localhost.localdomain (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id w2sm6039587wre.5.2020.08.06.01.08.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 01:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7eAZ0/8yiggvPhkOUdkJ91QA34FcT2pw/7CIAHLDBoI=; b=gT4mV6Re+G81D1DVLg9KyuO+IJIuIezbYCwieNnxvT+udghu7NEpXuqp0bMRBEHHsZ pEJIUgOclMIRZ+DtmjrLYx9yEx0+6MQwMK2maW2bd2/S98LWdc7hjLvwZaodgtUDXBDA KZKG2cmbD6SydenFWC+tM/YpDnlP17JwQEBbShY+OpLWifR9/CmZ5DLQ2nogsQaM38NZ /rBF41Wa8P+vB2UeEjwGr2WXvxHDSSarzobR6q43IZOx8Fj9H8mwhih3pSE+b0mDJjYt qRnpCRPcEnRB1+Tugj7NiDIl4a5POWas5hehqknBekmZWT5aLJPKUt2fUKwxDtrj0pvq pHXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7eAZ0/8yiggvPhkOUdkJ91QA34FcT2pw/7CIAHLDBoI=; b=P4WK3EQdM/MptmLXffSLte+RwKSzkZr46w7kzLpcLFbrEilfxToLKKjk+O7bgcT5mo 6EtGM86wy66Qn50OFTBd2+jM5hkOPM6IGlch/XbzTmbn0fBOBpPqNZPu8Cp09eGXMqKW Wku1DlQBr7R9o59A8YEhl73pGiWRkj8T+4KrRb8q6/kHRkiht+snCR569ya4G9sdcBe3 YUKGxiiqkTXiwmyVeaRP1xijqLRZg5kqU46DgOyyrBdnxDv9eGaX0Z/A3MIw7BV9v0NT 1M4wIUz64SUn+cbiNvn9nzqCdmgjzUzeQvuw0cHcsMgBV1/9zvaOGnvjj+uI8C9507TW p5VQ== X-Gm-Message-State: AOAM5327s4zpw9o/yG7UIsXmJrvyuvAqYL/t2n14r1kGqKgDsjZ6pIlF AowFCtMi+Hyi7/3+a/hpHHMNshJ3 X-Google-Smtp-Source: ABdhPJyyNSbtrPbc8vneLMA2gswDfr9U65erO/ZXRdVXi1BT3/35+DwLFTbnaUFVx0lQPaam955IpQ== X-Received: by 2002:adf:cd12:: with SMTP id w18mr6399520wrm.352.1596701315485; Thu, 06 Aug 2020 01:08:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.2 7/7] hw/block/fdc: Add ASCII art schema of QOM relations Date: Thu, 6 Aug 2020 10:08:24 +0200 Message-Id: <20200806080824.21567-8-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200806080824.21567-1-f4bug@amsat.org> References: <20200806080824.21567-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::431; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x431.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Without knowing the QEMU history, it is hard to relate QEMU objects with the hardware datasheet. For example, one naively expects: * a floppy disk is plugged / unplugged on the bus Wrong! QEMU floppy disks always sit on the bus. The block drives are plugged / unplugged on the disks, and the disks magically re-adapt their proprieties to match the block drive. * a floppy controller has a fixed number of disks pluggable on the bus Wrong! QEMU floppy controllers have as much slots as the number of floppy drive provided when a machine is created. Then the ACPI table are generated and the number of slots can not be modified. So if you expect a dual slot controller being created with slot A and B, if the machine is created with a single drive attached, the controller will only have slot A created, and you will never be able to plug drive B without risking a mismatch in the ACPI tables. * a floppy controller supporting 4 disks uses 2 buses Wrong! QEMU uses a single bus to plug the 4 disks. As all these false assumptions are not obvious (we don't plug a disk, we plug a block drive into a disk, etc...), start documenting the QOM relationships with a simple ASCII schema. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/block/fdc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 6944b06e4b..b109f37050 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -47,6 +47,28 @@ #include "qemu/module.h" #include "trace.h" =20 +/* + * QOM relationship: + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * + * +-------------------+ + * | | + * isa/sysbus <--->| | + * | | + * irq/dma <----| fdc | + * | + * clk ---->| | +-+------+-+ +-+------= +-+ + * | | | | blk | | | | blk = | | + * +--------+----------+ | | | | | | = | | + * | | +------+ | | +------= + | + * | | | | = | + * | | floppy | | floppy= | + * | +----+-----+ +----+---= --+ + * | floppy-bus | | + * +------------------------v---------------v--- + * + */ + /********************************************************/ /* debug Floppy devices */ =20 --=20 2.21.3