qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] patch for supporting SMB on Solaris host
@ 2006-12-22 20:07 Ben Taylor
  2006-12-22 21:29 ` Paul Brook
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Taylor @ 2006-12-22 20:07 UTC (permalink / raw)
  To: qemu-devel: nongnu.org


Seeing as there is some working going on in the Solaris QEMU port again,
here's a real short patch to support Samba working on a Solaris Host.


--- qemu-ORIG/vl.c      2006-12-22 12:29:05.000000000 -0500 
+++ qemu/vl.c   2006-12-22 14:22:17.338815000 -0500 
@@ -3069,8 +3069,13 @@ 
     fclose(f); 
     atexit(smb_exit); 
 
+#ifdef __sun__ 
+    snprintf(smb_cmdline, sizeof(smb_cmdline), "/bin/env LC_ALL=C 
/usr/sfw/sbin/smbd -s %s", 
+             smb_conf); 
+#else 
     snprintf(smb_cmdline, sizeof(smb_cmdline), "/usr/sbin/smbd -s %s", 
              smb_conf); 
+#endif 
 
     slirp_add_exec(0, smb_cmdline, 4, 139); 
 } 

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

* Re: [Qemu-devel] patch for supporting SMB on Solaris host
  2006-12-22 20:07 Ben Taylor
@ 2006-12-22 21:29 ` Paul Brook
  2006-12-22 21:32   ` Paul Brook
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Brook @ 2006-12-22 21:29 UTC (permalink / raw)
  To: qemu-devel, sol10x86

On Friday 22 December 2006 20:07, Ben Taylor wrote:
> Seeing as there is some working going on in the Solaris QEMU port again,
> here's a real short patch to support Samba working on a Solaris Host.
> +#ifdef __sun__
> +    snprintf(smb_cmdline, sizeof(smb_cmdline), "/bin/env LC_ALL=C
> /usr/sfw/sbin/smbd -s %s",
> +             smb_conf);
> +#else

Why does this have anything to do with solaris?

Paul

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

* Re: [Qemu-devel] patch for supporting SMB on Solaris host
  2006-12-22 21:29 ` Paul Brook
@ 2006-12-22 21:32   ` Paul Brook
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Brook @ 2006-12-22 21:32 UTC (permalink / raw)
  To: qemu-devel

On Friday 22 December 2006 21:29, Paul Brook wrote:
> On Friday 22 December 2006 20:07, Ben Taylor wrote:
> > Seeing as there is some working going on in the Solaris QEMU port again,
> > here's a real short patch to support Samba working on a Solaris Host.
> > +#ifdef __sun__
> > +    snprintf(smb_cmdline, sizeof(smb_cmdline), "/bin/env LC_ALL=C
> > /usr/sfw/sbin/smbd -s %s",
> > +             smb_conf);
> > +#else
>
> Why does this have anything to do with solaris?

Sorry, I was unclear. The /usr/swf bif is obviously a Solaris hack, and I 
think this is a bad way of implementing this.
I don't see why the  /bin/env LC_ALL bits have anything to do with Solaris.

Paul

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

* Re: [Qemu-devel] patch for supporting SMB on Solaris host
@ 2006-12-23  0:06 Ben Taylor
  0 siblings, 0 replies; 8+ messages in thread
From: Ben Taylor @ 2006-12-23  0:06 UTC (permalink / raw)
  To: Paul Brook, qemu-devel


---- Paul Brook <paul@codesourcery.com> wrote: 
> On Friday 22 December 2006 21:29, Paul Brook wrote:
> > On Friday 22 December 2006 20:07, Ben Taylor wrote:
> > > Seeing as there is some working going on in the Solaris QEMU port again,
> > > here's a real short patch to support Samba working on a Solaris Host.
> > > +#ifdef __sun__
> > > +    snprintf(smb_cmdline, sizeof(smb_cmdline), "/bin/env LC_ALL=C
> > > /usr/sfw/sbin/smbd -s %s",
> > > +             smb_conf);
> > > +#else
> >
> > Why does this have anything to do with solaris?
> 
> Sorry, I was unclear. The /usr/swf bif is obviously a Solaris hack, and I 
> think this is a bad way of implementing this.

Well, I suppose I can write a configure hack to replace to definte the smbd
binary, which will take about 30 seconds, hoping you'll find that more 
digestable.

> I don't see why the  /bin/env LC_ALL bits have anything to do with Solaris.

Let me inject a little humor.  I'm american and speak only one language. The
guy who did the patch is in germany and did it for a reason, though he never
explained to me.

In meantime, I will resubmit the patch without the /bin/env LC_ALL bits, hopefully
to your liking and if it breaks on Solaris for some other reason, I'll be able to
argue with you why it needs to be there.

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

* Re: [Qemu-devel] patch for supporting SMB on Solaris host
@ 2006-12-23  1:40 Ben Taylor
  2006-12-23  1:48 ` Lennert Buytenhek
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Taylor @ 2006-12-23  1:40 UTC (permalink / raw)
  To: Paul Brook, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]


