|
@@ -27,7 +27,7 @@
|
|
|
#include "net/slirp.h"
|
|
|
|
|
|
|
|
|
-#ifndef _WIN32
|
|
|
+#if defined(CONFIG_SLIRP_SMBD)
|
|
|
#include <pwd.h>
|
|
|
#include <sys/wait.h>
|
|
|
#endif
|
|
@@ -91,7 +91,7 @@ typedef struct SlirpState {
|
|
|
Slirp *slirp;
|
|
|
Notifier poll_notifier;
|
|
|
Notifier exit_notifier;
|
|
|
-#ifndef _WIN32
|
|
|
+#if defined(CONFIG_SLIRP_SMBD)
|
|
|
gchar *smb_dir;
|
|
|
#endif
|
|
|
GSList *fwd;
|
|
@@ -104,7 +104,7 @@ static QTAILQ_HEAD(, SlirpState) slirp_stacks =
|
|
|
static int slirp_hostfwd(SlirpState *s, const char *redir_str, Error **errp);
|
|
|
static int slirp_guestfwd(SlirpState *s, const char *config_str, Error **errp);
|
|
|
|
|
|
-#ifndef _WIN32
|
|
|
+#if defined(CONFIG_SLIRP_SMBD)
|
|
|
static int slirp_smb(SlirpState *s, const char *exported_dir,
|
|
|
struct in_addr vserver_addr, Error **errp);
|
|
|
static void slirp_smb_cleanup(SlirpState *s);
|
|
@@ -377,7 +377,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
|
|
|
struct in6_addr ip6_prefix;
|
|
|
struct in6_addr ip6_host;
|
|
|
struct in6_addr ip6_dns;
|
|
|
-#ifndef _WIN32
|
|
|
+#if defined(CONFIG_SLIRP_SMBD)
|
|
|
struct in_addr smbsrv = { .s_addr = 0 };
|
|
|
#endif
|
|
|
NetClientState *nc;
|
|
@@ -487,7 +487,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
-#ifndef _WIN32
|
|
|
+#if defined(CONFIG_SLIRP_SMBD)
|
|
|
if (vsmbserver && !inet_aton(vsmbserver, &smbsrv)) {
|
|
|
error_setg(errp, "Failed to parse SMB address");
|
|
|
return -1;
|
|
@@ -602,7 +602,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-#ifndef _WIN32
|
|
|
+#if defined(CONFIG_SLIRP_SMBD)
|
|
|
if (smb_export) {
|
|
|
if (slirp_smb(s, smb_export, smbsrv, errp) < 0) {
|
|
|
goto error;
|
|
@@ -794,7 +794,7 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict)
|
|
|
|
|
|
}
|
|
|
|
|
|
-#ifndef _WIN32
|
|
|
+#if defined(CONFIG_SLIRP_SMBD)
|
|
|
|
|
|
/* automatic user mode samba server configuration */
|
|
|
static void slirp_smb_cleanup(SlirpState *s)
|
|
@@ -909,7 +909,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-#endif /* !defined(_WIN32) */
|
|
|
+#endif /* defined(CONFIG_SLIRP_SMBD) */
|
|
|
|
|
|
static int guestfwd_can_read(void *opaque)
|
|
|
{
|