From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a05:6512:1086:0:0:0:0 with SMTP id j6csp413638lfg; Thu, 4 Aug 2022 07:28:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR5QuHd0n/SjiloqZj0gLKXLqXeQyAZzku8X2ApmBzxinN2YmckxFe4322oWQZ3EwEfRD6r1 X-Received: by 2002:a05:6214:19e1:b0:476:95b7:1dc9 with SMTP id q1-20020a05621419e100b0047695b71dc9mr1667668qvc.124.1659623298286; Thu, 04 Aug 2022 07:28:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623298; cv=none; d=google.com; s=arc-20160816; b=TKVSOUyZLoFbWS4KY1NJmOyFkN/EL6z1LjQmo0VoY/5EMbmr4eqeHd+NagJ4rzs9Ku YO+zbwhMCrBvMYU4ivyQyCspiU9zErdy7chy/UkUnEoBRMj2O3x+OBLgBt2AzZ/9keCK zzSUBPmxdfUSvg3ekOv7+fBBCyBUxhxgxFyLDz3Kz+6aOewZ/dNlH2heEvYaGXMZrEon LxUuGbns1DAB/A2esrKhiJRskrMHLidCM78l/eC+FqiY92mfU6wQ4Az2NxIP2imPQuOx d1D+7XO048o73Rj1EqUFurRFrEMdQRBj9q7aRBw5qAaV0Xkv/uJLVMbit09LezGZwZH5 qPpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:in-reply-to:date:references:subject:cc:to:from :dkim-signature; bh=CkBjU/Pi3F3P/ipGo4v2YQ4nW8bb9bX6H9UbI7RauGM=; b=TzX/9e+Fjo5lzzS2BoG2ubCIsJNuXGfkHBUsGUuym6ralSEtEPFns6+sS3cpfWCYNX hsRQKYZ+y74Fn9WhEGFadoqm7xn4RDsSk/BQqht+Y405U+6kWwsSwUZioZ9smIqnYi+9 T58+3acncxuymi6kLJzASHliyNGgntGRWsMWRsM+0edPLuk0gJuUIfWdViGVyn1GGHV8 xE7pErUjoKX+FR9UdPHERrEDnjaAVSG1A2VKvlO59Tke6+Z9YB+ak0UTU+R7VnCctZrz YyY9Ldf4U3hrBCYnJYKkJJwQt0ehsUIJLmzhhl5Ax+CHGYmVv6VLobAAEKiUNytQQl0S eUsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WGVsMy6Z; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fd8-20020a05622a4d0800b0033ff3e04d29si681809qtb.725.2022.08.04.07.28.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Aug 2022 07:28:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WGVsMy6Z; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:53978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJbph-0006ll-PZ for alex.bennee@linaro.org; Thu, 04 Aug 2022 10:28:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJbpI-0006k4-MY for qemu-arm@nongnu.org; Thu, 04 Aug 2022 10:27:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:49856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJbpF-0006aQ-Rn for qemu-arm@nongnu.org; Thu, 04 Aug 2022 10:27:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659623268; 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: in-reply-to:in-reply-to:references:references; bh=CkBjU/Pi3F3P/ipGo4v2YQ4nW8bb9bX6H9UbI7RauGM=; b=WGVsMy6Zpg0xBfoDE3U4okb46SBKfQvICgyQX05NBeD1tezesACez03mObC6kfJfgps8UB 0/FN8Gkt7Fy1Gb/+hZf9kSM5pCKazAFaf65AHvTLE4oSj2+KkzgY+4VOhiyfg39Pi69lAI Sqs9L7sDOMOGOCJ33x8FTL+2//pq/qY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-467-LgXrtpKnMAi3OVzaQWcbLg-1; Thu, 04 Aug 2022 10:27:44 -0400 X-MC-Unique: LgXrtpKnMAi3OVzaQWcbLg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 83FB43C02189; Thu, 4 Aug 2022 14:27:43 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 22A422166B26; Thu, 4 Aug 2022 14:27:43 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D566B21E6930; Thu, 4 Aug 2022 16:27:41 +0200 (CEST) From: Markus Armbruster To: Peter Maydell Cc: Kevin Wolf , Hao Wu , richard.henderson@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org, venture@google.com, Avi.Fishman@nuvoton.com, kfting@nuvoton.com, hskinnemoen@google.com, f4bug@amsat.org, bin.meng@windriver.com, qemu-block@nongnu.org, thuth@redhat.com, Hanna Reitz Subject: Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER References: <20220714182836.89602-1-wuhaotsh@google.com> <20220714182836.89602-6-wuhaotsh@google.com> <87ilnuda33.fsf@pond.sub.org> <878rodxpeq.fsf@pond.sub.org> Date: Thu, 04 Aug 2022 16:27:41 +0200 In-Reply-To: (Peter Maydell's message of "Thu, 28 Jul 2022 15:58:51 +0100") Message-ID: <874jysf5ia.fsf@pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: bYupFLo6VK1O Peter Maydell writes: > On Thu, 28 Jul 2022 at 15:50, Markus Armbruster wrote: >> Kevin Wolf writes: >> > >> > But if you have more than one device, it becomes hard to predict which >> > device gets which backend - it depends on the initialisation order in >> > the code then, >> >> Really? Board code should use IF_OTHER devices just like it uses the >> other interface types, namely connecting each frontend device to a >> backend device with a well-known and fixed interface type and index (or >> bus and unit instead, where appropriate). > > I think part of the problem is that unlike the typical disk > interface, where there is some idea of bus-and-unit-number or > index number that it makes sense to expose to users, these > "miscellaneous storage" devices don't have any particular index > concept -- in the real hardware there are just a random set of > devices that are connected in various places. So you're requiring > users to look up the documentation for "index 0 is this eeprom, > index 1 is that other eeprom, index 2 is ...". "Unit number on a bus" makes perfect sense for SCSI and PATA. For SATA, the only valid unit number is 0, which may or may not make sense to users. Not a problem in practice, though. Bus numbers are arbitrary, though. Harmless enough when you have to deal only with very few of them, e.g. a single SCSI HBA (one bus, number 0), a single PATA HBA (two buses, number 0 and 1), a single SATA HBA (typically six buses, numbers 0..5). For anything else, we use "index" rather than "bus" and "unit", and the indexes are completely arbitrary. Again, harmless enough when you have to deal only with a few of each interface type. *Names* rather than arbitrary index or bus numbers would arguably be a better interface. Nothing of this is new with IF_OTHER.