---- Paul Brook <paul@codesourcery.com> wrote: 
> On Friday 22 December 2006 21:29, Paul Brook wrote:
> > On Friday 22 December 2006 20:07, Ben Taylor wrote:
> > > Seeing as there is some working going on in the Solaris QEMU port again,
> > > here's a real short patch to support Samba working on a Solaris Host.
> > > +#ifdef __sun__
> > > +    snprintf(smb_cmdline, sizeof(smb_cmdline), "/bin/env LC_ALL=C
> > > /usr/sfw/sbin/smbd -s %s",
> > > +             smb_conf);
> > > +#else
> >
> > Why does this have anything to do with solaris?
> 
> Sorry, I was unclear. The /usr/swf bif is obviously a Solaris hack, and I 
> think this is a bad way of implementing this.
> I don't see why the  /bin/env LC_ALL bits have anything to do with Solaris.

Hopefully, you find this patch to be more reasonable.

Ben

[-- Attachment #2: smb.patch --]
[-- Type: text/x-patch, Size: 1515 bytes --]

diff -ruN qemu-ORIG/configure qemu-smb/configure
--- qemu-ORIG/configure	2006-12-18 22:31:34.000000000 -0500
+++ qemu-smb/configure	2006-12-22 19:15:05.710251000 -0500
@@ -30,6 +30,7 @@
 install="install"
 strip="strip"
 cpu=`uname -m`
+smbd=/usr/sbin/smbd
 target_list=""
 case "$cpu" in
   i386|i486|i586|i686|i86pc|BePC)
@@ -150,6 +151,7 @@
     make="gmake"
     install="ginstall"
     solarisrev=`uname -r | cut -f2 -d.`
+    smbd=/usr/sfw/sbin/smbd
 fi
 
 # find source path
@@ -579,6 +581,7 @@
 echo "Documentation     $build_docs"
 [ ! -z "$uname_release" ] && \
 echo "uname -r          $uname_release"
+echo "smbd              $smbd"
 
 if test $sdl_too_old = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -613,6 +616,7 @@
 echo "CFLAGS=$CFLAGS" >> $config_mak
 echo "LDFLAGS=$LDFLAGS" >> $config_mak
 echo "EXESUF=$EXESUF" >> $config_mak
+echo "#define SMBD_BINARY \"$smbd\"" >> $config_h
 if test "$cpu" = "i386" ; then
   echo "ARCH=i386" >> $config_mak
   echo "#define HOST_I386 1" >> $config_h
diff -ruN qemu-ORIG/vl.c qemu-smb/vl.c
--- qemu-ORIG/vl.c	2006-12-22 12:29:05.000000000 -0500
+++ qemu-smb/vl.c	2006-12-22 19:11:08.010585000 -0500
@@ -3069,8 +3069,8 @@
     fclose(f);
     atexit(smb_exit);
 
