All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd.
@ 2011-08-29  4:49 Brad
  2011-08-30 17:52 ` Blue Swirl
  2011-08-30 20:28 ` Brad
  0 siblings, 2 replies; 6+ messages in thread
From: Brad @ 2011-08-29  4:49 UTC (permalink / raw)
  To: qemu-devel

Allow overriding the location of Samba's smbd.

Pretty much every OS I look at has some means of
changing this path (patching) so lets just make
it easier for OS developers creating packages
and/or end users to override the location.

Signed-off-by: Brad Smith <brad@comstyle.com>

---
 Makefile.objs   |    2 ++
 configure       |    7 +++++++
 net.h           |    5 -----
 qemu-options.hx |    6 +++---
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index d1f3e5d..62c03f9 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -166,6 +166,8 @@ slirp-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
 slirp-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o arp_table.o
 common-obj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y))
 
+net/slirp.o: QEMU_CFLAGS += -DSMBD_COMMAND=\"${SMBD}\"
+
 # xen backend driver support
 common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
 common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
diff --git a/configure b/configure
index ad60ea0..4795d05 100755
--- a/configure
+++ b/configure
@@ -413,6 +413,7 @@ SunOS)
   make="${MAKE-gmake}"
   install="${INSTALL-ginstall}"
   ld="gld"
+  smbd="${SMBD-/usr/sfw/sbin/smbd}"
   needs_libsunmath="no"
   solarisrev=`uname -r | cut -f2 -d.`
   # have to select again, because `uname -m` returns i86pc
@@ -481,6 +482,7 @@ fi
 : ${make=${MAKE-make}}
 : ${install=${INSTALL-install}}
 : ${python=${PYTHON-python}}
+: ${smbd=${SMBD-/usr/sbin/smbd}}
 
 if test "$mingw32" = "yes" ; then
   EXESUF=".exe"
@@ -525,6 +527,8 @@ for opt do
   ;;
   --python=*) python="$optarg"
   ;;
+  --smbd=*) smbd="$optarg"
+  ;;
   --extra-cflags=*)
   ;;
   --extra-ldflags=*)
@@ -941,6 +945,7 @@ echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
 echo "  --make=MAKE              use specified make [$make]"
 echo "  --install=INSTALL        use specified install [$install]"
 echo "  --python=PYTHON          use specified python [$python]"
+echo "  --smbd=SMBD              use specified smbd [$smbd]"
 echo "  --static                 enable static build [$static]"
 echo "  --mandir=PATH            install man pages in PATH"
 echo "  --datadir=PATH           install firmware in PATH"
@@ -2666,6 +2671,7 @@ echo "LDFLAGS           $LDFLAGS"
 echo "make              $make"
 echo "install           $install"
 echo "python            $python"
+echo "smbd              $smbd"
 echo "host CPU          $cpu"
 echo "host big endian   $bigendian"
 echo "target list       $target_list"
@@ -3093,6 +3099,7 @@ echo "OBJCOPY=$objcopy" >> $config_host_mak
 echo "LD=$ld" >> $config_host_mak
 echo "WINDRES=$windres" >> $config_host_mak
 echo "LIBTOOL=$libtool" >> $config_host_mak
+echo "SMBD=$smbd" >> $config_host_mak
 echo "CFLAGS=$CFLAGS" >> $config_host_mak
 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
 echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
diff --git a/net.h b/net.h
index 5a7881c..9f633f8 100644
--- a/net.h
+++ b/net.h
@@ -174,11 +174,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
 
 #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
 #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
-#ifdef __sun__
-#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
-#else
-#define SMBD_COMMAND "/usr/sbin/smbd"
-#endif
 
 void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
 
diff --git a/qemu-options.hx b/qemu-options.hx
index d86815d..1db76f1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1273,9 +1273,9 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
 
 Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
 
-Note that a SAMBA server must be installed on the host OS in
-@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from
-Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
+Note that a SAMBA server must be installed on the host OS.
+QEMU was tested successfully with smbd versions from Red Hat 9,
+Fedora Core 3 and OpenSUSE 11.x.
 
 @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
 Redirect incoming TCP or UDP connections to the host port @var{hostport} to
-- 
1.7.6


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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

