All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v9 04/11] slirp: feature detection for smbd
@ 2021-02-24 23:22 Programmingkid
  0 siblings, 0 replies; 4+ messages in thread
From: Programmingkid @ 2021-02-24 23:22 UTC (permalink / raw)
  To: j; +Cc: QEMU devel list

I've noticed that my guests like Windows XP and Mac OS 10.4 cannot access the internet using the recent versions of QEMU on Mac OS 11. I'm on an M1 Mac. Does your patchset enable guests to be able to access the internet?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v9 04/11] slirp: feature detection for smbd
  2021-01-26  7:30   ` Philippe Mathieu-Daudé
@ 2021-01-28 20:33     ` Joelle van Dyne
  0 siblings, 0 replies; 4+ messages in thread
From: Joelle van Dyne @ 2021-01-28 20:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Samuel Thibault, Jason Wang, Joelle van Dyne, QEMU Developers

On Mon, Jan 25, 2021 at 11:30 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> On 1/26/21 2:24 AM, Joelle van Dyne wrote:
> > 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 <j@getutm.app>
> > ---
> >  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
>
> Here slirp_smbd is always "auto".
>
> > +  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
>
> So this check ...
>
> >
> >  # 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
> > +  ;;
> >    *)
>
> ... should be placed after the cmdline options processing,
> isn't it?

That's right, good catch.
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v9 04/11] slirp: feature detection for smbd
  2021-01-26  1:24 ` [PATCH v9 04/11] slirp: feature detection for smbd Joelle van Dyne
@ 2021-01-26  7:30   ` Philippe Mathieu-Daudé
  2021-01-28 20:33     ` Joelle van Dyne
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-26  7:30 UTC (permalink / raw)
  To: Joelle van Dyne, qemu-devel; +Cc: Samuel Thibault, Jason Wang

On 1/26/21 2:24 AM, Joelle van Dyne wrote:
> 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 <j@getutm.app>
> ---
>  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

Here slirp_smbd is always "auto".

> +  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

So this check ...

>  
>  # 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
> +  ;;
>    *)

... should be placed after the cmdline options processing,
isn't it?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v9 04/11] slirp: feature detection for smbd
  2021-01-26  1:24 [PATCH v9 00/11] iOS and Apple Silicon host support Joelle van Dyne
@ 2021-01-26  1:24 ` Joelle van Dyne
  2021-01-26  7:30   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 4+ messages in thread
From: Joelle van Dyne @ 2021-01-26  1:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: Samuel Thibault, Jason Wang, Joelle van Dyne

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 <j@getutm.app>
---
 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 <pwd.h>
 #include <sys/wait.h>
 #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)
 {
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-24 23:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 23:22 [PATCH v9 04/11] slirp: feature detection for smbd Programmingkid
  -- strict thread matches above, loose matches on Subject: below --
2021-01-26  1:24 [PATCH v9 00/11] iOS and Apple Silicon host support Joelle van Dyne
2021-01-26  1:24 ` [PATCH v9 04/11] slirp: feature detection for smbd Joelle van Dyne
2021-01-26  7:30   ` Philippe Mathieu-Daudé
2021-01-28 20:33     ` Joelle van Dyne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.