diff -urp qemu-0.10.0.orig/Makefile qemu-0.10.0/Makefile
--- qemu-0.10.0.orig/Makefile	2009-03-05 00:54:45 +0200
+++ qemu-0.10.0/Makefile	2009-03-13 08:47:16 +0200
@@ -273,15 +273,15 @@ cscope:
 	texi2dvi $<
 
 qemu.1: qemu-doc.texi
-	$(SRC_PATH)/texi2pod.pl $< qemu.pod
+	perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu.pod
 	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
 
 qemu-img.1: qemu-img.texi
-	$(SRC_PATH)/texi2pod.pl $< qemu-img.pod
+	perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
 	pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
 
 qemu-nbd.8: qemu-nbd.texi
-	$(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod
+	perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod
 	pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@
 
 info: qemu-doc.info qemu-tech.info
diff -urp qemu-0.10.0.orig/audio/sdlaudio.c qemu-0.10.0/audio/sdlaudio.c
--- qemu-0.10.0.orig/audio/sdlaudio.c	2009-03-05 00:54:45 +0200
+++ qemu-0.10.0/audio/sdlaudio.c	2009-03-13 08:43:27 +0200
@@ -29,7 +29,7 @@
 #ifndef _WIN32
 #ifdef __sun__
 #define _POSIX_PTHREAD_SEMANTICS 1
-#elif defined(__OpenBSD__) || defined(__FreeBSD__)
+#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #include <pthread.h>
 #endif
 #include <signal.h>
diff -urp qemu-0.10.0.orig/block-raw-posix.c qemu-0.10.0/block-raw-posix.c
--- qemu-0.10.0.orig/block-raw-posix.c	2009-03-05 00:54:45 +0200
+++ qemu-0.10.0/block-raw-posix.c	2009-03-13 08:43:27 +0200
@@ -63,6 +63,11 @@
 #include <sys/dkio.h>
 #endif
 
+#ifdef __DragonFly__
+#include <sys/ioctl.h>
+#include <sys/diskslice.h>
+#endif
+
 //#define DEBUG_FLOPPY
 
 //#define DEBUG_BLOCK
@@ -762,6 +767,15 @@ static int64_t  raw_getlength(BlockDrive
     if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) {
 #ifdef DIOCGMEDIASIZE
 	if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))
+#elif defined(DIOCGPART)
+        {
+                struct partinfo pi;
+                if (ioctl(fd, DIOCGPART, &pi) == 0)
+                        size = pi.media_size;
+                else
+                        size = 0;
+        }
+        if (size == 0)
 #endif
 #ifdef CONFIG_COCOA
         size = LONG_LONG_MAX;
diff -urp qemu-0.10.0.orig/block.c qemu-0.10.0/block.c
--- qemu-0.10.0.orig/block.c	2009-03-05 00:54:44 +0200
+++ qemu-0.10.0/block.c	2009-03-13 08:43:27 +0200
@@ -35,8 +35,10 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
+#ifndef __DragonFly__
 #include <sys/disk.h>
 #endif
+#endif
 
 #define SECTOR_BITS 9
 #define SECTOR_SIZE (1 << SECTOR_BITS)
diff -urp qemu-0.10.0.orig/configure qemu-0.10.0/configure
--- qemu-0.10.0.orig/configure	2009-03-05 00:54:45 +0200
+++ qemu-0.10.0/configure	2009-03-13 08:43:27 +0200
@@ -228,6 +228,15 @@ if [ "$cpu" = "i386" -o "$cpu" = "x86_64
     kqemu="yes"
 fi
 ;;
+DragonFly)
+bsd="yes"
+audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd pa"
+if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
+    kqemu="yes"
+fi
+aio="no"
+;;
 NetBSD)
 bsd="yes"
 audio_drv_list="oss"
diff -urp qemu-0.10.0.orig/exec.c qemu-0.10.0/exec.c
--- qemu-0.10.0.orig/exec.c	2009-03-05 00:54:44 +0200
+++ qemu-0.10.0/exec.c	2009-03-13 08:43:27 +0200
@@ -454,7 +454,7 @@ static void code_gen_alloc(unsigned long
             exit(1);
         }
     }
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
     {
         int flags;
         void *addr = NULL;
diff -urp qemu-0.10.0.orig/net.c qemu-0.10.0/net.c
--- qemu-0.10.0.orig/net.c	2009-03-05 00:54:45 +0200
+++ qemu-0.10.0/net.c	2009-03-13 08:43:27 +0200
@@ -59,7 +59,7 @@
 #include <sys/select.h>
 #ifdef _BSD
 #include <sys/stat.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #include <libutil.h>
 #else
 #include <util.h>
diff -urp qemu-0.10.0.orig/osdep.c qemu-0.10.0/osdep.c
--- qemu-0.10.0.orig/osdep.c	2009-03-05 00:54:45 +0200
+++ qemu-0.10.0/osdep.c	2009-03-13 08:43:27 +0200
@@ -90,7 +90,7 @@ static void *kqemu_vmalloc(size_t size)
     void *ptr;
 
 /* no need (?) for a dummy file on OpenBSD/FreeBSD */
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
     int map_anon = MAP_ANON;
 #else
     int map_anon = 0;
@@ -157,7 +157,7 @@ static void *kqemu_vmalloc(size_t size)
     }
     size = (size + 4095) & ~4095;
     ftruncate(phys_ram_fd, phys_ram_size + size);