* Re: [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd.
  2011-08-29  4:49 [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd Brad
@ 2011-08-30 17:52 ` Blue Swirl
  2011-08-30 20:28 ` Brad
  1 sibling, 0 replies; 6+ messages in thread
From: Blue Swirl @ 2011-08-30 17:52 UTC (permalink / raw)
  To: Brad; +Cc: qemu-devel

On Mon, Aug 29, 2011 at 4:49 AM, Brad <brad@comstyle.com> wrote:
> Allow overriding the location of Samba's smbd.
>
> Pretty much every OS I look at has some means of
> changing this path (patching) so lets just make
> it easier for OS developers creating packages
> and/or end users to override the location.
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
>
> ---
>  Makefile.objs   |    2 ++
>  configure       |    7 +++++++
>  net.h           |    5 -----
>  qemu-options.hx |    6 +++---
>  4 files changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/Makefile.objs b/Makefile.objs
> index d1f3e5d..62c03f9 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -166,6 +166,8 @@ slirp-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
>  slirp-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o arp_table.o
>  common-obj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y))
>
> +net/slirp.o: QEMU_CFLAGS += -DSMBD_COMMAND=\"${SMBD}\"

Instead of -D, please put the command to config-host.h as something
like CONFIG_SMBD_COMMAND. That requires also a small change to
slirp.c.

> +
>  # xen backend driver support
>  common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
>  common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
> diff --git a/configure b/configure
> index ad60ea0..4795d05 100755
> --- a/configure
> +++ b/configure
> @@ -413,6 +413,7 @@ SunOS)
>   make="${MAKE-gmake}"
>   install="${INSTALL-ginstall}"
>   ld="gld"
> +  smbd="${SMBD-/usr/sfw/sbin/smbd}"
>   needs_libsunmath="no"
>   solarisrev=`uname -r | cut -f2 -d.`
>   # have to select again, because `uname -m` returns i86pc
> @@ -481,6 +482,7 @@ fi
>  : ${make=${MAKE-make}}
>  : ${install=${INSTALL-install}}
>  : ${python=${PYTHON-python}}
> +: ${smbd=${SMBD-/usr/sbin/smbd}}
>
>  if test "$mingw32" = "yes" ; then
>   EXESUF=".exe"
> @@ -525,6 +527,8 @@ for opt do
>   ;;
>   --python=*) python="$optarg"
>   ;;
> +  --smbd=*) smbd="$optarg"
> +  ;;
>   --extra-cflags=*)
>   ;;
>   --extra-ldflags=*)
> @@ -941,6 +945,7 @@ echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
>  echo "  --make=MAKE              use specified make [$make]"
>  echo "  --install=INSTALL        use specified install [$install]"
>  echo "  --python=PYTHON          use specified python [$python]"
> +echo "  --smbd=SMBD              use specified smbd [$smbd]"
>  echo "  --static                 enable static build [$static]"
>  echo "  --mandir=PATH            install man pages in PATH"
>  echo "  --datadir=PATH           install firmware in PATH"
> @@ -2666,6 +2671,7 @@ echo "LDFLAGS           $LDFLAGS"
>  echo "make              $make"
>  echo "install           $install"
>  echo "python            $python"
> +echo "smbd              $smbd"
>  echo "host CPU          $cpu"
>  echo "host big endian   $bigendian"
>  echo "target list       $target_list"
> @@ -3093,6 +3099,7 @@ echo "OBJCOPY=$objcopy" >> $config_host_mak
>  echo "LD=$ld" >> $config_host_mak
>  echo "WINDRES=$windres" >> $config_host_mak
>  echo "LIBTOOL=$libtool" >> $config_host_mak
> +echo "SMBD=$smbd" >> $config_host_mak

Then this is not needed.

>  echo "CFLAGS=$CFLAGS" >> $config_host_mak
>  echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
>  echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
> diff --git a/net.h b/net.h
> index 5a7881c..9f633f8 100644
> --- a/net.h
> +++ b/net.h
> @@ -174,11 +174,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
>
>  #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
>  #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
> -#ifdef __sun__
> -#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
> -#else
> -#define SMBD_COMMAND "/usr/sbin/smbd"
> -#endif
>
>  void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
>
> diff --git a/qemu-options.hx b/qemu-options.hx
> index d86815d..1db76f1 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -1273,9 +1273,9 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
>
>  Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
>
> -Note that a SAMBA server must be installed on the host OS in
> -@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from
> -Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
> +Note that a SAMBA server must be installed on the host OS.
> +QEMU was tested successfully with smbd versions from Red Hat 9,
> +Fedora Core 3 and OpenSUSE 11.x.
>
>  @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
>  Redirect incoming TCP or UDP connections to the host port @var{hostport} to
> --
> 1.7.6
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
>

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

