From nobody Tue Feb 10 14:32:20 2026 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624631391500160.48500538230053; Fri, 25 Jun 2021 07:29:51 -0700 (PDT) Received: from localhost ([::1]:55390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwmq5-0006iZ-Vx for importer@patchew.org; Fri, 25 Jun 2021 10:29:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwmfP-0003dd-IQ for qemu-devel@nongnu.org; Fri, 25 Jun 2021 10:18:48 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:39840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwmfO-0003IX-3s for qemu-devel@nongnu.org; Fri, 25 Jun 2021 10:18:47 -0400 Received: by mail-ed1-x531.google.com with SMTP id c7so13614066edn.6 for ; Fri, 25 Jun 2021 07:18:45 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c28sm326579ejc.102.2021.06.25.07.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 07:18:44 -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=BevMjojoz4Zbbmnx7q+o91aCSPbNgcWVWrT6Beq1/n0=; b=j/t3NaFlb05cyTxwmTLGxPUCyPxVg3ekrPPBddyaXECjzmUvvO687mw9T5Goc9jtsK Lwp4IBmaEjzDD2otZtNLyMsBF8rpOVqe2clDb8ST8yQ8C67LkHuYhtB2J1SCgsENtWaJ xN46pyITVLL+GPej/u4C3qAFAOTdlReEpu9IsFSXVpeqT1k350xILAmXZp8gX7ZnfNl7 xlBS3QAoxfHr9qd2OSsLfiUsEY9xOgeJkcMh/iis/SGkBrgsNYSgMo2SjXS1Db5BrivW gBTehwffXK4rbjdtmGclK/YqDyA9k1SnX+XcOJXS/4EFodZ+KL5WWk5TDDHs4zENWk+y rkIw== 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=BevMjojoz4Zbbmnx7q+o91aCSPbNgcWVWrT6Beq1/n0=; b=WrW84vO/14uKuY8AfDN74op7NUlsE7ZsECK/AfCZqUR9mal5l+WNaWivfARujAL+ky 1fEnJtn/UHqil5+0D/CoxJjbuJnFMhVfAIDcRh/IauBjMbuB3l02l6AI8wrnCFKp+2b2 oWsWVq7PwBDXujqYUC2epP2suCFUPlEzs/mzFLlw0DIOwnzLrkuLnL71MNXf5oZPcLw0 5K3qCo8Fh/YfpTqa0fpkoKktvwTPj2O2UuQPqGgUK2l/ZN0Jlal/YLAJng69Qusf5o6p jvzHEEuCrLMOG+ctZKJz5y3FTvhjCFZvCoAjTpGSjWafqKXlfiuzCBz1GqkJ8F6uebsq cSrA== X-Gm-Message-State: AOAM533I4v2ukpF/M4KiuHoFuFt9Kp9T4NbGGHEvhu3JnEnh2gwe/Kem KPZl/Bb/KiAVGuzhd5RZnSIj96psb98= X-Google-Smtp-Source: ABdhPJw6N3SrpKNEWIoWBnGldEAK/UyFPWmCJN8qgE3kbV7bpI3V6oOKii9bgxGkCzkXVWPFyJntMw== X-Received: by 2002:a05:6402:348d:: with SMTP id v13mr5633568edc.119.1624630724868; Fri, 25 Jun 2021 07:18:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 22/28] block: detect DKIOCGETBLOCKCOUNT/SIZE before use Date: Fri, 25 Jun 2021 16:18:16 +0200 Message-Id: <20210625141822.1368639-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210625141822.1368639-1-pbonzini@redhat.com> References: <20210625141822.1368639-1-pbonzini@redhat.com> MIME-Version: 1.0 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::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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: Joelle van Dyne , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Joelle van Dyne iOS hosts do not have these defined so we fallback to the default behaviour. Co-authored-by: Warner Losh Signed-off-by: Joelle van Dyne Signed-off-by: Paolo Bonzini --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index f16d987c07..74b8216077 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2341,7 +2341,7 @@ again: } } #endif -#if defined(__APPLE__) && defined(__MACH__) +#if defined(DKIOCGETBLOCKCOUNT) && defined(DKIOCGETBLOCKSIZE) if (size =3D=3D 0) { uint64_t sectors =3D 0; uint32_t sector_size =3D 0; --=20 2.31.1