From patchwork Sat Jan 23 04:56:22 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: 1430641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3lm1c5Gz9sS8 for ; Sat, 23 Jan 2021 15:57:40 +1100 (AEDT) Received: from localhost ([::1]:52000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3AzS-0006sO-6P for incoming@patchwork.ozlabs.org; Fri, 22 Jan 2021 23:57:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3AyV-0006pN-UG; Fri, 22 Jan 2021 23:56:39 -0500 Received: from mail-pj1-f43.google.com ([209.85.216.43]:54561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3AyU-0005nw-6z; Fri, 22 Jan 2021 23:56:39 -0500 Received: by mail-pj1-f43.google.com with SMTP id cq1so5068552pjb.4; Fri, 22 Jan 2021 20:56:37 -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=lr0g9cBtE48tU4EJmSiiQmz+iS86Z7gy8ZRT7zhMcpo=; b=pTsdKKUldjVNKuR4GUW/m07JlAXiSil0kDbjIkAFepkVTF0/gN7827gPvRxC8ZdTR0 592jX2dqz2hgoA+5+vFkkPuKVe7JWqecnn0Lzq3uf46Gsv+HJ4YCkXNNl+713TOQC5mF nEtor0T+W6qR84OdysZSE/rQ6JC5XKeQ5a3GEgzlTxAO8s2DHUEKH0pMX57U1a+muTHZ 21ziioA7hErdomZS261hxfVQS7ADTeEh+bMeM252DHsrS9hbAIwy91rj2RXFJmXLZSUn gtt/ph7Q1skVZObFzv5ybIFIhV9xArx5SsAvOic7u5qRg+8XrjGIpbNXAbm/HqKe9EMu bd0Q== X-Gm-Message-State: AOAM532u724QScvDGu6GEUs7VeIyyy7VBWj0tewYi8d7FaJbOchdLUwv Lp1ILj5X+T1k/NWnyEAO50hD2I1VJ8U= X-Google-Smtp-Source: ABdhPJykaqXVK26vUry1DtYqtUt9QwGWJXSE8nBsyomf01+7prSvL/ezE0Xmuwm4Pkshydy6RXZBxg== X-Received: by 2002:a17:90a:de06:: with SMTP id m6mr1555925pjv.167.1611377796442; Fri, 22 Jan 2021 20:56:36 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:36 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 01/11] block: feature detection for host block support Date: Fri, 22 Jan 2021 20:56:22 -0800 Message-Id: <20210123045632.18482-2-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.43; envelope-from=osy86github@gmail.com; helo=mail-pj1-f43.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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 , "open list:raw" , Markus Armbruster , Max Reitz , Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- meson.build | 6 +++++- qapi/block-core.json | 10 +++++++--- block/file-posix.c | 33 ++++++++++++++++++++++----------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index af2bc89741..27110075df 100644 --- a/meson.build +++ b/meson.build @@ -180,7 +180,7 @@ if targetos == 'windows' include_directories: include_directories('.')) elif targetos == 'darwin' coref = dependency('appleframeworks', modules: 'CoreFoundation') - iokit = dependency('appleframeworks', modules: 'IOKit') + iokit = dependency('appleframeworks', modules: 'IOKit', required: false) elif targetos == 'sunos' socket = [cc.find_library('socket'), cc.find_library('nsl'), @@ -1023,6 +1023,9 @@ if get_option('cfi') add_project_link_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc']) endif +have_host_block_device = (targetos != 'darwin' or + cc.has_header('IOKit/storage/IOMedia.h')) + ################# # config-host.h # ################# @@ -1113,6 +1116,7 @@ config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h')) 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) ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] diff --git a/qapi/block-core.json b/qapi/block-core.json index 3484986d1c..1a9576de8d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -959,7 +959,8 @@ 'discriminator': 'driver', 'data': { 'file': 'BlockStatsSpecificFile', - 'host_device': 'BlockStatsSpecificFile', + 'host_device': { 'type': 'BlockStatsSpecificFile', + 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)' }, 'nvme': 'BlockStatsSpecificNvme' } } ## @@ -2827,7 +2828,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)' }, + '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)' }, @@ -4012,7 +4015,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', diff --git a/block/file-posix.c b/block/file-posix.c index 00cdaaa2d4..11d2021346 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -42,6 +42,8 @@ #include "scsi/constants.h" #if defined(__APPLE__) && (__MACH__) +#include +#if defined(HAVE_HOST_BLOCK_DEVICE) #include #include #include @@ -52,6 +54,7 @@ //#include #include #include +#endif /* defined(HAVE_HOST_BLOCK_DEVICE) */ #endif #ifdef __sun__ @@ -181,7 +184,17 @@ typedef struct BDRVRawReopenState { bool check_cache_dropped; } BDRVRawReopenState; -static int fd_open(BlockDriverState *bs); +static int fd_open(BlockDriverState *bs) +{ + BDRVRawState *s = bs->opaque; + + /* this is just to ensure s->fd is sane (its called by io ops) */ + if (s->fd >= 0) { + return 0; + } + return -EIO; +} + static int64_t raw_getlength(BlockDriverState *bs); typedef struct RawPosixAIOData { @@ -3014,6 +3027,7 @@ static BlockStatsSpecific *raw_get_specific_stats(BlockDriverState *bs) return stats; } +#if defined(HAVE_HOST_BLOCK_DEVICE) static BlockStatsSpecific *hdev_get_specific_stats(BlockDriverState *bs) { BlockStatsSpecific *stats = g_new(BlockStatsSpecific, 1); @@ -3023,6 +3037,7 @@ static BlockStatsSpecific *hdev_get_specific_stats(BlockDriverState *bs) return stats; } +#endif /* HAVE_HOST_BLOCK_DEVICE */ static QemuOptsList raw_create_opts = { .name = "raw-create-opts", @@ -3247,6 +3262,8 @@ BlockDriver bdrv_file = { /***********************************************/ /* host device */ +#if defined(HAVE_HOST_BLOCK_DEVICE) + #if defined(__APPLE__) && defined(__MACH__) static kern_return_t GetBSDPath(io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize, int flags); @@ -3539,16 +3556,6 @@ hdev_co_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) } #endif /* linux */ -static int fd_open(BlockDriverState *bs) -{ - BDRVRawState *s = bs->opaque; - - /* this is just to ensure s->fd is sane (its called by io ops) */ - if (s->fd >= 0) - return 0; - return -EIO; -} - static coroutine_fn int hdev_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes) { @@ -3872,6 +3879,8 @@ static BlockDriver bdrv_host_cdrom = { }; #endif /* __FreeBSD__ */ +#endif /* HAVE_HOST_BLOCK_DEVICE */ + static void bdrv_file_init(void) { /* @@ -3879,6 +3888,7 @@ static void bdrv_file_init(void) * registered last will get probed first. */ bdrv_register(&bdrv_file); +#if defined(HAVE_HOST_BLOCK_DEVICE) bdrv_register(&bdrv_host_device); #ifdef __linux__ bdrv_register(&bdrv_host_cdrom); @@ -3886,6 +3896,7 @@ static void bdrv_file_init(void) #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) bdrv_register(&bdrv_host_cdrom); #endif +#endif /* HAVE_HOST_BLOCK_DEVICE */ } block_init(bdrv_file_init); From patchwork Sat Jan 23 04:56:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joelle van Dyne X-Patchwork-Id: 1430640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3lY51YJz9sS8 for ; Sat, 23 Jan 2021 15:57:29 +1100 (AEDT) Received: from localhost ([::1]:52568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3AzH-00079U-LT for incoming@patchwork.ozlabs.org; Fri, 22 Jan 2021 23:57:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3AyW-0006q7-JU for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:40 -0500 Received: from mail-pg1-f172.google.com ([209.85.215.172]:46021) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3AyV-0005og-1z for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:40 -0500 Received: by mail-pg1-f172.google.com with SMTP id v19so5213142pgj.12 for ; Fri, 22 Jan 2021 20:56:38 -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=eMRwurTuLuNX0gT374+MwlAcTFDPiYipqZcijLZJHhI=; b=VZ2f1I7rRWbEz6yHAfkWunTWZD3agF9Yg9JFYBx1qeyjBLPcdKaRcLN2iPFvTxul/+ VeO5uflU9qufUs8n4P0bzkQXb4O1jmCYUMe+fC1ml1MEIGoh+wkYRAmRMOfPDArk8r6a F/YDs9Q/WCTDtle2/9/3kSEC5vIEh3LyZdWT7GcBiNucK2ZQyEGz/vypJt+3YhU4Sbgo oUS544l4Xd2ekK7p9ZrTBzJ6ErjjCHttxypyCeMxAOV/JBfs8y4QPbJRklFWxmDqn/9o 7u7qYcAzauIuvWzC4wQkqlMxiV/lVEP8sbmgqFL/sr4P5OtMcq7f/ew3DJDRR106Fbwm it3g== X-Gm-Message-State: AOAM532myqxj7mcyp2EfDoIB/O4c3btiPvNKyHbZ5xSRxwJqV7+e/8r6 AHK3xTi3np5rvnAsymCVuZhkk5nTJy8= X-Google-Smtp-Source: ABdhPJzH3lXUHvSet/K+dyChrhLtSEJqmwDRZ3cXnc8UuBugm0T2TqNfRBnL54ucv1xQ2NdhTAOfoQ== X-Received: by 2002:a63:4204:: with SMTP id p4mr6931577pga.246.1611377797447; Fri, 22 Jan 2021 20:56:37 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:37 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 02/11] configure: cross-compiling with empty cross_prefix Date: Fri, 22 Jan 2021 20:56:23 -0800 Message-Id: <20210123045632.18482-3-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.172; envelope-from=osy86github@gmail.com; helo=mail-pg1-f172.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.249, 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The iOS toolchain does not use the host prefix naming convention. So we need to enable cross-compile options while allowing the PREFIX to be blank. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Joelle van Dyne --- configure | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 6f6a319c2f..8d8a4733d7 100755 --- a/configure +++ b/configure @@ -238,6 +238,7 @@ cpu="" iasl="iasl" interp_prefix="/usr/gnemul/qemu-%M" static="no" +cross_compile="no" cross_prefix="" audio_drv_list="" block_drv_rw_whitelist="" @@ -469,6 +470,7 @@ for opt do optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') case "$opt" in --cross-prefix=*) cross_prefix="$optarg" + cross_compile="yes" ;; --cc=*) CC="$optarg" ;; @@ -1696,7 +1698,7 @@ $(echo Deprecated targets: $deprecated_targets_list | \ --target-list-exclude=LIST exclude a set of targets from the default target-list Advanced options (experts only): - --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix] + --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix] --cc=CC use C compiler CC [$cc] --iasl=IASL use ACPI compiler IASL [$iasl] --host-cc=CC use C compiler CC [$host_cc] for code run at @@ -6390,7 +6392,7 @@ if has $sdl2_config; then fi echo "strip = [$(meson_quote $strip)]" >> $cross echo "windres = [$(meson_quote $windres)]" >> $cross -if test -n "$cross_prefix"; then +if test "$cross_compile" = "yes"; then cross_arg="--cross-file config-meson.cross" echo "[host_machine]" >> $cross if test "$mingw32" = "yes" ; then From patchwork Sat Jan 23 04:56:24 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: 1430643 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3nl0jQcz9sS8 for ; Sat, 23 Jan 2021 15:59:23 +1100 (AEDT) Received: from localhost ([::1]:32972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3B17-0002EU-15 for incoming@patchwork.ozlabs.org; Fri, 22 Jan 2021 23:59:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3AyY-0006sb-7t; Fri, 22 Jan 2021 23:56:42 -0500 Received: from mail-pl1-f181.google.com ([209.85.214.181]:40938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3AyW-0005pQ-N7; Fri, 22 Jan 2021 23:56:41 -0500 Received: by mail-pl1-f181.google.com with SMTP id q4so4444905plr.7; Fri, 22 Jan 2021 20:56:39 -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=GD5SEnjRe9BVnqPKdbeYO1Y+eoayRFyNSzt2tXX/h+s5sNpig9hdCscUaeZGePmDOz abZXqbJh7iNbIoSEmn2Cp4Stv94wg1eJO6nRl/W8px8F+L9dweRk01IjpuJUCfhX8n8L dcrKCdCuaeWwE0pVvxRLoIikHoJocscFqx58202Y9jIqdVr6Z6dk2xYAFMvYi/4v3VsG Tllaj6c0/KAcz2meRw/1EtoC88YjASoGne2vTjzoYYU58I4DX0EMtzcLnfTwmjDjmdN0 phIpvZRDggyeZte3lph2gOczN+zKye0JyHplUriew53TC666NSidD/Y2EJ36jQ73nCHm vsPw== X-Gm-Message-State: AOAM533wFzNukoFhb/wusDfG55AYFvGSZ7Bo+hh5FanD3lKS4FznxiTw c+8uY3EIPP5WymoIE0ap76wkRH+YCiE= X-Google-Smtp-Source: ABdhPJzN81wQYrhok7J58c5bfL9qiMvocce9sdgcwX+uDluNp5ENnRZscKCGPXShn6yZJPXzxkgyJw== X-Received: by 2002:a17:90a:8814:: with SMTP id s20mr9544223pjn.69.1611377798622; Fri, 22 Jan 2021 20:56:38 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:38 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 03/11] configure: check for sys/disk.h Date: Fri, 22 Jan 2021 20:56:24 -0800 Message-Id: <20210123045632.18482-4-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.181; envelope-from=osy86github@gmail.com; helo=mail-pl1-f181.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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+incoming=patchwork.ozlabs.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; From patchwork Sat Jan 23 04:56:25 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: 1430639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3lV5QMPz9sS8 for ; Sat, 23 Jan 2021 15:57:26 +1100 (AEDT) Received: from localhost ([::1]:52232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3AzE-0006yd-MN for incoming@patchwork.ozlabs.org; Fri, 22 Jan 2021 23:57:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3AyZ-0006uo-2G for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:43 -0500 Received: from mail-pg1-f181.google.com ([209.85.215.181]:41692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3AyX-0005ph-Bi for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:42 -0500 Received: by mail-pg1-f181.google.com with SMTP id i7so5225718pgc.8 for ; Fri, 22 Jan 2021 20:56:40 -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=t/s7LuKyWj4qS9lc8M/U0JqbBc0yM+MKS6B5tjJBzrs=; b=dPhBGK13v3Es39JfNr0G4Hm/3kgl7JOWPYz+tUhqy/NA1uKxwkrq2Tk7vfpU1kDvOL XTPwax7r/9E/VSpwxgmO/1TSu0auOz1ZXetv/ygiioTQr6DPmRaJLQTkT7PW1y828zGb j7Z3W2hb8CbJsaqXmK4LzNkbgWyeBxHNFBAHIcQSWfNslwWbrBoXo/ftAX78EVdZcsqA W0FP9nvSZt1fWk+a0TkJiXZRhKzyu8rlFH8sITZTM/LzLX2jkpslpLiYK5NISm6U1u87 LDPfKYvxr0NLaVv7LLBB62wMhhV0QcfBBMh4YFR56LaDkEAYZv5c9Zk3woVf71YI+X2v vXpA== X-Gm-Message-State: AOAM532gmlhrq3YfV1z9OjiauUEQY3FrvI4Q2W2GKryQeSW1Q1rLg1Rt 8y5JorXaSUJaT39RiVaB+cXMj08M5SM= X-Google-Smtp-Source: ABdhPJyi2Ejo3dvI8x4jVNuMfwID+YJpVXbM+yxygI2KOKV8cf3SOvb+l6IauIEmeRqgOdRsMcVCpA== X-Received: by 2002:a63:f249:: with SMTP id d9mr45119pgk.109.1611377799757; Fri, 22 Jan 2021 20:56:39 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:39 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 04/11] slirp: feature detection for smbd Date: Fri, 22 Jan 2021 20:56:25 -0800 Message-Id: <20210123045632.18482-5-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.181; envelope-from=osy86github@gmail.com; helo=mail-pg1-f181.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: Samuel Thibault , Jason Wang , Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace Windows specific macro with a more generic feature detection macro. Allows slirp smb feature to be disabled manually as well. Signed-off-by: Joelle van Dyne --- configure | 22 +++++++++++++++++++++- meson.build | 2 +- net/slirp.c | 16 ++++++++-------- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 8d8a4733d7..d72ab22da5 100755 --- a/configure +++ b/configure @@ -464,6 +464,7 @@ fuse="auto" fuse_lseek="auto" malloc_trim="auto" +slirp_smbd="auto" # parse CC options second for opt do @@ -845,7 +846,18 @@ do fi done +# Check for smbd dupport : ${smbd=${SMBD-/usr/sbin/smbd}} +if test "$slirp_smbd" != "no" ; then + if test "$mingw32" = "yes" ; then + if test "$slirp_smbd" = "yes" ; then + error_exit "Host smbd not supported on this platform." + fi + slirp_smbd=no + else + slirp_smbd=yes + fi +fi # Default objcc to clang if available, otherwise use CC if has clang; then @@ -1560,6 +1572,10 @@ for opt do ;; --disable-fuse-lseek) fuse_lseek="disabled" ;; + --enable-slirp-smbd) slirp_smbd=yes + ;; + --disable-slirp-smbd) slirp_smbd=no + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1899,6 +1915,7 @@ disabled with --disable-FEATURE, default is enabled if available libdaxctl libdaxctl support fuse FUSE block device export fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE exports + slirp-smbd use smbd (at path --smbd=*) in slirp networking NOTE: The object files are built at the place where configure is launched EOF @@ -5573,7 +5590,10 @@ fi if test "$guest_agent" = "yes" ; then echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak fi -echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak +if test "$slirp_smbd" = "yes" ; then + echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak + echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak +fi if test "$vde" = "yes" ; then echo "CONFIG_VDE=y" >> $config_host_mak echo "VDE_LIBS=$vde_libs" >> $config_host_mak diff --git a/meson.build b/meson.build index 6818d97df5..f1e67b8cd1 100644 --- a/meson.build +++ b/meson.build @@ -2336,7 +2336,7 @@ summary_info += {'sphinx-build': sphinx_build.found()} summary_info += {'genisoimage': config_host['GENISOIMAGE']} # TODO: add back version summary_info += {'slirp support': slirp_opt == 'disabled' ? false : slirp_opt} -if slirp_opt != 'disabled' +if slirp_opt != 'disabled' and 'CONFIG_SLIRP_SMBD' in config_host summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']} endif summary_info += {'module support': config_host.has_key('CONFIG_MODULES')} diff --git a/net/slirp.c b/net/slirp.c index 8350c6d45f..4348e74805 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -27,7 +27,7 @@ #include "net/slirp.h" -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) #include #include #endif @@ -90,7 +90,7 @@ typedef struct SlirpState { Slirp *slirp; Notifier poll_notifier; Notifier exit_notifier; -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) gchar *smb_dir; #endif GSList *fwd; @@ -103,7 +103,7 @@ static QTAILQ_HEAD(, SlirpState) slirp_stacks = static int slirp_hostfwd(SlirpState *s, const char *redir_str, Error **errp); static int slirp_guestfwd(SlirpState *s, const char *config_str, Error **errp); -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) static int slirp_smb(SlirpState *s, const char *exported_dir, struct in_addr vserver_addr, Error **errp); static void slirp_smb_cleanup(SlirpState *s); @@ -367,7 +367,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, struct in6_addr ip6_prefix; struct in6_addr ip6_host; struct in6_addr ip6_dns; -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) struct in_addr smbsrv = { .s_addr = 0 }; #endif NetClientState *nc; @@ -477,7 +477,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, return -1; } -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) if (vsmbserver && !inet_aton(vsmbserver, &smbsrv)) { error_setg(errp, "Failed to parse SMB address"); return -1; @@ -592,7 +592,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, } } } -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) if (smb_export) { if (slirp_smb(s, smb_export, smbsrv, errp) < 0) { goto error; @@ -784,7 +784,7 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict) } -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) /* automatic user mode samba server configuration */ static void slirp_smb_cleanup(SlirpState *s) @@ -899,7 +899,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir, return 0; } -#endif /* !defined(_WIN32) */ +#endif /* defined(CONFIG_SLIRP_SMBD) */ static int guestfwd_can_read(void *opaque) { From patchwork Sat Jan 23 04:56:26 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: 1430644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3nl6R36z9sS8 for ; Sat, 23 Jan 2021 15:59:23 +1100 (AEDT) Received: from localhost ([::1]:33000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3B17-0002FI-Ra for incoming@patchwork.ozlabs.org; Fri, 22 Jan 2021 23:59:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Aya-0006w9-CD for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:44 -0500 Received: from mail-pf1-f177.google.com ([209.85.210.177]:46237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3AyZ-0005qg-06 for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:44 -0500 Received: by mail-pf1-f177.google.com with SMTP id f63so5153955pfa.13 for ; Fri, 22 Jan 2021 20:56:42 -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=kIoUr2yR0KcUYoWG4DQ2Z71j4B+vjENfUsLTTDxw42w=; b=AnxK4rezKyOD9GNi7pevCHb1MfqLWAG+gW6HeMYL+cUsIjWfb3f9+LGxzJvoQppvdr YhSDZSgQpGGjTqFNaj+s4YCv00aMKVHqlg7XeFmjqjsWqOgIKJubFBQ4WPBN2uOSiwiM 9pv93cquXnLqrPxGrZnnwyNDBjBcVY8ylEDOzFZJUL2NISS9+p9gzCT12ahUYwCvYZd/ UehsaHjwv+WBklOl+HhIRpc5d+mea4e22aHJffo7VaUjBeE+XjkMkNeOol6BPA8Kb2qw jx845Lvc8nfDabHZIosQyY0i/y7RB/3gM0waUgbUcF5co180NB9EDDfP4GieK6EVIS+h TAtw== X-Gm-Message-State: AOAM533STTzMV6SgiAWJPkiV6GqODQL7ZCbrceBoaT0WlqkcRBWyuZIS pO7ONUFBELG7HDiIEQ6KJMsTGncngZg= X-Google-Smtp-Source: ABdhPJyxPmwLq/bu8lSCIaiXPqEOkxQaFvvF09AP3Vxs1yzSBFrJor1uA9u/XWEbk1t125U2w8ORbg== X-Received: by 2002:a63:dc53:: with SMTP id f19mr7879889pgj.443.1611377801326; Fri, 22 Jan 2021 20:56:41 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:41 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 05/11] osdep: build with non-working system() function Date: Fri, 22 Jan 2021 20:56:26 -0800 Message-Id: <20210123045632.18482-6-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.177; envelope-from=osy86github@gmail.com; helo=mail-pf1-f177.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Build without error on hosts without a working system(). If system() is called, return -1 with ENOSYS. Signed-off-by: Joelle van Dyne --- configure | 20 ++++++++++++++++++++ include/qemu/osdep.h | 12 ++++++++++++ 2 files changed, 32 insertions(+) diff --git a/configure b/configure index d72ab22da5..de7487a0c7 100755 --- a/configure +++ b/configure @@ -5302,6 +5302,22 @@ but not implemented on your system" fi fi +########################################## +# check for system() +# make sure there is no compile error + +have_system_function=no +cat > $TMPC << EOF +#include +int main(void) { + return system(""); +} +EOF +if compile_prog "" "" ; then + have_system_function=yes +fi + + ########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -6200,6 +6216,10 @@ if test "$secret_keyring" = "yes" ; then echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak fi +if test "$have_system_function" = "yes" ; then + echo "HAVE_SYSTEM_FUNCTION=y" >> $config_host_mak +fi + echo "ROMS=$roms" >> $config_host_mak echo "MAKE=$make" >> $config_host_mak echo "PYTHON=$python" >> $config_host_mak diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a434382c58..5bd1a67769 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -682,4 +682,16 @@ char *qemu_get_host_name(Error **errp); */ size_t qemu_get_host_physmem(void); +/** + * Platforms which do not support system() return ENOSYS + */ +#ifndef HAVE_SYSTEM_FUNCTION +#define system platform_does_not_support_system +static inline int platform_does_not_support_system(const char *command) +{ + errno = ENOSYS; + return -1; +} +#endif /* !HAVE_SYSTEM_FUNCTION */ + #endif From patchwork Sat Jan 23 04:56:27 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: 1430645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3ns20Qqz9sS8 for ; Sat, 23 Jan 2021 15:59:29 +1100 (AEDT) Received: from localhost ([::1]:60850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3B1D-000262-5o for incoming@patchwork.ozlabs.org; Fri, 22 Jan 2021 23:59:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Ayb-0006xO-Dw for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:47 -0500 Received: from mail-pf1-f177.google.com ([209.85.210.177]:37125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Aya-0005rE-6X for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:45 -0500 Received: by mail-pf1-f177.google.com with SMTP id 11so5182840pfu.4 for ; Fri, 22 Jan 2021 20:56:43 -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=M6Dkfzz2uwZnsdtAWpa/2Lp0RFHpqr85gTbmXPeFpZw=; b=mh+1VcYXvJdDL99Eyo3vK/P0EFt1t0Nct6OCXW22MJjdC7Kg0SGnIkKxQ9JmaPqElD +hG5wy0yd0DlqgbZ6eOIrtXcQqyo7Tg5GPk3h4pJxAC0JsD4pIRsiOmCTVdlEobmSO9g GMOXTEByoRYFw5/l2lJTzE7+DA3AroRoMHJNDOJhXFFAZiu6urio3JT2C0dYNlt1lF7t bVFe8Iy4q0Qz1SDvwh2rbJFPmaftz3uyXtHS6rIMXuchnqvjNk23oxkVKtEcFtaLgZEr I1lvkYwSuxVYOVKH0zUTqTfgENeZbRcWdRTAwH8110LhZRvDY0Ov5ElmXQV4Eri9itUW 3XQg== X-Gm-Message-State: AOAM530rI77qqrGG04s0pDDtwxz02Kl8KVyHOpwIf1EAdIAmmG0mveJz pa/MXkus9lgvy46mhJ+Il1iAn18/KFM= X-Google-Smtp-Source: ABdhPJxSghe+GMlCMuaick6kbpp9bYbykFMH7jvZER4T0OYvKcOzyOWck78K7q7HZ3GOgDu00NiMhg== X-Received: by 2002:a62:52cc:0:b029:1bd:e13a:fc1b with SMTP id g195-20020a6252cc0000b02901bde13afc1bmr5306670pfb.46.1611377802921; Fri, 22 Jan 2021 20:56:42 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:42 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 06/11] darwin: remove redundant dependency declaration Date: Fri, 22 Jan 2021 20:56:27 -0800 Message-Id: <20210123045632.18482-7-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.177; envelope-from=osy86github@gmail.com; helo=mail-pf1-f177.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: Peter Maydell , Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Meson will find CoreFoundation, IOKit, and Cocoa as needed. Reviewed-by: Peter Maydell Signed-off-by: Joelle van Dyne --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index de7487a0c7..0fd3f14c5e 100755 --- a/configure +++ b/configure @@ -781,7 +781,6 @@ Darwin) fi audio_drv_list="coreaudio try-sdl" audio_possible_drivers="coreaudio sdl" - QEMU_LDFLAGS="-framework CoreFoundation -framework IOKit $QEMU_LDFLAGS" # Disable attempts to use ObjectiveC features in os/object.h since they # won't work when we're compiling with gcc as a C compiler. QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" From patchwork Sat Jan 23 04:56:28 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: 1430642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3nV2jyrz9sS8 for ; Sat, 23 Jan 2021 15:59:10 +1100 (AEDT) Received: from localhost ([::1]:60134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3B0s-0001o7-MO for incoming@patchwork.ozlabs.org; Fri, 22 Jan 2021 23:59:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Ayf-0006yg-7A for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:50 -0500 Received: from mail-pf1-f180.google.com ([209.85.210.180]:37899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Ayc-0005s1-Dr for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:47 -0500 Received: by mail-pf1-f180.google.com with SMTP id y205so5175714pfc.5 for ; Fri, 22 Jan 2021 20:56:45 -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=Evc3Shcq8rsCtOF7PANGsgPxIxxAPv8CQExUls7YgO4=; b=kTwjFgCC0CWn2k0yU/ofto2s6U054dwS7HdoHuVdIHriK1IXpmjYDh/BOOcGT9ZfpQ WTgpP/dcymT6r5l/jl7zUuwGFTPBONZyUQEiY/WaYOUM+LM3TjsLw3olVGRMhezd+CS4 9eLNOtCUnmaMZtMvQhKhJHfcrLuZ4aWfdE7eF5qYSgY14CKSqv9+Rt269T0jMrsMvxJw Jx977XU5/N8FfhaZG/Ac4/xbWU6H1gsK5RcUUZHYJFRiPFaGBsub00XcFy7eNSAUbE6W YcdT7Qg10z5ltM4bmxY8FiNDLSUPle0B1oxBDimFVpKx1jjSu4OZCOOLUu5UPCvTd7Rf WHLQ== X-Gm-Message-State: AOAM533dsnU5CN1hmAuq5zLTK+uOmHqIG3dsBw+vp8VBTKIY8w3XVmLI P1U52R7RKrVUGyVWbxgK2s7tVbT04P4= X-Google-Smtp-Source: ABdhPJxjaNAT7xnAWuxMbRa3Zv/PiI+t5aQqFjnUtyf48cFvh5aF+UXepxG8ebzARxI2nYSqJPWh1g== X-Received: by 2002:a65:6409:: with SMTP id a9mr7965431pgv.171.1611377804538; Fri, 22 Jan 2021 20:56:44 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:44 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 07/11] darwin: fix cross-compiling for Darwin Date: Fri, 22 Jan 2021 20:56:28 -0800 Message-Id: <20210123045632.18482-8-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.180; envelope-from=osy86github@gmail.com; helo=mail-pf1-f180.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: Peter Maydell , Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add objc to the Meson cross file as well as detection of Darwin. Reviewed-by: Peter Maydell Signed-off-by: Joelle van Dyne --- configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure b/configure index 0fd3f14c5e..d4588ed892 100755 --- a/configure +++ b/configure @@ -6422,6 +6422,7 @@ echo "cpp_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross echo "[binaries]" >> $cross echo "c = [$(meson_quote $cc)]" >> $cross test -n "$cxx" && echo "cpp = [$(meson_quote $cxx)]" >> $cross +test -n "$objcc" && echo "objc = [$(meson_quote $objcc)]" >> $cross echo "ar = [$(meson_quote $ar)]" >> $cross echo "nm = [$(meson_quote $nm)]" >> $cross echo "pkgconfig = [$(meson_quote $pkg_config_exe)]" >> $cross @@ -6440,6 +6441,9 @@ if test "$cross_compile" = "yes"; then if test "$linux" = "yes" ; then echo "system = 'linux'" >> $cross fi + if test "$darwin" = "yes" ; then + echo "system = 'darwin'" >> $cross + fi case "$ARCH" in i386|x86_64) echo "cpu_family = 'x86'" >> $cross From patchwork Sat Jan 23 04:56:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joelle van Dyne X-Patchwork-Id: 1430647 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3rt0bLLz9sS8 for ; Sat, 23 Jan 2021 16:02:06 +1100 (AEDT) Received: from localhost ([::1]:41312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3B3k-0005dI-16 for incoming@patchwork.ozlabs.org; Sat, 23 Jan 2021 00:02:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Ayh-0006zO-69 for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:52 -0500 Received: from mail-pj1-f44.google.com ([209.85.216.44]:36792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Ayf-0005sg-0Q for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:50 -0500 Received: by mail-pj1-f44.google.com with SMTP id e6so5162144pjj.1 for ; Fri, 22 Jan 2021 20:56:47 -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=+5VyG67cg0m7jFdStswHbTchlQ/RRRnpxZ5acd1A248=; b=XrvZquNWnRwxclfXhFSEV+U2ePHcvLu6zdgVy/BzTR5vwFbaKf9lgkaL0Tna8OuUqR rV+g9zCz8fRrHsVqfKJu30YdOYqKKwSA/o/fIYv0ED7B67L89tYm3zA8WEK1XaZMUPLN hd+R8Ub2gSBSwbMXHo5x5B8x3ptAbz36k5ZDZCwNlKVquyzPvb+3eYFr4PjR1gPpplMp 49UVXlJUVwIFuoffmNMLJN27Htnvgscqp7SURSQTgxcpeUDbr7Iv1TnHp/9r5MhXKj6r UoDbsx+RlJCT1bR+7ExW6KFCehNlsud/h2lufPMM9d6ZvTtr1Bus1CkL986YCxVlV/4v g3rQ== X-Gm-Message-State: AOAM531SkVQjaDlXGhs5JZU3BMyPkm/5SbaXPfZkVA2KBhaUcNniCxNX R8nesjq6DmUJaVcr391x9j+N1q0LNfo= X-Google-Smtp-Source: ABdhPJwek/iojpGjShO/TdNXS99YkAE+ZnCkkeDAr3GHa/nQdDh3gTDlSDVuN+v4D0bsPlVBzyb+Lw== X-Received: by 2002:a17:902:44d:b029:de:c063:85c9 with SMTP id 71-20020a170902044db02900dec06385c9mr1109533ple.35.1611377806061; Fri, 22 Jan 2021 20:56:46 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:45 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 08/11] configure: cross compile should use x86_64 cpu_family Date: Fri, 22 Jan 2021 20:56:29 -0800 Message-Id: <20210123045632.18482-9-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.44; envelope-from=osy86github@gmail.com; helo=mail-pj1-f44.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Joelle van Dyne --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d4588ed892..b8ae4609fd 100755 --- a/configure +++ b/configure @@ -6445,9 +6445,12 @@ if test "$cross_compile" = "yes"; then echo "system = 'darwin'" >> $cross fi case "$ARCH" in - i386|x86_64) + i386) echo "cpu_family = 'x86'" >> $cross ;; + x86_64) + echo "cpu_family = 'x86_64'" >> $cross + ;; ppc64le) echo "cpu_family = 'ppc64'" >> $cross ;; From patchwork Sat Jan 23 04:56:30 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: 1430646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3rp69YXz9sS8 for ; Sat, 23 Jan 2021 16:02:02 +1100 (AEDT) Received: from localhost ([::1]:40992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3B3g-0005V8-P8 for incoming@patchwork.ozlabs.org; Sat, 23 Jan 2021 00:02:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Ayh-0006zL-6B; Fri, 22 Jan 2021 23:56:52 -0500 Received: from mail-pj1-f54.google.com ([209.85.216.54]:55520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Ayf-0005sm-B0; Fri, 22 Jan 2021 23:56:50 -0500 Received: by mail-pj1-f54.google.com with SMTP id j12so5065549pjy.5; Fri, 22 Jan 2021 20:56:48 -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=B3bgTvyMVaMNKOvbfkCeAjPnu2P94ObpQ3L4Z8LkPIk=; b=ZCsBc1XZxUOkri0ark6D7AZQehDuWJ3fGobnAw2H4ywpUUzRGKDGBsVysajUhH/Jd0 hnlTxT6KUecVji875Ic+duUjwZJkFhcz1HHEiMAmu3/jQKImFjxILbn01Yv/0oMvnjXM lxfzrTwE7cCVrwGRXGR+2hto+y52gwVP1UWocr8lKVzI+i0xZT/ZxSfZ9HEgiYZ7xwmL fsoqczdA0asAO8nbUNFRWshilHATaDEfkepYERguT6/EKJTnvuwm/B5hU5vqzf6WB/a9 xHHvJK9setKbV1odZqAi4byiJ9MfWs9oROXqnbvh9dw5L7C0FtrWy8xDtkpVidCw1e0B 1/aw== X-Gm-Message-State: AOAM530EetZO2XeVsE91QeHWsEoBITw1DPTsDW9xR6p2cWbCAPqax4Jk WGxZZQnTw3oCuhLpci/81WotnnQrXLE= X-Google-Smtp-Source: ABdhPJzD0q0CY52pUgDEOAHJ8Uj1xt98INpqDD0Qyzx+4i3sX9UOek389ngBnv2pFNhrokT284L6EA== X-Received: by 2002:a17:90b:107:: with SMTP id p7mr9218673pjz.110.1611377807217; Fri, 22 Jan 2021 20:56:47 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:46 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 09/11] block: check availablity for preadv/pwritev on mac Date: Fri, 22 Jan 2021 20:56:30 -0800 Message-Id: <20210123045632.18482-10-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.54; envelope-from=osy86github@gmail.com; helo=mail-pj1-f54.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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:raw" , Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 666d3e7504..6473f84db8 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1386,17 +1386,50 @@ static int handle_aiocb_flush(void *opaque) #ifdef CONFIG_PREADV static bool preadv_present = true; +static bool preadv_checked; static ssize_t qemu_preadv(int fd, const struct iovec *iov, int nr_iov, off_t offset) { +#ifdef CONFIG_DARWIN /* preadv introduced in macOS 11 */ + if (unlikely(!preadv_checked)) { + if (__builtin_available(macOS 11, iOS 14, watchOS 7, tvOS 14, *)) { + preadv_checked = true; + } else { + preadv_present = false; + return -ENOSYS; + } + } + /* Now we suppress the availability warning since we use the cached check */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability-new" + return preadv(fd, iov, nr_iov, offset); +#pragma clang diagnostic pop +#else /* CONFIG_DARWIN */ return preadv(fd, iov, nr_iov, offset); +#endif } static ssize_t qemu_pwritev(int fd, const struct iovec *iov, int nr_iov, off_t offset) { +#ifdef CONFIG_DARWIN /* preadv introduced in macOS 11 */ + if (unlikely(!preadv_checked)) { + if (__builtin_available(macOS 11, iOS 14, watchOS 7, tvOS 14, *)) { + preadv_checked = true; + } else { + preadv_present = false; + return -ENOSYS; + } + } + /* Now we suppress the availability warning since we use the cached check */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability-new" + return pwritev(fd, iov, nr_iov, offset); +#pragma clang diagnostic pop +#else /* CONFIG_DARWIN */ return pwritev(fd, iov, nr_iov, offset); +#endif } #else From patchwork Sat Jan 23 04:56:31 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: 1430648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3s375Twz9sS8 for ; Sat, 23 Jan 2021 16:02:15 +1100 (AEDT) Received: from localhost ([::1]:41354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3B3t-0005eF-UO for incoming@patchwork.ozlabs.org; Sat, 23 Jan 2021 00:02:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Ayh-0006zc-OG for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:52 -0500 Received: from mail-pl1-f170.google.com ([209.85.214.170]:44411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Ayf-0005sq-PK for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:51 -0500 Received: by mail-pl1-f170.google.com with SMTP id r4so4423774pls.11 for ; Fri, 22 Jan 2021 20:56:49 -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=ZuNtUUuWJqekvxHjRaYPevC4YtgExki/9b72IU/Xt8A=; b=sgIal8pO0h93xfoTEx9y0ewNvXVjn9MGD3Agp0faCwPfP7/PLu2C8VXTcyItsDvw+h Ed55+ssTRDqTaVW09fopZa3JqTY/8qQRxxCCHvcmaP2ZRaD5oBbx3oz64zABft6kqN4M vqcndhGWckeA/0U94i/dKCMZdJfvXc9YjzE6rRIMaoSyXaDyQhUFu5azNgL4IxyH9ZRd FmLRfH7MjbZx0Y11UNvIoWE65G4vPwaowLPDM+HNINtxxQzqka5EiADexXnenxJhl7qf c3dFAUPSInt3lro4PZA6vhjy9eNqKqzKzN5WapRbaXtzL38NkCbRhcgfum4DMBnqvj2O LUuA== X-Gm-Message-State: AOAM530w8vnVRCFfaEm+6TpPewYoyLLMjBIMNRJrUio7ZUDph17bN/CF ssEZl0h9143Tv27s5aOpiSJdMlw5/h4= X-Google-Smtp-Source: ABdhPJzZRUhwZylnjFiAwpQk0BvbdmjqulMndOhTx/sqtLPylmLkeUSCYRSVmhvCfl1vMpQ3PAeFAg== X-Received: by 2002:a17:902:d20e:b029:df:de2c:58f1 with SMTP id t14-20020a170902d20eb02900dfde2c58f1mr5895183ply.46.1611377808311; Fri, 22 Jan 2021 20:56:48 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:47 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 10/11] darwin: detect CoreAudio for build Date: Fri, 22 Jan 2021 20:56:31 -0800 Message-Id: <20210123045632.18482-11-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.170; envelope-from=osy86github@gmail.com; helo=mail-pl1-f170.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" On iOS there is no CoreAudio, so we should not assume Darwin always has it. Signed-off-by: Joelle van Dyne --- configure | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/configure b/configure index b8ae4609fd..70061e195d 100755 --- a/configure +++ b/configure @@ -319,6 +319,7 @@ fdt="auto" netmap="no" sdl="auto" sdl_image="auto" +coreaudio="auto" virtiofsd="auto" virtfs="auto" libudev="auto" @@ -779,7 +780,7 @@ Darwin) QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS" fi - audio_drv_list="coreaudio try-sdl" + audio_drv_list="try-coreaudio try-sdl" audio_possible_drivers="coreaudio sdl" # Disable attempts to use ObjectiveC features in os/object.h since they # won't work when we're compiling with gcc as a C compiler. @@ -3162,6 +3163,24 @@ EOF fi fi +########################################## +# detect CoreAudio +if test "$coreaudio" != "no" ; then + coreaudio_libs="-framework CoreAudio" + cat > $TMPC << EOF +#include +int main(void) +{ + return (int)AudioGetCurrentHostTime(); +} +EOF + if compile_prog "" "$coreaudio_libs" ; then + coreaudio=yes + else + coreaudio=no + fi +fi + ########################################## # Sound support libraries probe @@ -3218,8 +3237,20 @@ for drv in $audio_drv_list; do fi ;; - coreaudio) + coreaudio | try-coreaudio) + if test "$coreaudio" = "no"; then + if test "$drv" = "try-coreaudio"; then + audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-coreaudio//') + else + error_exit "$drv check failed" \ + "Make sure to have the $drv is available." + fi + else coreaudio_libs="-framework CoreAudio" + if test "$drv" = "try-coreaudio"; then + audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-coreaudio/coreaudio/') + fi + fi ;; dsound) From patchwork Sat Jan 23 04:56:32 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: 1430649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DN3v32XC8z9sS8 for ; Sat, 23 Jan 2021 16:03:59 +1100 (AEDT) Received: from localhost ([::1]:47780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3B5Z-0008OG-8w for incoming@patchwork.ozlabs.org; Sat, 23 Jan 2021 00:03:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Ayj-000707-10 for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:54 -0500 Received: from mail-pg1-f177.google.com ([209.85.215.177]:39478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Ayg-0005tZ-U4 for qemu-devel@nongnu.org; Fri, 22 Jan 2021 23:56:52 -0500 Received: by mail-pg1-f177.google.com with SMTP id 30so5232183pgr.6 for ; Fri, 22 Jan 2021 20:56:50 -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=yNEuNZPYpq9HLfo3nTTNg6MewMBOzTowV7vrFo97HmQ=; b=ncyriNY7ybrqDj2uyitXoi8JBqSCiykKqI2h9IUTqwQ2Zi0BITLhYHA5WV14qzfsLh VBMCnUrcYHZq0GpZiMWTCK7TGn88RibWGzsWSsXnq5QtkuYreN3zVT6Cggp74OkzIHge jMBf7GJCQPpZCxuaHMQWVxaWO4UfGZsQ/MmYN117kNoKL0p1TPJhBRI8rvC829r7skcy NImVefNcs9gaoIaTISSOZY/vO/obfdF4WgVEHY06bNSpujY7w6MJkaHs5jc2s6J/yJk0 +yyU6GCJ+y/zqLy1D+L9HL9TncaxrbTZ9Q3hBRnVkrAHkxtDoLWgKDA12oOk8Xi9BNiD 8Rsg== X-Gm-Message-State: AOAM533BwcTGWn3Bkgtcbw0BcYi9sqIZCWdwUSTLwkhRcN5SF2/l6yao 3H2q/uR7gbsu/1U80CqiTe4Ealu5ZLw= X-Google-Smtp-Source: ABdhPJw+JEz15A9wpa23SpRpq3aOftGAJwUx04xb1Ejx7RXnLSCaigMVG/Bep3LAdc4CQo8Q0jcMhg== X-Received: by 2002:a63:4966:: with SMTP id y38mr7967178pgk.428.1611377809370; Fri, 22 Jan 2021 20:56:49 -0800 (PST) Received: from localhost.localdomain ([73.93.154.229]) by smtp.gmail.com with ESMTPSA id c62sm9872772pfa.116.2021.01.22.20.56.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 20:56:49 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v8 11/11] darwin: remove 64-bit build detection on 32-bit OS Date: Fri, 22 Jan 2021 20:56:32 -0800 Message-Id: <20210123045632.18482-12-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210123045632.18482-1-j@getutm.app> References: <20210123045632.18482-1-j@getutm.app> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.177; envelope-from=osy86github@gmail.com; helo=mail-pg1-f177.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: Peter Maydell , Joelle van Dyne Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" A workaround added in early days of 64-bit OSX forced x86_64 if the host machine had 64-bit support. This creates issues when cross- compiling for ARM64. Additionally, the user can always use --cpu=* to manually set the host CPU and therefore this workaround should be removed. Reviewed-by: Peter Maydell Signed-off-by: Joelle van Dyne --- configure | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/configure b/configure index 70061e195d..5f23f5b907 100755 --- a/configure +++ b/configure @@ -626,13 +626,6 @@ fi # the correct CPU with the --cpu option. case $targetos in Darwin) - # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can - # run 64-bit userspace code. - # If the user didn't specify a CPU explicitly and the kernel says this is - # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. - if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then - cpu="x86_64" - fi HOST_DSOSUF=".dylib" ;; SunOS) @@ -776,10 +769,6 @@ OpenBSD) Darwin) bsd="yes" darwin="yes" - if [ "$cpu" = "x86_64" ] ; then - QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" - QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS" - fi audio_drv_list="try-coreaudio try-sdl" audio_possible_drivers="coreaudio sdl" # Disable attempts to use ObjectiveC features in os/object.h since they