* Re: [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd.
  2011-08-29  4:49 [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd Brad
  2011-08-30 17:52 ` Blue Swirl
@ 2011-08-30 20:28 ` Brad
  1 sibling, 0 replies; 6+ messages in thread
From: Brad @ 2011-08-30 20:28 UTC (permalink / raw)
  To: qemu-devel

An updated diff taking Blue's comments into consideration.


Allow overriding the location of Samba's smbd.

Pretty much every OS I look at has some means of
changing this path (patching) so lets just make
it easier for OS developers creating packages
and/or end users to override the location.

Signed-off-by: Brad Smith <brad@comstyle.com>

---
 configure       |    9 +++++++++
 net.h           |    5 -----
 net/slirp.c     |    2 +-
 qemu-options.hx |    6 +++---
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index ad60ea0..c669d4e 100755
--- a/configure
+++ b/configure
@@ -413,6 +413,7 @@ SunOS)
   make="${MAKE-gmake}"
   install="${INSTALL-ginstall}"
   ld="gld"
+  smbd="${SMBD-/usr/sfw/sbin/smbd}"
   needs_libsunmath="no"
   solarisrev=`uname -r | cut -f2 -d.`
   # have to select again, because `uname -m` returns i86pc
@@ -481,6 +482,7 @@ fi
 : ${make=${MAKE-make}}
 : ${install=${INSTALL-install}}
 : ${python=${PYTHON-python}}
+: ${smbd=${SMBD-/usr/sbin/smbd}}
 
 if test "$mingw32" = "yes" ; then
   EXESUF=".exe"
@@ -525,6 +527,8 @@ for opt do
   ;;
   --python=*) python="$optarg"
   ;;
+  --smbd=*) smbd="$optarg"
+  ;;
   --extra-cflags=*)
   ;;
   --extra-ldflags=*)
@@ -941,6 +945,7 @@ echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
 echo "  --make=MAKE              use specified make [$make]"
 echo "  --install=INSTALL        use specified install [$install]"
 echo "  --python=PYTHON          use specified python [$python]"
+echo "  --smbd=SMBD              use specified smbd [$smbd]"
 echo "  --static                 enable static build [$static]"
 echo "  --mandir=PATH            install man pages in PATH"
 echo "  --datadir=PATH           install firmware in PATH"
@@ -2666,6 +2671,9 @@ echo "LDFLAGS           $LDFLAGS"
 echo "make              $make"
 echo "install           $install"
 echo "python            $python"
+if test "$slirp" = "yes" ; then
+    echo "smbd              $smbd"
+fi
 echo "host CPU          $cpu"
 echo "host big endian   $bigendian"
 echo "target list       $target_list"
@@ -2825,6 +2833,7 @@ if test "$profiler" = "yes" ; then
 fi
 if test "$slirp" = "yes" ; then
   echo "CONFIG_SLIRP=y" >> $config_host_mak
+  echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
   QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
 fi
 if test "$vde" = "yes" ; then
diff --git a/net.h b/net.h
index 5a7881c..9f633f8 100644
--- a/net.h
+++ b/net.h
@@ -174,11 +174,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
 
 #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
 #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
-#ifdef __sun__
-#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
-#else
-#define SMBD_COMMAND "/usr/sbin/smbd"
-#endif
 
 void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
 
diff --git a/net/slirp.c b/net/slirp.c
index 3b39d21..c6cda5d 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -529,7 +529,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
     fclose(f);
 
     snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s",
