* [PATCH][IOEMU] build fix for BSD
@ 2008-11-10 10:29 Christoph Egger
2008-11-10 10:49 ` Keir Fraser
2008-11-10 11:00 ` Stefano Stabellini
0 siblings, 2 replies; 6+ messages in thread
From: Christoph Egger @ 2008-11-10 10:29 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 667 bytes --]
Hi!
Attached patch makes git-ioemu compile on NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
P.S.: I'm about sending the pieces to qemu-devel. The changes
in vl.c already went upstream in qemu's svn c/s 5646.
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
[-- Attachment #2: xen_ioemu_bsd.diff --]
[-- Type: text/x-diff, Size: 3404 bytes --]
diff --git a/block.c b/block.c
index b83e633..a90cfa8 100644
--- a/block.c
+++ b/block.c
@@ -32,8 +32,10 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/queue.h>
+#if defined(__FreeBSD__)
#include <sys/disk.h>
#endif
+#endif
#define SECTOR_BITS 9
#define SECTOR_SIZE (1 << SECTOR_BITS)
diff --git a/configure b/configure
index 994a4c8..8ad66dc 100755
--- a/configure
+++ b/configure
@@ -341,10 +341,10 @@ for opt do
esac
done
-if [ "$bsd" = "yes" ] ; then
- AIOLIBS="-lrt"
-elif [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
+if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
AIOLIBS=
+elif [ "$bsd" = "yes" ]; then
+ AIOLIBS="-lrt -lpthread"
else
# Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
AIOLIBS="-lrt -lpthread"
diff --git a/hw/battery_mgmt.h b/hw/battery_mgmt.h
index dd60160..4a4ac8e 100644
--- a/hw/battery_mgmt.h
+++ b/hw/battery_mgmt.h
@@ -25,6 +25,9 @@
#ifdef CONFIG_STUBDOM
#define CONFIG_NO_BATTERY_MGMT
#endif
+#ifdef _BSD /* There's no ioperm(), outb(), inb() */
+#define CONFIG_NO_BATTERY_MGMT
+#endif
enum POWER_MGMT_MODE { PM_MODE_NONE = 0, PM_MODE_PT, PM_MODE_NON_PT };
enum BATTERY_INFO_TYPE { BATT_NONE, BIF, BST };
diff --git a/monitor.c b/monitor.c
index b15a1fa..cc55ccc 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2210,9 +2210,9 @@ static void monitor_handle_command(const char *cmdline)
/* format found */
p++;
count = 1;
- if (isdigit(*p)) {
+ if (isdigit((uint8_t)*p)) {
count = 0;
- while (isdigit(*p)) {
+ while (isdigit((uint8_t)*p)) {
count = count * 10 + (*p - '0');
p++;
}
diff --git a/vl.c b/vl.c
index 182346a..d2833b1 100644
--- a/vl.c
+++ b/vl.c
@@ -56,23 +56,31 @@
#include <sys/poll.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
+#include <sys/resource.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <net/if.h>
+#if defined(__NetBSD__)
+#include <net/if_tap.h>
+#endif
+#ifdef __linux__
+#include <linux/if_tun.h>
+#endif
+#include <arpa/inet.h>
#include <dirent.h>
#include <netdb.h>
#include <sys/select.h>
-#include <arpa/inet.h>
#ifdef _BSD
#include <sys/stat.h>
-#ifndef __APPLE__
+#ifdef __FreeBSD__
#include <libutil.h>
+#else
+#include <util.h>
#endif
#elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
#include <freebsd/stdlib.h>
#else
#ifdef __linux__
-#include <linux/if.h>
-#include <linux/if_tun.h>
#include <pty.h>
#include <malloc.h>
#include <linux/rtc.h>
@@ -4115,10 +4123,13 @@ static int tap_open(char *ifname, int ifname_size)
#ifndef TAPGIFNAME
char *dev;
struct stat s;
+#else
+ struct ifreq ifr;
#endif
TFR(fd = open("/dev/tap", O_RDWR));
if (fd < 0) {
+ fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation %s\n", strerror(errno));
return -1;
}
diff --git a/xen-hooks.mak b/xen-hooks.mak
index e874552..8e1b188 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -19,6 +19,7 @@ CFLAGS += $(CMDLINE_CFLAGS)
LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
+LIBS += -lossaudio
LDFLAGS := $(CFLAGS) $(LDFLAGS)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH][IOEMU] build fix for BSD
2008-11-10 10:29 [PATCH][IOEMU] build fix for BSD Christoph Egger
@ 2008-11-10 10:49 ` Keir Fraser
2008-11-10 10:57 ` Christoph Egger
2008-11-10 11:00 ` Stefano Stabellini
1 sibling, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2008-11-10 10:49 UTC (permalink / raw)
To: Christoph Egger, xen-devel
On 10/11/08 10:29, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> Hi!
>
> Attached patch makes git-ioemu compile on NetBSD.
>
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>
> P.S.: I'm about sending the pieces to qemu-devel. The changes
> in vl.c already went upstream in qemu's svn c/s 5646.
The unconditional addition of -lossaudio in xen-hooks.mak doesn't look
likely to work for Linux. I think this patch will have to wait until Ian
Jackson gets back from vacation in a couple of weeks. He's bound to have an
opinion about it.
-- Keir
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH][IOEMU] build fix for BSD
2008-11-10 10:49 ` Keir Fraser
@ 2008-11-10 10:57 ` Christoph Egger
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Egger @ 2008-11-10 10:57 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
On Monday 10 November 2008 11:49:02 Keir Fraser wrote:
> On 10/11/08 10:29, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> > Hi!
> >
> > Attached patch makes git-ioemu compile on NetBSD.
> >
> > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
> >
> > P.S.: I'm about sending the pieces to qemu-devel. The changes
> > in vl.c already went upstream in qemu's svn c/s 5646.
>
> The unconditional addition of -lossaudio in xen-hooks.mak doesn't look
> likely to work for Linux. I think this patch will have to wait until Ian
> Jackson gets back from vacation in a couple of weeks. He's bound to have an
> opinion about it.
The configure script in qemu simply allows to set a oss_lib variable
specifically for each OS. I think, the right way is to pull all changes
from upstream qemu which introduce this variable in ioemu.
Christoph
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH][IOEMU] build fix for BSD
2008-11-10 10:29 [PATCH][IOEMU] build fix for BSD Christoph Egger
2008-11-10 10:49 ` Keir Fraser
@ 2008-11-10 11:00 ` Stefano Stabellini
2008-11-10 11:02 ` Christoph Egger
1 sibling, 1 reply; 6+ messages in thread
From: Stefano Stabellini @ 2008-11-10 11:00 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel
Christoph Egger wrote:
> Hi!
>
> Attached patch makes git-ioemu compile on NetBSD.
>
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>
> P.S.: I'm about sending the pieces to qemu-devel. The changes
> in vl.c already went upstream in qemu's svn c/s 5646.
>
>
Including <net/if.h> currently breaks the stubdom build.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH][IOEMU] build fix for BSD
2008-11-10 11:00 ` Stefano Stabellini
@ 2008-11-10 11:02 ` Christoph Egger
2008-11-10 11:08 ` Stefano Stabellini
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Egger @ 2008-11-10 11:02 UTC (permalink / raw)
To: xen-devel; +Cc: Stefano Stabellini
On Monday 10 November 2008 12:00:49 Stefano Stabellini wrote:
> Christoph Egger wrote:
> > Hi!
> >
> > Attached patch makes git-ioemu compile on NetBSD.
> >
> > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
> >
> > P.S.: I'm about sending the pieces to qemu-devel. The changes
> > in vl.c already went upstream in qemu's svn c/s 5646.
>
> Including <net/if.h> currently breaks the stubdom build.
This header is a standard header.
stubdom needs to be fixed then
(which will also help to compile stubdom on non-Linux systems
in the future).
Christoph
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH][IOEMU] build fix for BSD
2008-11-10 11:02 ` Christoph Egger
@ 2008-11-10 11:08 ` Stefano Stabellini
0 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2008-11-10 11:08 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel
Christoph Egger wrote:
> On Monday 10 November 2008 12:00:49 Stefano Stabellini wrote:
>> Christoph Egger wrote:
>>> Hi!
>>>
>>> Attached patch makes git-ioemu compile on NetBSD.
>>>
>>> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>>>
>>> P.S.: I'm about sending the pieces to qemu-devel. The changes
>>> in vl.c already went upstream in qemu's svn c/s 5646.
>> Including <net/if.h> currently breaks the stubdom build.
>
> This header is a standard header.
> stubdom needs to be fixed then
> (which will also help to compile stubdom on non-Linux systems
> in the future).
>
Yes, I know.
I'll send a patch in today.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-11-10 11:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-10 10:29 [PATCH][IOEMU] build fix for BSD Christoph Egger
2008-11-10 10:49 ` Keir Fraser
2008-11-10 10:57 ` Christoph Egger
2008-11-10 11:00 ` Stefano Stabellini
2008-11-10 11:02 ` Christoph Egger
2008-11-10 11:08 ` Stefano Stabellini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.