From nobody Mon Feb 9 05:29:34 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 ARC-Seal: i=1; a=rsa-sha256; t=1619861570; cv=none; d=zohomail.com; s=zohoarc; b=TZ3WDwiGG0VAPB7DNQY+YOO6QMzaEqL1SU1d/QrntkXo7Y9BvfhTst4LKa8Jt4iGCjpjxiGLmzeWPlDTV/H3L23uW0tsUtV7jyQJF3GFaIl7giic5DYp9T01dpmBExrE0y1wlV0/8Mo3fEQJrL35lv50smTH2NtefvuKmkSlc9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619861570; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L9PXy0iMaEYQMrwCKAeGdUKr08wU5yIXqMSKYA5860o=; b=cSg2vIsnL4/LFBTt43vJTHKxABPYf7Zz6luZA9ywA4lTnOp5+/tw5AwJyaP1oKDf+3PeCIf/HSX/9uYx3DMmFGmpTncmOCwBNpyTX9d92v3Fjr0HZzm1rbzrR3MBEn42QEN5NP8n6n/nrfFqjyfbVfCWR6nvdLN5t9BKNkgNSgw= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619861570648524.8232730466423; Sat, 1 May 2021 02:32:50 -0700 (PDT) Received: from localhost ([::1]:53686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lclzV-0002Fr-FF for importer@patchew.org; Sat, 01 May 2021 05:32:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lclxQ-0000X0-M3 for qemu-devel@nongnu.org; Sat, 01 May 2021 05:30:40 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:42931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lclxM-0005XJ-WC for qemu-devel@nongnu.org; Sat, 01 May 2021 05:30:38 -0400 Received: by mail-ed1-x52c.google.com with SMTP id j28so802619edy.9 for ; Sat, 01 May 2021 02:30:36 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id ga33sm4632721ejc.11.2021.05.01.02.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 02:30:35 -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=L9PXy0iMaEYQMrwCKAeGdUKr08wU5yIXqMSKYA5860o=; b=B2PIv/tzp7fyBzt7RUnqeVe8QmfWR2f6+R6l7dqA63Sif3wGlmFhPQk7NIiQu0SHsX Y2yOCnC4YxQPcHG/2WHoLLY39GaUx+alWr4ciHlzF/8QXer7SgPBQNwQkphSGrFHC1Mt mtB8IXsrKP15R+nIQE/ksN1ZqqeT/XD9Kq7h2vwZgPw1QRWbVLqFLxjyNz8Vnl6nzCup T8Pau3zaDppJXC5BFVwSR0HPtly5j0Ih5LaMVQZ7ICC5+pTYWO49NOaXkQ2FmbVFRaIb M0p21yJfHjL8gfZgqWXYIyrl3Lhs4yLcMPv1m+ItvyoYeOs7L16dWaRkT4sxdpispX55 rD7w== 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=L9PXy0iMaEYQMrwCKAeGdUKr08wU5yIXqMSKYA5860o=; b=naJVVRx2A3GURsNd0GwfPixsUxKRUjRbcNwjbpYVQEs+VZLVB4r7jKl/ttUH81oFMH hz/a4D0K0wYCbDoa6XRa+22+AyBgZonzsXleTXlzDLCQu37UcXCJiAYEKi2mAzmsn5Ta deBaZqBozwYgNMV/bSEVWN+VMNun3VEBZFGGwNpddt5znzMc6J/kqa09fG8rjfzEAaRF j61I87yHPLXJ6jCReomGr/H7+SQfnJmJDKg380TZlj6J7zw5DV7m2E81WggTS9oegZdm QKT2sfowVXSJYJbIfVHz6nfcV0H7acWmR0CbU4aTI10oRfrQsomkxuLIP9RsG5E5Og8a fyKw== X-Gm-Message-State: AOAM532faA1Zduq+NPoyiqXeDD8al0//gLTw+6RHs2j/un1EXfK9f9/b gkQ5RobnDRCmr6tuIrGcedw9GUULd9A= X-Google-Smtp-Source: ABdhPJyElUG0hlsdciXLrKVecbv4W4rTVZgx40/3OwJe2ANFb1jEv/ImYNR52Vd+e8iO0Ipg35GIQA== X-Received: by 2002:a05:6402:254a:: with SMTP id l10mr10561337edb.145.1619861435806; Sat, 01 May 2021 02:30:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/10] slirp: add configure option to disable smbd Date: Sat, 1 May 2021 11:30:23 +0200 Message-Id: <20210501093026.189429-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210501093026.189429-1-pbonzini@redhat.com> References: <20210501093026.189429-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::52c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52c.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.249, 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: Samuel Thibault , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Joelle van Dyne Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Joelle van Dyne Replace Windows specific macro with a more generic feature detection macro. Allows slirp smb feature to be disabled manually as well. Acked-by: Samuel Thibault Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Joelle van Dyne Message-Id: <20210315180341.31638-5-j@getutm.app> [Use $default_feature as the default. - Paolo] Signed-off-by: Paolo Bonzini --- configure | 26 +++++++++++++++++++++++--- meson.build | 2 +- net/slirp.c | 16 ++++++++-------- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 268460d63d..ccc58ccc46 100755 --- a/configure +++ b/configure @@ -464,6 +464,7 @@ gettext=3D"auto" fuse=3D"auto" fuse_lseek=3D"auto" multiprocess=3D"auto" +slirp_smbd=3D"$default_feature" =20 malloc_trim=3D"auto" gio=3D"$default_feature" @@ -836,8 +837,6 @@ do fi done =20 -: ${smbd=3D${SMBD-/usr/sbin/smbd}} - # Default objcc to clang if available, otherwise use CC if has clang; then objcc=3Dclang @@ -1570,6 +1569,10 @@ for opt do ;; --disable-gio) gio=3Dno ;; + --enable-slirp-smbd) slirp_smbd=3Dyes + ;; + --disable-slirp-smbd) slirp_smbd=3Dno + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1925,6 +1928,7 @@ disabled with --disable-FEATURE, default is enabled i= f available fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE exports multiprocess Out of process device emulation support gio libgio support + slirp-smbd use smbd (at path --smbd=3D*) in slirp networking =20 NOTE: The object files are built at the place where configure is launched EOF @@ -5261,6 +5265,19 @@ case "$slirp" in ;; esac =20 +# Check for slirp smbd dupport +: ${smbd=3D${SMBD-/usr/sbin/smbd}} +if test "$slirp_smbd" !=3D "no" ; then + if test "$mingw32" =3D "yes" ; then + if test "$slirp_smbd" =3D "yes" ; then + error_exit "Host smbd not supported on this platform." + fi + slirp_smbd=3Dno + else + slirp_smbd=3Dyes + fi +fi + ########################################## # check for usable __NR_keyctl syscall =20 @@ -5536,7 +5553,10 @@ fi if test "$guest_agent" =3D "yes" ; then echo "CONFIG_GUEST_AGENT=3Dy" >> $config_host_mak fi -echo "CONFIG_SMBD_COMMAND=3D\"$smbd\"" >> $config_host_mak +if test "$slirp_smbd" =3D "yes" ; then + echo "CONFIG_SLIRP_SMBD=3Dy" >> $config_host_mak + echo "CONFIG_SMBD_COMMAND=3D\"$smbd\"" >> $config_host_mak +fi if test "$vde" =3D "yes" ; then echo "CONFIG_VDE=3Dy" >> $config_host_mak echo "VDE_LIBS=3D$vde_libs" >> $config_host_mak diff --git a/meson.build b/meson.build index 14dd3fe068..cf0bcf6b53 100644 --- a/meson.build +++ b/meson.build @@ -2464,7 +2464,7 @@ summary_info +=3D {'genisoimage': config_host['= GENISOIMAGE']} if targetos =3D=3D 'windows' and config_host.has_key('CONFIG_GUEST_AGENT') summary_info +=3D {'wixl': wixl.found() ? wixl.full_path() : = false} endif -if slirp_opt !=3D 'disabled' +if slirp_opt !=3D 'disabled' and 'CONFIG_SLIRP_SMBD' in config_host summary_info +=3D {'smbd': config_host['CONFIG_SMBD_COMMAND']} endif summary(summary_info, bool_yn: true, section: 'Host binaries') diff --git a/net/slirp.c b/net/slirp.c index a01a0fccd3..1d9cb3bd6b 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -27,7 +27,7 @@ #include "net/slirp.h" =20 =20 -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) #include #include #endif @@ -91,7 +91,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; @@ -104,7 +104,7 @@ static QTAILQ_HEAD(, SlirpState) slirp_stacks =3D static int slirp_hostfwd(SlirpState *s, const char *redir_str, Error **err= p); static int slirp_guestfwd(SlirpState *s, const char *config_str, Error **e= rrp); =20 -#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); @@ -377,7 +377,7 @@ static int net_slirp_init(NetClientState *peer, const c= har *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 =3D { .s_addr =3D 0 }; #endif NetClientState *nc; @@ -487,7 +487,7 @@ static int net_slirp_init(NetClientState *peer, const c= har *model, return -1; } =20 -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) if (vsmbserver && !inet_aton(vsmbserver, &smbsrv)) { error_setg(errp, "Failed to parse SMB address"); return -1; @@ -602,7 +602,7 @@ static int net_slirp_init(NetClientState *peer, const c= har *model, } } } -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) if (smb_export) { if (slirp_smb(s, smb_export, smbsrv, errp) < 0) { goto error; @@ -794,7 +794,7 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict) =20 } =20 -#ifndef _WIN32 +#if defined(CONFIG_SLIRP_SMBD) =20 /* automatic user mode samba server configuration */ static void slirp_smb_cleanup(SlirpState *s) @@ -909,7 +909,7 @@ static int slirp_smb(SlirpState* s, const char *exporte= d_dir, return 0; } =20 -#endif /* !defined(_WIN32) */ +#endif /* defined(CONFIG_SLIRP_SMBD) */ =20 static int guestfwd_can_read(void *opaque) { --=20 2.31.1