-             SMBD_COMMAND, smb_conf);
+             CONFIG_SMBD_COMMAND, smb_conf);
 
     if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) {
         slirp_smb_cleanup(s);
diff --git a/qemu-options.hx b/qemu-options.hx
index 35d95d1..e24a740 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1277,9 +1277,9 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
 
 Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
 
-Note that a SAMBA server must be installed on the host OS in
-@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from
-Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
+Note that a SAMBA server must be installed on the host OS.
+QEMU was tested successfully with smbd versions from Red Hat 9,
+Fedora Core 3 and OpenSUSE 11.x.
 
 @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
 Redirect incoming TCP or UDP connections to the host port @var{hostport} to
-- 
1.7.6


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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

* Re: [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd.
  2011-09-02 20:53 Brad
  2011-09-03 14:04 ` Stefan Hajnoczi
@ 2011-09-03 21:12 ` Blue Swirl
  1 sibling, 0 replies; 6+ messages in thread
From: Blue Swirl @ 2011-09-03 21:12 UTC (permalink / raw)
  To: Brad; +Cc: qemu-devel

Thanks, applied.

On Fri, Sep 2, 2011 at 8:53 PM, Brad <brad@comstyle.com> wrote:
> Allow overriding the location of Samba's smbd.
>
> Pretty much every OS I look at has some means of
> changing this path (patching) so lets just make
> it easier for OS developers creating packages
> and/or end users to override the location.
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
>
> ---
>  configure       |    9 +++++++++
>  net.h           |    5 -----
>  net/slirp.c     |    2 +-
>  qemu-options.hx |    6 +++---
>  4 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/configure b/configure
> index ad60ea0..c669d4e 100755
> --- a/configure
> +++ b/configure
> @@ -413,6 +413,7 @@ SunOS)
>   make="${MAKE-gmake}"
>   install="${INSTALL-ginstall}"
>   ld="gld"
> +  smbd="${SMBD-/usr/sfw/sbin/smbd}"
>   needs_libsunmath="no"
>   solarisrev=`uname -r | cut -f2 -d.`
>   # have to select again, because `uname -m` returns i86pc
> @@ -481,6 +482,7 @@ fi
>  : ${make=${MAKE-make}}
>  : ${install=${INSTALL-install}}
>  : ${python=${PYTHON-python}}
> +: ${smbd=${SMBD-/usr/sbin/smbd}}
>
>  if test "$mingw32" = "yes" ; then
>   EXESUF=".exe"
> @@ -525,6 +527,8 @@ for opt do
>   ;;
>   --python=*) python="$optarg"
>   ;;
> +  --smbd=*) smbd="$optarg"
> +  ;;
>   --extra-cflags=*)
>   ;;
>   --extra-ldflags=*)
> @@ -941,6 +945,7 @@ echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
>  echo "  --make=MAKE              use specified make [$make]"
>  echo "  --install=INSTALL        use specified install [$install]"
>  echo "  --python=PYTHON          use specified python [$python]"
> +echo "  --smbd=SMBD              use specified smbd [$smbd]"
>  echo "  --static                 enable static build [$static]"
>  echo "  --mandir=PATH            install man pages in PATH"
>  echo "  --datadir=PATH           install firmware in PATH"
> @@ -2666,6 +2671,9 @@ echo "LDFLAGS           $LDFLAGS"
>  echo "make              $make"
>  echo "install           $install"
>  echo "python            $python"
> +if test "$slirp" = "yes" ; then
> +    echo "smbd              $smbd"
> +fi
>  echo "host CPU          $cpu"
>  echo "host big endian   $bigendian"
>  echo "target list       $target_list"
> @@ -2825,6 +2833,7 @@ if test "$profiler" = "yes" ; then
>  fi
>  if test "$slirp" = "yes" ; then
>   echo "CONFIG_SLIRP=y" >> $config_host_mak
> +  echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
>   QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
>  fi
>  if test "$vde" = "yes" ; then
> diff --git a/net.h b/net.h
> index 5a7881c..9f633f8 100644
> --- a/net.h
> +++ b/net.h
> @@ -174,11 +174,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
>
>  #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
>  #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
> -#ifdef __sun__
> -#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
> -#else
> -#define SMBD_COMMAND "/usr/sbin/smbd"
> -#endif
>
>  void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
>
> diff --git a/net/slirp.c b/net/slirp.c
> index 3b39d21..c6cda5d 100644
> --- a/net/slirp.c
> +++ b/net/slirp.c
> @@ -529,7 +529,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
>     fclose(f);
>
>     snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s",
> -             SMBD_COMMAND, smb_conf);
> +             CONFIG_SMBD_COMMAND, smb_conf);
>
>     if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) {
>         slirp_smb_cleanup(s);
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 35d95d1..e24a740 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -1277,9 +1277,9 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
>
>  Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
>
> -Note that a SAMBA server must be installed on the host OS in
> -@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from
> -Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
> +Note that a SAMBA server must be installed on the host OS.
> +QEMU was tested successfully with smbd versions from Red Hat 9,
> +Fedora Core 3 and OpenSUSE 11.x.
>
>  @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
>  Redirect incoming TCP or UDP connections to the host port @var{hostport} to
> --
> 1.7.6
>
>
>

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

* Re: [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd.
  2011-09-02 20:53 Brad
@ 2011-09-03 14:04 ` Stefan Hajnoczi
  2011-09-03 21:12 ` Blue Swirl
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2011-09-03 14:04 UTC (permalink / raw)
  To: Brad; +Cc: qemu-devel

On Fri, Sep 2, 2011 at 9:53 PM, Brad <brad@comstyle.com> wrote:
> Allow overriding the location of Samba's smbd.
>
> Pretty much every OS I look at has some means of
> changing this path (patching) so lets just make
> it easier for OS developers creating packages
> and/or end users to override the location.
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
>
> ---
>  configure       |    9 +++++++++
>  net.h           |    5 -----
>  net/slirp.c     |    2 +-
>  qemu-options.hx |    6 +++---
>  4 files changed, 13 insertions(+), 9 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

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

* [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd.
@ 2011-09-02 20:53 Brad
  2011-09-03 14:04 ` Stefan Hajnoczi
  2011-09-03 21:12 ` Blue Swirl
  0 siblings, 2 replies; 6+ messages in thread
From: Brad @ 2011-09-02 20:53 UTC (permalink / raw)
  To: qemu-devel

Allow overriding the location of Samba's smbd.

Pretty much every OS I look at has some means of
changing this path (patching) so lets just make
it easier for OS developers creating packages
and/or end users to override the location.

Signed-off-by: Brad Smith <brad@comstyle.com>

---
 configure       |    9 +++++++++
 net.h           |    5 -----
 net/slirp.c     |    2 +-
 qemu-options.hx |    6 +++---
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index ad60ea0..c669d4e 100755
--- a/configure
+++ b/configure
@@ -413,6 +413,7 @@ SunOS)
   make="${MAKE-gmake}"
   install="${INSTALL-ginstall}"
   ld="gld"
+  smbd="${SMBD-/usr/sfw/sbin/smbd}"
   needs_libsunmath="no"
   solarisrev=`uname -r | cut -f2 -d.`
   # have to select again, because `uname -m` returns i86pc
@@ -481,6 +482,7 @@ fi
 : ${make=${MAKE-make}}
 : ${install=${INSTALL-install}}
 : ${python=${PYTHON-python}}
+: ${smbd=${SMBD-/usr/sbin/smbd}}
 
 if test "$mingw32" = "yes" ; then
   EXESUF=".exe"
@@ -525,6 +527,8 @@ for opt do
   ;;
   --python=*) python="$optarg"
   ;;
+  --smbd=*) smbd="$optarg"
+  ;;
   --extra-cflags=*)
   ;;
   --extra-ldflags=*)
