From patchwork Tue Jan 26 01:24:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joelle van Dyne X-Patchwork-Id: 12045061 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 6AD0CC433E0 for ; Tue, 26 Jan 2021 01:33:13 +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 DF3CE23102 for ; Tue, 26 Jan 2021 01:33:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF3CE23102 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=getutm.app Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4DEF-0002xO-T7 for qemu-devel@archiver.kernel.org; Mon, 25 Jan 2021 20:33:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4D6V-0005ew-Bb; Mon, 25 Jan 2021 20:25:13 -0500 Received: from mail-pg1-f176.google.com ([209.85.215.176]:37832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4D6P-00069x-7w; Mon, 25 Jan 2021 20:25:09 -0500 Received: by mail-pg1-f176.google.com with SMTP id z21so10190721pgj.4; Mon, 25 Jan 2021 17:25:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RdGbdMFIUd62J0vMmSPnX8R1crlr0ThF2wH5cyxIl8s=; b=bQMOBszsfGjl8QHtcmc4AVX1fRh1pUXSQvpmWnt9IyRmdxfqfuhZ7l9IvLHxAK9EWz pWY7CzFHNOnP7ofFTUjMXso+xNMPtStTL9kcV/JqjivnGo36MwFBATW5o/7Lucn3TgBl ddOQ2QUWaGoMmD9AMhY5Fdu3CHXAEMfXYIB6SrWE4D3aBfPRbJS7OuMNdYHyhGTt4kYF 468zVVGG7bDP6jRH+Hq9QMoMOe+QyDdYLYMYCULrpQE+HMg0vuSRrpb2xokKW2xTd9Cc YLSmYL8MFW4c+S+fNxOZ1yW15Ijk2BiHVEmY2NtZ5hAJjn/QpJMaCoKoEtBgg4c4KAnh jIAw== X-Gm-Message-State: AOAM533wjMIKTzWfoGLC3dI+1h4pt9vmnxC6LCOvj44YSV3b4voJzcO1 Zl01UOx1on5zrtADm3Y7QuZu2KXkWeY= X-Google-Smtp-Source: ABdhPJwjdQmY9GmrKfN0aGbd/iEtRBi/aPYsy+N9Af+U/+KdVAT7NVKdVl4cxxmhnFJfd0il0R31qQ== X-Received: by 2002:a63:c743:: with SMTP id v3mr3206061pgg.316.1611624302912; Mon, 25 Jan 2021 17:25:02 -0800 (PST) Received: from Yifans-Mac-Mini.hsd1.ca.comcast.net. ([98.35.5.7]) by smtp.gmail.com with ESMTPSA id o14sm536921pjf.12.2021.01.25.17.25.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2021 17:25:02 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v9 03/11] configure: check for sys/disk.h Date: Mon, 25 Jan 2021 17:24:49 -0800 Message-Id: <20210126012457.39046-4-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210126012457.39046-1-j@getutm.app> References: <20210126012457.39046-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.176; envelope-from=osy86github@gmail.com; helo=mail-pg1-f176.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 , Joelle van Dyne , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Some BSD platforms do not have this header. Signed-off-by: Joelle van Dyne --- meson.build | 1 + block.c | 2 +- block/file-posix.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 27110075df..6818d97df5 100644 --- a/meson.build +++ b/meson.build @@ -1117,6 +1117,7 @@ config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h')) config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h')) config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h')) config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) +config_host_data.set('HAVE_SYS_DISK_H', cc.has_header('sys/disk.h')) ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] diff --git a/block.c b/block.c index 8b9d457546..c4cf391dea 100644 --- a/block.c +++ b/block.c @@ -54,7 +54,7 @@ #ifdef CONFIG_BSD #include #include -#ifndef __DragonFly__ +#if defined(HAVE_SYS_DISK_H) #include #endif #endif diff --git a/block/file-posix.c b/block/file-posix.c index 11d2021346..666d3e7504 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2320,7 +2320,7 @@ again: } if (size == 0) #endif -#if defined(__APPLE__) && defined(__MACH__) +#if defined(HAVE_SYS_DISK_H) && defined(__APPLE__) && defined(__MACH__) { uint64_t sectors = 0; uint32_t sector_size = 0;