From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CF63C48BE5 for ; Tue, 15 Jun 2021 16:41:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1B24617C9 for ; Tue, 15 Jun 2021 16:41:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1B24617C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltC80-0007UM-RO for qemu-devel@archiver.kernel.org; Tue, 15 Jun 2021 12:41:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltC7B-0006Wn-37 for qemu-devel@nongnu.org; Tue, 15 Jun 2021 12:40:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltC78-0006bd-Vm for qemu-devel@nongnu.org; Tue, 15 Jun 2021 12:40:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623775233; 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=bTcLE+YCZ+lwO1G86sMJwWTmx7vQJWiVc/oZXpmQJvo=; b=Ak7h39M2WGlV+0Dj5I+4bGyzDsNPCt8uG26m9WHtxbGrqdQdzi7YD3Lk6KoRlFqhL1SRBh EnKyU+g1+kUu8qLAIJ/tbz7GMxki5DqgRPAVRRR4qMmdIlsUM398Z53HQ52QJ++0t8XETK 5M1ZQ4wFfEW9nio2TjcO+T7laIRXHTc= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-364-y2lnLYYyPz-MrdtFFElJ6A-1; Tue, 15 Jun 2021 12:40:30 -0400 X-MC-Unique: y2lnLYYyPz-MrdtFFElJ6A-1 Received: by mail-ed1-f71.google.com with SMTP id v12-20020aa7dbcc0000b029038fc8e57037so4442111edt.0 for ; Tue, 15 Jun 2021 09:40:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=bTcLE+YCZ+lwO1G86sMJwWTmx7vQJWiVc/oZXpmQJvo=; b=hX1RCvPx2XAMi5DrK0mAiKltpqzClzSp0Mjo2gFNgkkdiOVl9WIlqnqheI1qFtxJ82 rQEWMatGkM94Eh1F4lnVxnqz43iG28OsAI8/zAQh0bQ+dSmXpzp3+CVEhFEeLJDAyyuN bOYc5WwUlckTf8ES+yxvz30sBitevBNNigb/jvyvranb4xiC24IJMS2gK4Hvaq8FM7Vn Q3ea6cHGcJT2jHtC2X5Mx/w1YuZANcCUadMyoItpIQPs20MxjjG9WyTVI/HFxiBsAiYC yKrRWm8iPjs+jgW3iEjpUW9gBdG8zKtaVE7gvJehQAFVk4GDUur7OYibO1yIsj9n3d1y CNgA== X-Gm-Message-State: AOAM531TZvVoBIHlxrTMlJ4APLCVIZa+RFH9Tm8cmGeCcLBWogF9A5FL BpZGIuBfM7oepNCojupIx47Rgv0eYxYC2n9/tmBDctX7G+39Gn/e7h19/0DUJy+bKKpLXBlwWyW xJJ0PHMLJfHsXPsc= X-Received: by 2002:a17:907:1c1c:: with SMTP id nc28mr420464ejc.519.1623775229077; Tue, 15 Jun 2021 09:40:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjszqOoFpP/M4CQwyMGYua0RLmJlU2Umgu8TRs67sq7NY9NrI/APdi99Df1hXgWaXxLk/Xcw== X-Received: by 2002:a17:907:1c1c:: with SMTP id nc28mr420430ejc.519.1623775228817; Tue, 15 Jun 2021 09:40:28 -0700 (PDT) Received: from dresden.str.redhat.com ([2a02:908:1e46:160:b272:8083:d5:bc7d]) by smtp.gmail.com with ESMTPSA id m7sm2136346edc.46.2021.06.15.09.40.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 09:40:28 -0700 (PDT) Subject: Re: [PATCH v3 5/7] block: feature detection for host block support To: Paolo Bonzini , qemu-devel@nongnu.org References: <20210603133722.218465-1-pbonzini@redhat.com> <20210603133722.218465-6-pbonzini@redhat.com> From: Max Reitz Message-ID: <6a3e1f39-e14d-08e5-9c9e-85b3bab20e8d@redhat.com> Date: Tue, 15 Jun 2021 18:40:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210603133722.218465-6-pbonzini@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=170.10.133.124; envelope-from=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.197, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.095, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, Joelle van Dyne , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 03.06.21 15:37, Paolo Bonzini wrote: > From: Joelle van Dyne > > On Darwin (iOS), there are no system level APIs for directly accessing > host block devices. We detect this at configure time. > > Signed-off-by: Joelle van Dyne > Message-Id: <20210315180341.31638-2-j@getutm.app> > Signed-off-by: Paolo Bonzini > --- > block/file-posix.c | 33 ++++++++++++++++++++++----------- > meson.build | 6 +++++- > qapi/block-core.json | 10 +++++++--- > 3 files changed, 34 insertions(+), 15 deletions(-) [...] > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 2ea294129e..2dd41be156 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -897,7 +897,8 @@ > 'discriminator': 'driver', > 'data': { > 'file': 'BlockStatsSpecificFile', > - 'host_device': 'BlockStatsSpecificFile', > + 'host_device': { 'type': 'BlockStatsSpecificFile', > + 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)' }, > 'nvme': 'BlockStatsSpecificNvme' } } > > ## > @@ -2814,7 +2815,9 @@ > { 'enum': 'BlockdevDriver', > 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs', > 'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', > - 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscsi', > + 'gluster', 'host_cdrom', > + {'name': 'host_device', 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)' }, Shouldn’t this be done for host_cdrom, too? (and below) Apart from that, looks good to me. > + 'http', 'https', 'iscsi', > 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', > 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd', > { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' }, > @@ -3996,7 +3999,8 @@ > 'ftps': 'BlockdevOptionsCurlFtps', > 'gluster': 'BlockdevOptionsGluster', > 'host_cdrom': 'BlockdevOptionsFile', > - 'host_device':'BlockdevOptionsFile', > + 'host_device': { 'type': 'BlockdevOptionsFile', > + 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)' }, > 'http': 'BlockdevOptionsCurlHttp', > 'https': 'BlockdevOptionsCurlHttps', > 'iscsi': 'BlockdevOptionsIscsi',