@@ -941,6 +945,7 @@ echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
 echo "  --make=MAKE              use specified make [$make]"
 echo "  --install=INSTALL        use specified install [$install]"
 echo "  --python=PYTHON          use specified python [$python]"
+echo "  --smbd=SMBD              use specified smbd [$smbd]"
 echo "  --static                 enable static build [$static]"
 echo "  --mandir=PATH            install man pages in PATH"
 echo "  --datadir=PATH           install firmware in PATH"
@@ -2666,6 +2671,9 @@ echo "LDFLAGS           $LDFLAGS"
 echo "make              $make"
 echo "install           $install"
 echo "python            $python"
+if test "$slirp" = "yes" ; then
+    echo "smbd              $smbd"
+fi
 echo "host CPU          $cpu"
 echo "host big endian   $bigendian"
 echo "target list       $target_list"
@@ -2825,6 +2833,7 @@ if test "$profiler" = "yes" ; then
 fi
 if test "$slirp" = "yes" ; then
   echo "CONFIG_SLIRP=y" >> $config_host_mak
+  echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
   QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
 fi
 if test "$vde" = "yes" ; then
diff --git a/net.h b/net.h
index 5a7881c..9f633f8 100644
--- a/net.h
+++ b/net.h
@@ -174,11 +174,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
 
 #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
 #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
-#ifdef __sun__
-#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
-#else
-#define SMBD_COMMAND "/usr/sbin/smbd"
-#endif
 
 void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
 
diff --git a/net/slirp.c b/net/slirp.c
index 3b39d21..c6cda5d 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -529,7 +529,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
     fclose(f);
 
     snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s",
-             SMBD_COMMAND, smb_conf);
+             CONFIG_SMBD_COMMAND, smb_conf);
 
     if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) {
         slirp_smb_cleanup(s);
diff --git a/qemu-options.hx b/qemu-options.hx
index 35d95d1..e24a740 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1277,9 +1277,9 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
 
 Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
 
-Note that a SAMBA server must be installed on the host OS in
-@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from
-Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
+Note that a SAMBA server must be installed on the host OS.
+QEMU was tested successfully with smbd versions from Red Hat 9,
+Fedora Core 3 and OpenSUSE 11.x.
 
 @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
 Redirect incoming TCP or UDP connections to the host port @var{hostport} to
-- 
1.7.6

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

end of thread, other threads:[~2011-09-03 21:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-29  4:49 [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd Brad
2011-08-30 17:52 ` Blue Swirl
2011-08-30 20:28 ` Brad
2011-09-02 20:53 Brad
2011-09-03 14:04 ` Stefan Hajnoczi
2011-09-03 21:12 ` Blue Swirl

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.