diff --git a/Makefile.target b/Makefile.target index 7cfb493..2d1ec9e 100644 --- a/Makefile.target +++ b/Makefile.target @@ -715,6 +715,9 @@ ifdef TARGET_GPROF vl.o: CFLAGS+=-p LDFLAGS+=-p endif +ifdef CONFIG_STUBDOM +CFLAGS += -I$(MINI_OS-ROOT)/include +endif ifeq ($(ARCH),ia64) LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld diff --git a/block-vbd.c b/block-vbd.c index 56794f6..11ac4d0 100644 --- a/block-vbd.c +++ b/block-vbd.c @@ -26,8 +26,8 @@ #include "sys-queue.h" #include "block_int.h" #include -#include -#include +#include +#include #include #include "qemu-char.h" diff --git a/hw/xen_machine_fv.c b/hw/xen_machine_fv.c index d02e23f..49dec68 100644 --- a/hw/xen_machine_fv.c +++ b/hw/xen_machine_fv.c @@ -40,8 +40,11 @@ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) #define DECLARE_BITMAP(name,bits) \ unsigned long name[BITS_TO_LONGS(bits)] + +#ifndef CONFIG_STUBDOM /* defined in */ #define test_bit(bit,map) \ (!!((map)[(bit)/BITS_PER_LONG] & (1UL << ((bit)%BITS_PER_LONG)))) +#endif struct map_cache { unsigned long paddr_index; diff --git a/qemu-common.h b/qemu-common.h index 50dfb6b..1a6e445 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -9,6 +9,8 @@ #define NO_UNIX_SOCKETS 1 #endif +#include "config-host.h" + #define QEMU_NORETURN __attribute__ ((__noreturn__)) /* Hack around the mess dyngen-exec.h causes: We need QEMU_NORETURN in files that diff --git a/qemu-lock.h b/qemu-lock.h index 6778eea..3a01ebe 100644 --- a/qemu-lock.h +++ b/qemu-lock.h @@ -34,7 +34,7 @@ #elif defined(CONFIG_STUBDOM) -#include +#include #else diff --git a/vl.c b/vl.c index cb31e5a..db349bf 100644 --- a/vl.c +++ b/vl.c @@ -42,6 +42,7 @@ #include "migration.h" #include "kvm.h" #include "balloon.h" +#include "dma.h" #include "hw/pci.h" #include "hw/xen.h" diff --git a/vnc.c b/vnc.c index 702ee5d..4c9e3bc 100644 --- a/vnc.c +++ b/vnc.c @@ -32,8 +32,8 @@ #include -#ifdef CONFIG_STUBDOM -#include +#if defined(CONFIG_STUBDOM) && defined(__Linux__) +#include #endif /* The refresh interval starts at BASE. If we scan the buffer and @@ -2556,7 +2556,7 @@ int vnc_display_open(DisplayState *ds, const char *display, int find_unused) struct sockaddr_un uaddr; const char *p; #endif -#ifndef CONFIG_STUBDOM +#if !defined(CONFIG_STUBDOM) || defined(__NetBSD__) int reuse_addr, ret; #endif socklen_t addrlen; @@ -2691,7 +2691,7 @@ int vnc_display_open(DisplayState *ds, const char *display, int find_unused) return -1; } -#ifdef CONFIG_STUBDOM +#if defined(CONFIG_STUBDOM) && defined(__Linux__) { struct ip_addr ipaddr = { iaddr.sin_addr.s_addr }; struct ip_addr netmask = { 0 }; @@ -2710,7 +2710,7 @@ int vnc_display_open(DisplayState *ds, const char *display, int find_unused) return -1; } -#ifndef CONFIG_STUBDOM +#if !defined(CONFIG_STUBDOM) || defined(__NetBSD__) reuse_addr = 1; ret = setsockopt(vs->lsock, SOL_SOCKET, SO_REUSEADDR, (const char *)&reuse_addr, sizeof(reuse_addr)); diff --git a/xen-setup-stubdom b/xen-setup-stubdom index fcf60c3..88f84cd 100755 --- a/xen-setup-stubdom +++ b/xen-setup-stubdom @@ -36,7 +36,15 @@ cat <config-host.h.new #define CONFIG_QEMU_SHAREDIR "${SHAREDIR}/xen/qemu" #define HOST_I386 1 #define HOST_LONG_BITS 32 +#ifdef __Linux__ #define HAVE_BYTESWAP_H 1 +#endif +#ifdef __NetBSD__ +#define _BSD 1 +#define HAVE_MACHINE_BSWAP_H 1 +#define HAVE_IOVEC 1 +#define O_LARGEFILE 0 +#endif #define AUDIO_DRIVERS /* none */ #define QEMU_VERSION "$qemu_version" #define CONFIG_UNAME_RELEASE "" @@ -48,12 +56,12 @@ mv -f config-host.h.new config-host.h #---------- cat <config-host.mak.new CONFIG_STUBDOM=yes -prefix=$(PREFIX) +prefix=\$(PREFIX) bindir=\${prefix}/bin mandir=\$(MANDIR) datadir=\$(SHAREDIR)/qemu docdir=\$(SHAREDIR)/doc/qemu -MAKE=make +MAKE=gmake INSTALL=install CC=gcc HOST_CC=gcc diff --git a/xenfbfront.c b/xenfbfront.c index ed79cde..66af034 100644 --- a/xenfbfront.c +++ b/xenfbfront.c @@ -1,9 +1,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -358,5 +358,6 @@ int xenfb_pv_display_init(DisplayState *ds) int xenfb_pv_display_vram(void *data) { vga_vram = data; + return 0; }