From patchwork Tue Aug 30 20:28:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Smith X-Patchwork-Id: 112382 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5B1D8B6F86 for ; Wed, 31 Aug 2011 06:29:12 +1000 (EST) Received: from localhost ([::1]:52856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyUvl-0008Ot-Am for incoming@patchwork.ozlabs.org; Tue, 30 Aug 2011 16:29:09 -0400 Received: from eggs.gnu.org ([140.186.70.92]:40029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyUvf-0008Oj-HX for qemu-devel@nongnu.org; Tue, 30 Aug 2011 16:29:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyUve-0004Rg-3Y for qemu-devel@nongnu.org; Tue, 30 Aug 2011 16:29:03 -0400 Received: from speedy.comstyle.com ([206.51.28.2]:22094 helo=mail.comstyle.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyUvd-0004Rc-NE for qemu-devel@nongnu.org; Tue, 30 Aug 2011 16:29:01 -0400 Received: from rox.home.comstyle.com (rox.home.comstyle.com [IPv6:2001:470:b01e:3:ca0a:a9ff:fe93:42c9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 56DB5984B5 for ; Tue, 30 Aug 2011 16:28:57 -0400 (EDT) Date: Tue, 30 Aug 2011 16:28:55 -0400 From: Brad To: qemu-devel@nongnu.org Message-ID: <20110830202854.GA31914@rox.home.comstyle.com> References: <20110829044952.GA13256@rox.home.comstyle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110829044952.GA13256@rox.home.comstyle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-comstyle-MailScanner-Information: Please contact the ISP for more information X-comstyle-MailScanner-ID: 56DB5984B5.A3A13 X-comstyle-MailScanner: Found to be clean X-comstyle-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (not cached, score=-2.91, required 6, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90, T_RP_MATCHES_RCVD -0.01) X-comstyle-MailScanner-From: brad@comstyle.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.51.28.2 Subject: Re: [Qemu-devel] [PATCH] Allow overriding the location of Samba's smbd. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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