-    snprintf(smb_cmdline, sizeof(smb_cmdline), "/usr/sbin/smbd -s %s",
-             smb_conf);
+    snprintf(smb_cmdline, sizeof(smb_cmdline), "% -s %s",
+             SMBD_BINARY, smb_conf);
     
     slirp_add_exec(0, smb_cmdline, 4, 139);
 }

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

* Re: [Qemu-devel] patch for supporting SMB on Solaris host
@ 2006-12-23  1:40 Ben Taylor
  0 siblings, 0 replies; 8+ messages in thread
From: Ben Taylor @ 2006-12-23  1:40 UTC (permalink / raw)
  To: Paul Brook, qemu-devel


---- Paul Brook <paul@codesourcery.com> wrote: 
> On Friday 22 December 2006 21:29, Paul Brook wrote:
> > On Friday 22 December 2006 20:07, Ben Taylor wrote:
> > > Seeing as there is some working going on in the Solaris QEMU port again,
> > > here's a real short patch to support Samba working on a Solaris Host.
> > > +#ifdef __sun__
> > > +    snprintf(smb_cmdline, sizeof(smb_cmdline), "/bin/env LC_ALL=C
> > > /usr/sfw/sbin/smbd -s %s",
> > > +             smb_conf);
> > > +#else
> >
> > Why does this have anything to do with solaris?
> 
> Sorry, I was unclear. The /usr/swf bif is obviously a Solaris hack, and I 
> think this is a bad way of implementing this.
> I don't see why the  /bin/env LC_ALL bits have anything to do with Solaris.

Hopefully, you find this patch to be more reasonable.

Ben

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

* Re: [Qemu-devel] patch for supporting SMB on Solaris host
  2006-12-23  1:40 Ben Taylor
@ 2006-12-23  1:48 ` Lennert Buytenhek
  0 siblings, 0 replies; 8+ messages in thread
From: Lennert Buytenhek @ 2006-12-23  1:48 UTC (permalink / raw)
  To: sol10x86, qemu-devel; +Cc: Paul Brook

On Fri, Dec 22, 2006 at 08:40:27PM -0500, Ben Taylor wrote:

> -    snprintf(smb_cmdline, sizeof(smb_cmdline), "/usr/sbin/smbd -s %s",
> -             smb_conf);
> +    snprintf(smb_cmdline, sizeof(smb_cmdline), "% -s %s",
> +             SMBD_BINARY, smb_conf);

Doesn't look right to me?  (s/%/%s/)

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

* Re: [Qemu-devel] patch for supporting SMB on Solaris host
@ 2006-12-23 13:17 Ben Taylor
  0 siblings, 0 replies; 8+ messages in thread
From: Ben Taylor @ 2006-12-23 13:17 UTC (permalink / raw)
  To: Lennert Buytenhek, qemu-devel; +Cc: Paul Brook


---- Lennert Buytenhek <buytenh@wantstofly.org> wrote: 
> On Fri, Dec 22, 2006 at 08:40:27PM -0500, Ben Taylor wrote:
> 
> > -    snprintf(smb_cmdline, sizeof(smb_cmdline), "/usr/sbin/smbd -s %s",
> > -             smb_conf);
> > +    snprintf(smb_cmdline, sizeof(smb_cmdline), "% -s %s",
> > +             SMBD_BINARY, smb_conf);
> 
> Doesn't look right to me?  (s/%/%s/)

Good catch.   otherwise, the patch is better?

Ben

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

end of thread, other threads:[~2006-12-23 13:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-23  1:40 [Qemu-devel] patch for supporting SMB on Solaris host Ben Taylor
  -- strict thread matches above, loose matches on Subject: below --
2006-12-23 13:17 Ben Taylor
2006-12-23  1:40 Ben Taylor
2006-12-23  1:48 ` Lennert Buytenhek
2006-12-23  0:06 Ben Taylor
2006-12-22 20:07 Ben Taylor
2006-12-22 21:29 ` Paul Brook
2006-12-22 21:32   ` Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).