-#endif /* !(__OpenBSD__ || __FreeBSD__) */
+#endif /* !(__OpenBSD__ || __FreeBSD__ || __DragonFly__) */
     ptr = mmap(NULL,
                size,
                PROT_WRITE | PROT_READ, map_anon | MAP_SHARED,
diff -urp qemu-0.10.0.orig/qemu-char.c qemu-0.10.0/qemu-char.c
--- qemu-0.10.0.orig/qemu-char.c	2009-03-05 00:54:44 +0200
+++ qemu-0.10.0/qemu-char.c	2009-03-13 08:43:27 +0200
@@ -66,6 +66,10 @@
 #include <libutil.h>
 #include <dev/ppbus/ppi.h>
 #include <dev/ppbus/ppbconf.h>
+#elif defined(__DragonFly__)
+#include <libutil.h>
+#include <dev/misc/ppi/ppi.h>
+#include <bus/ppbus/ppbconf.h>
 #else
 #include <util.h>
 #endif
@@ -779,7 +783,7 @@ void cfmakeraw (struct termios *termios_
 #endif
 
 #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
-    || defined(__NetBSD__) || defined(__OpenBSD__)
+    || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
 
 typedef struct {
     int fd;
@@ -907,7 +911,7 @@ static CharDriverState *qemu_chr_open_pt
     PtyCharDriver *s;
     struct termios tty;
     int slave_fd, len;
-#if defined(__OpenBSD__)
+#if defined(__OpenBSD__) || defined(__DragonFly__)
     char pty_name[PATH_MAX];
 #define q_ptsname(x) pty_name
 #else
@@ -1253,7 +1257,7 @@ static CharDriverState *qemu_chr_open_pp
 }
 #endif /* __linux__ */
 
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
 {
     int fd = (int)chr->opaque;
@@ -2129,13 +2133,13 @@ CharDriverState *qemu_chr_open(const cha
     if (strstart(filename, "/dev/parport", NULL)) {
         chr = qemu_chr_open_pp(filename);
     } else
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
     if (strstart(filename, "/dev/ppi", NULL)) {
         chr = qemu_chr_open_pp(filename);
     } else
 #endif
 #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
-    || defined(__NetBSD__) || defined(__OpenBSD__)
+    || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
     if (strstart(filename, "/dev/", NULL)) {
         chr = qemu_chr_open_tty(filename);
     } else
diff -urp qemu-0.10.0.orig/savevm.c qemu-0.10.0/savevm.c
--- qemu-0.10.0.orig/savevm.c	2009-03-05 00:54:45 +0200
+++ qemu-0.10.0/savevm.c	2009-03-13 08:43:27 +0200
@@ -63,7 +63,7 @@
 #include <sys/select.h>
 #ifdef _BSD
 #include <sys/stat.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #include <libutil.h>
 #else
 #include <util.h>
diff -urp qemu-0.10.0.orig/usb-bsd.c qemu-0.10.0/usb-bsd.c
--- qemu-0.10.0.orig/usb-bsd.c	2009-03-05 00:54:45 +0200
+++ qemu-0.10.0/usb-bsd.c	2009-03-13 08:43:27 +0200
@@ -34,7 +34,11 @@
 #undef USB_SPEED_LOW
 
 #include <sys/ioctl.h>
+#ifndef __DragonFly__
 #include <dev/usb/usb.h>
+#else
+#include <bus/usb/usb.h>
+#endif
 #include <signal.h>
 
 /* This value has maximum potential at 16.
@@ -68,7 +72,7 @@ static int ensure_ep_open(USBHostDevice 
     ep = UE_GET_ADDR(ep);
 
     if (dev->ep_fd[ep] < 0) {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
         snprintf(buf, sizeof(buf) - 1, "%s.%d", dev->devpath, ep);
 #else
         snprintf(buf, sizeof(buf) - 1, "%s.%02d", dev->devpath, ep);
@@ -321,7 +325,7 @@ USBDevice *usb_host_device_open(const ch
         return NULL;
     }
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
     snprintf(ctlpath, PATH_MAX, "/dev/%s", bus_info.udi_devnames[0]);
 #else
     snprintf(ctlpath, PATH_MAX, "/dev/%s.00", bus_info.udi_devnames[0]);
@@ -411,7 +415,7 @@ static int usb_host_scan(void *opaque, U
             if (strncmp(bus_info.udi_devnames[0], "ugen", 4) != 0)
                 continue;
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
             snprintf(devbuf, sizeof(devbuf) - 1, "/dev/%s", bus_info.udi_devnames[0]);
 #else
             snprintf(devbuf, sizeof(devbuf) - 1, "/dev/%s.00", bus_info.udi_devnames[0]);
diff -urp qemu-0.10.0.orig/vl.c qemu-0.10.0/vl.c
--- qemu-0.10.0.orig/vl.c	2009-03-05 00:54:44 +0200
+++ qemu-0.10.0/vl.c	2009-03-13 08:43:27 +0200
@@ -74,7 +74,7 @@
 #include <sys/select.h>
 #ifdef _BSD
 #include <sys/stat.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #include <libutil.h>
 #else
 #include <util.h>
@@ -754,7 +754,8 @@ static int use_rt_clock;
 static void init_get_clock(void)
 {
     use_rt_clock = 0;
-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
+    || defined(__DragonFly__)
     {
         struct timespec ts;
         if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
@@ -766,7 +767,8 @@ static void init_get_clock(void)
 
 static int64_t get_clock(void)
 {
-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
+	|| defined(__DragonFly__)
     if (use_rt_clock) {
         struct timespec ts;
         clock_gettime(CLOCK_MONOTONIC, &ts);
