qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: SAMBA support in QEMU


From: Ronald
Subject: [Qemu-devel] Re: SAMBA support in QEMU
Date: Mon, 06 Sep 2004 02:30:50 +0200
User-agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)

Le Mon, 06 Sep 2004 01:24:08 +0200, Fabrice Bellard a écrit :

> Hi,
> 
> I just commited a simple solution to enable direct access to host files
> from Windows guests with user mode networking and with almost no set up.
> It is currently very experimental but it works, at least for Windows 98
> with the Samba server from Red Hat 9. Any suggestion is welcome.
> 

Just a small fix to make it build for windows.

--- vl.c.old    2004-09-06 02:25:03.958702256 +0200
+++ vl.c        2004-09-06 02:22:41.086234244 +0200
@@ -29,6 +29,7 @@
 #include <time.h>
 #include <errno.h>
 #include <sys/time.h>
+#include <dirent.h>

 #ifndef _WIN32
 #include <sys/times.h>
@@ -38,7 +39,6 @@
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-#include <dirent.h>
 #ifdef _BSD
 #include <sys/stat.h>
 #ifndef __APPLE__
@@ -1493,10 +1493,17 @@

     /* XXX: better tmp dir construction */
     snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid());
+       #ifdef _WIN32
+       if (mkdir(smb_dir) < 0) {
+               fprintf(stderr, "qemu: could not create samba server dir 
'%s'\n", smb_dir);
+               exit(1);
+                                   }
+       #else
     if (mkdir(smb_dir, 0700) < 0) {
         fprintf(stderr, "qemu: could not create samba server dir '%s'\n", 
smb_dir);
         exit(1);
     }
+    #endif
     snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf");

     f = fopen(smb_conf, "w");





reply via email to

[Prev in Thread] Current Thread [Next in Thread]