#include <sys/time.h>
#include <zlib.h>
-/* Needed early for _BSD etc. */
+/* Needed early for HOST_BSD etc. */
#include "config-host.h"
#ifndef _WIN32
#include <dirent.h>
#include <netdb.h>
#include <sys/select.h>
-#ifdef _BSD
+#ifdef HOST_BSD
#include <sys/stat.h>
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <libutil.h>
#endif
#ifdef _WIN32
+#include <windows.h>
#include <malloc.h>
#include <sys/timeb.h>
#include <mmsystem.h>
}
/* XXX: better tmp dir construction */
- snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid());
+ snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
if (mkdir(smb_dir, 0700) < 0) {
fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
exit(1);
struct strbuf sbuf;
int f = 0;
sbuf.maxlen = sizeof(buf);
- sbuf.buf = buf;
+ sbuf.buf = (char *)buf;
size = getmsg(s->fd, NULL, &sbuf, &f) >=0 ? sbuf.len : -1;
#else
size = read(s->fd, buf, sizeof(buf));
return s;
}
-#if defined (_BSD) || defined (__FreeBSD_kernel__)
+#if defined (HOST_BSD) || defined (__FreeBSD_kernel__)
static int tap_open(char *ifname, int ifname_size)
{
int fd;
* Allocate TAP device, returns opened fd.
* Stores dev name in the first arg(must be large enough).
*/
-int tap_alloc(char *dev, size_t dev_size)
+static int tap_alloc(char *dev, size_t dev_size)
{
int tap_fd, if_fd, ppa = -1;
static int ip_fd = 0;
VLANState *vlan;
VLANClientState *vc;
- if (!net_host_check_device(device)) {
- monitor_printf(mon, "invalid host network device %s\n", device);
- return;
- }
-
vlan = qemu_find_vlan(vlan_id);
if (!vlan) {
monitor_printf(mon, "can't find vlan %d\n", vlan_id);
void net_cleanup(void)
{
+#if !defined(_WIN32)
VLANState *vlan;
-#if !defined(_WIN32)
/* close network clients */
for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {
VLANClientState *vc;