Skip to contentSkip to conversation

SAMBA multi-share support

PATCH New Stealth Dave 1 participant 1 message Feb 13, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SAMBA multi-share support

Apparently it was an easier itch to scratch than I thought it would be! :) Attached is a patch which allows multiple samba shares to be loaded within the qemu virtual machine. The old syntax is still supported and is completely backwards compatible. Each folder and share name is separated by a colon (:), and each folder/share pair is separated by a comman. To share multiple folders, use the following syntax:

qemu hd.img -smb /path/to/dir1:share1,/path/to/dir2:share2

dir1 can be mounted as "share1", dir2 as "share2", etc. The number of shares is limited by a total of 1024 characters, but is otherwise unlimited. There is no sanity checking, as an error would simply cause the smb daemon to not launch but otherwise not affect the running of qemu. Using the old syntax:

qemu hd.img -smb /path/to/dir

will fall back to the old behavior of being shared at "qemu". The attached patch applies cleanly to current CVS, and updates vl.c and qemu-doc.texi (documentation update).

- Dave

P.S. - Anyone want to tackle that compressed vm file? :D

CVS/Entries +2 -2
diff -BurN qemu/CVS/Entries qemu-smb/CVS/Entries
@@ -63,6 +63,7 @@
 /ppc-dis.c/1.7/Sat Jul 23 22:39:53 2005//
 /ppc.ld/1.2/Sun Jun  5 15:57:04 2005//
 /qemu-binfmt-conf.sh/1.4/Tue Dec  6 21:43:35 2005//
+/qemu-doc.texi/1.80/Sun Feb  5 04:14:41 2006//
 /qemu-img.c/1.8/Sun Jul 24 18:44:55 2005//
 /qemu-img.texi/1.2/Sat Jul 23 17:43:14 2005//
 /qemu-tech.texi/1.8/Sat Jul 23 14:27:54 2005//
@@ -98,5 +99,4 @@
 D/target-ppc////
 D/target-sparc////
 D/tests////
-/vl.c/1.164/Mon Feb 13 19:35:11 2006//
-/qemu-doc.texi/1.80/Mon Feb 13 20:09:02 2006//
+/vl.c/1.164/Mon Feb 13 19:10:42 2006//
qemu-doc.texi +9 -1
diff -BurN qemu/qemu-doc.texi qemu-smb/qemu-doc.texi
@@ -348,7 +348,7 @@
 the Unix TFTP client). The host IP address on the guest is as usual
 10.0.2.2.
 
-@item -smb dir
+@item -smb dir[:share,dir2:share2,dir3:share3...]
 When using the user mode network stack, activate a built-in SMB
 server so that Windows OSes can access to the host files in @file{dir}
 transparently.
@@ -361,6 +361,14 @@
 or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
 
 Then @file{dir} can be accessed in @file{\\smbserver\qemu}.
+
+Additionally, you can share multiple folders by specifying the folder
+name followed by a colon (:) and the desired share name, with each
+folder / share name pair separated by commas (,).
+
+@example
+qemu hd.img -smb /path/to/dir1:dir1,/path/to/dir2:dir2
+@end example
 
 Note that a SAMBA server must be installed on the host OS in
 @file{/usr/sbin/smbd}. QEMU was tested succesfully with smbd version
vl.c +42 -6

66 lines not on this page · raw message