ソースを参照

Allow overriding the location of Samba's smbd.

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>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Brad 14 年 前
コミット
6a10ccca80
4 ファイル変更13 行追加9 行削除
  1. 9 0
      configure
  2. 0 5
      net.h
  3. 1 1
      net/slirp.c
  4. 3 3
      qemu-options.hx

+ 9 - 0
configure

@@ -409,6 +409,7 @@ SunOS)
   make="${MAKE-gmake}"
   make="${MAKE-gmake}"
   install="${INSTALL-ginstall}"
   install="${INSTALL-ginstall}"
   ld="gld"
   ld="gld"
+  smbd="${SMBD-/usr/sfw/sbin/smbd}"
   needs_libsunmath="no"
   needs_libsunmath="no"
   solarisrev=`uname -r | cut -f2 -d.`
   solarisrev=`uname -r | cut -f2 -d.`
   # have to select again, because `uname -m` returns i86pc
   # have to select again, because `uname -m` returns i86pc
@@ -477,6 +478,7 @@ fi
 : ${make=${MAKE-make}}
 : ${make=${MAKE-make}}
 : ${install=${INSTALL-install}}
 : ${install=${INSTALL-install}}
 : ${python=${PYTHON-python}}
 : ${python=${PYTHON-python}}
+: ${smbd=${SMBD-/usr/sbin/smbd}}
 
 
 if test "$mingw32" = "yes" ; then
 if test "$mingw32" = "yes" ; then
   EXESUF=".exe"
   EXESUF=".exe"
@@ -520,6 +522,8 @@ for opt do
   ;;
   ;;
   --python=*) python="$optarg"
   --python=*) python="$optarg"
   ;;
   ;;
+  --smbd=*) smbd="$optarg"
+  ;;
   --extra-cflags=*)
   --extra-cflags=*)
   ;;
   ;;
   --extra-ldflags=*)
   --extra-ldflags=*)
@@ -932,6 +936,7 @@ echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
 echo "  --make=MAKE              use specified make [$make]"
 echo "  --make=MAKE              use specified make [$make]"
 echo "  --install=INSTALL        use specified install [$install]"
 echo "  --install=INSTALL        use specified install [$install]"
 echo "  --python=PYTHON          use specified python [$python]"
 echo "  --python=PYTHON          use specified python [$python]"
+echo "  --smbd=SMBD              use specified smbd [$smbd]"
 echo "  --static                 enable static build [$static]"
 echo "  --static                 enable static build [$static]"
 echo "  --mandir=PATH            install man pages in PATH"
 echo "  --mandir=PATH            install man pages in PATH"
 echo "  --datadir=PATH           install firmware in PATH"
 echo "  --datadir=PATH           install firmware in PATH"
@@ -2638,6 +2643,9 @@ echo "LDFLAGS           $LDFLAGS"
 echo "make              $make"
 echo "make              $make"
 echo "install           $install"
 echo "install           $install"
 echo "python            $python"
 echo "python            $python"
+if test "$slirp" = "yes" ; then
+    echo "smbd              $smbd"
+fi
 echo "host CPU          $cpu"
 echo "host CPU          $cpu"
 echo "host big endian   $bigendian"
 echo "host big endian   $bigendian"
 echo "target list       $target_list"
 echo "target list       $target_list"
@@ -2796,6 +2804,7 @@ if test $profiler = "yes" ; then
 fi
 fi
 if test "$slirp" = "yes" ; then
 if test "$slirp" = "yes" ; then
   echo "CONFIG_SLIRP=y" >> $config_host_mak
   echo "CONFIG_SLIRP=y" >> $config_host_mak
+  echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
   QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
   QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
 fi
 fi
 if test "$vde" = "yes" ; then
 if test "$vde" = "yes" ; then

+ 0 - 5
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_SCRIPT "/etc/qemu-ifup"
 #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
 #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);
 void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
 
 

+ 1 - 1
net/slirp.c

@@ -529,7 +529,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
     fclose(f);
     fclose(f);
 
 
     snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s",
     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) {
     if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) {
         slirp_smb_cleanup(s);
         slirp_smb_cleanup(s);

+ 3 - 3
qemu-options.hx

@@ -1256,9 +1256,9 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
 
 
 Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
 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}
 @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
 Redirect incoming TCP or UDP connections to the host port @var{hostport} to