Index: Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/Makefile,v retrieving revision 1.97 diff -u -p -r1.97 Makefile --- Makefile 18 Nov 2008 20:07:53 -0000 1.97 +++ Makefile 18 Nov 2008 20:55:02 -0000 @@ -6,15 +6,15 @@ # PORTNAME= qemu -PORTVERSION= 0.9.1s.20080620 -PORTREVISION= 2 +PORTVERSION= 0.9.1s.20081117 CATEGORIES= emulators MASTER_SITES= http://bellard.org/qemu/:release \ http://qemu-forum.ipi.fi/qemu-snapshots/:snapshot \ http://people.fruitsalad.org/nox/qemu/:snapshot \ - ${MASTER_SITE_LOCAL}:snapshot + ${MASTER_SITE_LOCAL}:snapshot \ + http://people.freebsd.org/~nox/qemu/:snapshot PKGNAMESUFFIX= -devel -DISTNAME= ${PORTNAME}-snapshot-2008-06-20_19 +DISTNAME= ${PORTNAME}-snapshot-2008-11-17_20 DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:snapshot DIST_SUBDIR= qemu EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} @@ -39,27 +39,22 @@ OPTIONS= KQEMU "Build with (alpha!) acce GNUTLS "gnutls dependency (vnc encryption)" On \ PCAP "pcap dependency (networking with bpf)" On \ CDROM_DMA "IDE CDROM DMA" On \ - ALL_TARGETS "Also build dyngen targets (requires gcc34)" On + ALL_TARGETS "Also build dyngen targets (requires gcc34)" On \ + ADD_AUDIO "Emulate more audio hardware (experimental!)" Off .include .if defined(WITHOUT_ALL_TARGETS) -CONFIGURE_ARGS+= --disable-gcc-check --target-list=i386-softmmu,sparc-softmmu,x86_64-softmmu,mips-softmmu,mipsel-softmmu,mips64-softmmu,mips64el-softmmu,arm-softmmu,m68k-softmmu,cris-softmmu +CONFIGURE_ARGS+= --disable-gcc-check --target-list=i386-softmmu,sparc-softmmu,x86_64-softmmu,mips-softmmu,mipsel-softmmu,mips64-softmmu,mips64el-softmmu,arm-softmmu,m68k-softmmu,cris-softmmu,sh4-softmmu,sh4eb-softmmu PLIST_SUB+= DYNGEN="@comment " .else USE_GCC= 3.4 PLIST_SUB+= DYNGEN="" .endif -.if ${OSVERSION} < 600000 -# 5.x base gcc segfaults in target-mips/op_mem.c -BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34 -CC= gcc34 -.endif - WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} -CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} +CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} --disable-bsd-user .if defined(WITHOUT_SDL) CONFIGURE_ARGS+= --disable-sdl --disable-gfx-check @@ -77,6 +72,10 @@ LIB_DEPENDS+= gnutls:${PORTSDIR}/securit CONFIGURE_ARGS+= --enable-pcap .endif +.if defined(WITH_ADD_AUDIO) +CONFIGURE_ARGS+= --audio-card-list=ac97,adlib,cs4231a,gus +.endif + .if defined(WITH_SAMBA) RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba3 .endif Index: distinfo =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/distinfo,v retrieving revision 1.50 diff -u -p -r1.50 distinfo --- distinfo 8 Jul 2008 18:42:08 -0000 1.50 +++ distinfo 17 Nov 2008 19:41:01 -0000 @@ -1,3 +1,3 @@ -MD5 (qemu/qemu-snapshot-2008-06-20_19.tar.bz2) = 7201553586b59e400664b2f9ae0b17a1 -SHA256 (qemu/qemu-snapshot-2008-06-20_19.tar.bz2) = e9a3654976b923c471f572961f244f2758d15a367cfc1b32054aa2cd4391cace -SIZE (qemu/qemu-snapshot-2008-06-20_19.tar.bz2) = 2629290 +MD5 (qemu/qemu-snapshot-2008-11-17_20.tar.bz2) = 5ca9d93755c1f1d898a2e8220a68333e +SHA256 (qemu/qemu-snapshot-2008-11-17_20.tar.bz2) = d2481d112d63662c044bfc203d9405517bb8ae5b6887233deb31ff2a4df59d35 +SIZE (qemu/qemu-snapshot-2008-11-17_20.tar.bz2) = 2830803 Index: pkg-plist =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/pkg-plist,v retrieving revision 1.25 diff -u -p -r1.25 pkg-plist --- pkg-plist 8 Jul 2008 18:42:08 -0000 1.25 +++ pkg-plist 17 Nov 2008 19:39:45 -0000 @@ -10,8 +10,8 @@ bin/qemu-system-mipsel %%DYNGEN%%bin/qemu-system-ppc %%DYNGEN%%bin/qemu-system-ppc64 %%DYNGEN%%bin/qemu-system-ppcemb -%%DYNGEN%%bin/qemu-system-sh4 -%%DYNGEN%%bin/qemu-system-sh4eb +bin/qemu-system-sh4 +bin/qemu-system-sh4eb bin/qemu-system-sparc bin/qemu-system-x86_64 @unexec if cmp -s %D/etc/qemu-ifup.sample %D/etc/qemu-ifup; then rm -f %D/etc/qemu-ifup; fi @@ -30,6 +30,7 @@ etc/qemu-ifdown.sample %%DATADIR%%/openbios-sparc32 %%DATADIR%%/openbios-sparc64 %%DATADIR%%/video.x +%%DATADIR%%/pxe-e1000.bin %%DATADIR%%/pxe-ne2k_pci.bin %%DATADIR%%/pxe-rtl8139.bin %%DATADIR%%/pxe-pcnet.bin Index: files/patch-90_security =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-90_security,v retrieving revision 1.5 diff -u -p -r1.5 patch-90_security --- files/patch-90_security 8 Jul 2008 18:42:09 -0000 1.5 +++ files/patch-90_security 17 Nov 2008 19:43:34 -0000 @@ -115,10 +115,7 @@ Index: qemu-0.8.2/target-i386/translate. case 0xfa: /* cli */ if (!s->vm86) { if (s->cpl <= s->iopl) { -Index: qemu-0.8.2/vl.c -=================================================================== ---- qemu-0.8.2.orig/vl.c 2007-04-20 06:05:59.000000000 +0300 -+++ qemu-0.8.2/vl.c 2007-04-20 06:05:59.000000000 +0300 +Index: qemu-0.8.2/net.c @@ -3139,8 +3139,8 @@ typedef struct NetSocketState { VLANClientState *vc; int fd; @@ -157,23 +154,6 @@ Index: qemu-0.8.2/vl.c s->index += l; buf += l; size -= l; -Index: qemu/block.c -@@ -539,8 +539,15 @@ - return -ENOMEDIUM; - if (bs->read_only) - return -EACCES; -+ if (sector_num < 0) -+ return -EACCES; - if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { - memcpy(bs->boot_sector_data, buf, 512); -+ } -+ { -+ unsigned int ns = sector_num * 512; -+ if (ns < 0) -+ return -EACCES; - } - if (drv->bdrv_pwrite) { - int ret, len; Index: qemu/hw/i8259.c @@ -302,7 +302,8 @@ s->init4 = val & 1; Index: files/patch-CVE-2008-0928 =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-CVE-2008-0928,v retrieving revision 1.1 diff -u -p -r1.1 patch-CVE-2008-0928 --- files/patch-CVE-2008-0928 11 Mar 2008 23:34:13 -0000 1.1 +++ files/patch-CVE-2008-0928 17 Nov 2008 19:55:50 -0000 @@ -50,14 +50,7 @@ diff -u -p -u -p -r1.19 -r1.20 return ret; if (bdrv_pread(s->hd, 0, &magic, sizeof(magic)) != sizeof(magic)) Index: qemu/block.c -=================================================================== -RCS file: /sources/qemu/qemu/block.c,v -retrieving revision 1.54 -retrieving revision 1.55 -diff -u -p -u -p -r1.54 -r1.55 ---- block.c 10 Mar 2008 00:05:34 -0000 1.54 -+++ block.c 11 Mar 2008 17:17:58 -0000 1.55 -@@ -123,6 +123,60 @@ void path_combine(char *dest, int dest_s +@@ -122,6 +122,60 @@ void path_combine(char *dest, int dest_s } } @@ -118,7 +111,7 @@ diff -u -p -u -p -r1.54 -r1.55 static void bdrv_register(BlockDriver *bdrv) { -@@ -335,6 +389,10 @@ int bdrv_open2(BlockDriverState *bs, con +@@ -334,6 +388,10 @@ int bdrv_open2(BlockDriverState *bs, con bs->read_only = 0; bs->is_temporary = 0; bs->encrypted = 0; @@ -129,7 +122,7 @@ diff -u -p -u -p -r1.54 -r1.55 if (flags & BDRV_O_SNAPSHOT) { BlockDriverState *bs1; -@@ -379,6 +437,7 @@ int bdrv_open2(BlockDriverState *bs, con +@@ -390,6 +448,7 @@ int bdrv_open2(BlockDriverState *bs, con } bs->drv = drv; bs->opaque = qemu_mallocz(drv->instance_size); @@ -137,7 +130,7 @@ diff -u -p -u -p -r1.54 -r1.55 if (bs->opaque == NULL && drv->instance_size > 0) return -1; /* Note: for compatibility, we open disk image files as RDWR, and -@@ -444,6 +503,7 @@ void bdrv_close(BlockDriverState *bs) +@@ -455,6 +514,7 @@ void bdrv_close(BlockDriverState *bs) bs->drv = NULL; /* call the change callback */ @@ -145,25 +138,25 @@ diff -u -p -u -p -r1.54 -r1.55 bs->media_changed = 1; if (bs->change_cb) bs->change_cb(bs->change_opaque); -@@ -509,6 +569,8 @@ int bdrv_read(BlockDriverState *bs, int6 +@@ -527,6 +587,8 @@ int bdrv_read(BlockDriverState *bs, int6 if (!drv) return -ENOMEDIUM; + if (bdrv_rd_badreq_sectors(bs, sector_num, nb_sectors)) + return -EDOM; - if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { - memcpy(buf, bs->boot_sector_data, 512); - sector_num++; -@@ -549,6 +611,8 @@ int bdrv_write(BlockDriverState *bs, int + if (drv->bdrv_pread) { + int ret, len; + len = nb_sectors * 512; +@@ -559,6 +621,8 @@ int bdrv_write(BlockDriverState *bs, int return -ENOMEDIUM; if (bs->read_only) return -EACCES; + if (bdrv_wr_badreq_sectors(bs, sector_num, nb_sectors)) + return -EDOM; - if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { - memcpy(bs->boot_sector_data, buf, 512); - } -@@ -674,6 +738,8 @@ int bdrv_pread(BlockDriverState *bs, int + if (drv->bdrv_pwrite) { + int ret, len; + len = nb_sectors * 512; +@@ -681,6 +745,8 @@ int bdrv_pread(BlockDriverState *bs, int return -ENOMEDIUM; if (!drv->bdrv_pread) return bdrv_pread_em(bs, offset, buf1, count1); @@ -172,7 +165,7 @@ diff -u -p -u -p -r1.54 -r1.55 return drv->bdrv_pread(bs, offset, buf1, count1); } -@@ -689,6 +755,8 @@ int bdrv_pwrite(BlockDriverState *bs, in +@@ -696,6 +762,8 @@ int bdrv_pwrite(BlockDriverState *bs, in return -ENOMEDIUM; if (!drv->bdrv_pwrite) return bdrv_pwrite_em(bs, offset, buf1, count1); @@ -181,7 +174,7 @@ diff -u -p -u -p -r1.54 -r1.55 return drv->bdrv_pwrite(bs, offset, buf1, count1); } -@@ -955,6 +1023,8 @@ int bdrv_write_compressed(BlockDriverSta +@@ -987,6 +1055,8 @@ int bdrv_write_compressed(BlockDriverSta return -ENOMEDIUM; if (!drv->bdrv_write_compressed) return -ENOTSUP; @@ -190,40 +183,34 @@ diff -u -p -u -p -r1.54 -r1.55 return drv->bdrv_write_compressed(bs, sector_num, buf, nb_sectors); } -@@ -1101,6 +1171,8 @@ BlockDriverAIOCB *bdrv_aio_read(BlockDri +@@ -1133,6 +1203,8 @@ BlockDriverAIOCB *bdrv_aio_read(BlockDri if (!drv) return NULL; + if (bdrv_rd_badreq_sectors(bs, sector_num, nb_sectors)) + return NULL; - /* XXX: we assume that nb_sectors == 0 is suppored by the async read */ - if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { -@@ -1132,6 +1204,8 @@ BlockDriverAIOCB *bdrv_aio_write(BlockDr + ret = drv->bdrv_aio_read(bs, sector_num, buf, nb_sectors, cb, opaque); + +@@ -1156,6 +1228,8 @@ BlockDriverAIOCB *bdrv_aio_write(BlockDr return NULL; if (bs->read_only) return NULL; + if (bdrv_wr_badreq_sectors(bs, sector_num, nb_sectors)) + return NULL; - if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { - memcpy(bs->boot_sector_data, buf, 512); - } + + ret = drv->bdrv_aio_write(bs, sector_num, buf, nb_sectors, cb, opaque); + Index: qemu/block.h =================================================================== -RCS file: /sources/qemu/qemu/block.h,v -retrieving revision 1.6 -retrieving revision 1.7 -diff -u -p -u -p -r1.6 -r1.7 ---- block.h 24 Dec 2007 16:10:43 -0000 1.6 -+++ block.h 11 Mar 2008 17:17:59 -0000 1.7 -@@ -45,6 +45,7 @@ typedef struct QEMUSnapshotInfo { - it (default for +@@ -49,6 +49,7 @@ bdrv_file_open()) */ - #define BDRV_O_DIRECT 0x0020 -+#define BDRV_O_AUTOGROW 0x0040 /* Allow backing file to extend when writing past end of file */ + #define BDRV_O_NOCACHE 0x0020 /* do not use the host page cache */ + #define BDRV_O_CACHE_WB 0x0040 /* use write-back caching */ ++#define BDRV_O_AUTOGROW 0x0080 /* Allow backing file to extend when writing past end of file */ + + #define BDRV_O_CACHE_MASK (BDRV_O_NOCACHE | BDRV_O_CACHE_WB) - #ifndef QEMU_IMG - void bdrv_info(void); Index: qemu/block_int.h =================================================================== RCS file: /sources/qemu/qemu/block_int.h,v Index: files/patch-CVE-2008-4539 =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-CVE-2008-4539,v retrieving revision 1.1 diff -u -p -r1.1 patch-CVE-2008-4539 --- files/patch-CVE-2008-4539 2 Nov 2008 22:59:10 -0000 1.1 +++ files/patch-CVE-2008-4539 17 Nov 2008 19:39:45 -0000 @@ -1,27 +0,0 @@ -Index: qemu/hw/cirrus_vga.c -=================================================================== ---- trunk/hw/cirrus_vga.c 2008-11-01 00:53:30 UTC (rev 5586) -+++ trunk/hw/cirrus_vga.c 2008-11-01 00:53:39 UTC (rev 5587) -@@ -785,15 +785,14 @@ - - static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s) - { -+ if (BLTUNSAFE(s)) -+ return 0; -+ - if (s->ds->dpy_copy) { - cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->start_addr, - s->cirrus_blt_srcaddr - s->start_addr, - s->cirrus_blt_width, s->cirrus_blt_height); - } else { -- -- if (BLTUNSAFE(s)) -- return 0; -- - (*s->cirrus_rop) (s, s->vram_ptr + - (s->cirrus_blt_dstaddr & s->cirrus_addr_mask), - s->vram_ptr + - - - - Index: files/patch-be =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-be,v retrieving revision 1.6 diff -u -p -r1.6 patch-be --- files/patch-be 25 Mar 2007 16:33:01 -0000 1.6 +++ files/patch-be 17 Nov 2008 19:39:45 -0000 @@ -1,19 +0,0 @@ -Index: qemu/vl.c -@@ -541,7 +541,7 @@ - static void init_get_clock(void) - { - use_rt_clock = 0; --#if defined(__linux__) -+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) - { - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { -@@ -553,7 +553,7 @@ - - static int64_t get_clock(void) - { --#if defined(__linux__) -+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) - if (use_rt_clock) { - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); Index: files/patch-bg =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-bg,v retrieving revision 1.8 diff -u -p -r1.8 patch-bg --- files/patch-bg 3 Apr 2008 20:18:40 -0000 1.8 +++ files/patch-bg 17 Nov 2008 20:12:41 -0000 @@ -1,3 +1,13 @@ +Index: qemu/Makefile +@@ -11,7 +11,7 @@ + LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS) + + CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@ +-CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE ++CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSMBD_COMMAND=\"${LOCALBASE}/sbin/smbd\" -I${LOCALBASE}/include -DPREFIX=\"${PREFIX}\" + LIBS= + ifdef CONFIG_STATIC + LDFLAGS += -static Index: qemu/Makefile.target @@ -179,7 +179,7 @@ @@ -8,7 +18,7 @@ Index: qemu/Makefile.target LIBS+=-lm ifndef CONFIG_USER_ONLY LIBS+=-lz -Index: qemu/vl.c +Index: qemu/net.c @@ -133,10 +133,12 @@ -#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" Index: files/patch-block.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-block.c,v retrieving revision 1.5 diff -u -p -r1.5 patch-block.c --- files/patch-block.c 10 Mar 2007 17:03:05 -0000 1.5 +++ files/patch-block.c 17 Nov 2008 19:39:45 -0000 @@ -1,10 +0,0 @@ -Index: qemu/block.c -@@ -381,7 +381,7 @@ - else - open_flags = flags & ~(BDRV_O_FILE | BDRV_O_SNAPSHOT); - ret = drv->bdrv_open(bs, filename, open_flags); -- if (ret == -EACCES && !(flags & BDRV_O_FILE)) { -+ if ((ret == -EACCES || ret == -EPERM) && !(flags & BDRV_O_FILE)) { - ret = drv->bdrv_open(bs, filename, BDRV_O_RDONLY); - bs->read_only = 1; - } Index: files/patch-bsdusb.patch =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-bsdusb.patch,v retrieving revision 1.10 diff -u -p -r1.10 patch-bsdusb.patch --- files/patch-bsdusb.patch 11 Mar 2008 23:34:13 -0000 1.10 +++ files/patch-bsdusb.patch 17 Nov 2008 19:39:45 -0000 @@ -36,15 +36,15 @@ Index: qemu/configure for target in $target_list; do target_dir="$target" Index: qemu/Makefile -@@ -58,7 +58,7 @@ - OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o +@@ -75,7 +75,7 @@ + OBJS+=tmp105.o lm832x.o OBJS+=scsi-disk.o cdrom.o OBJS+=scsi-generic.o --OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o usb-serial.o -+OBJS+=usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o usb-serial.o +-OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o ++OBJS+=usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o + OBJS+=usb-serial.o usb-net.o OBJS+=sd.o ssi-sd.o - ifdef CONFIG_WIN32 Index: qemu/usb-stub.c @@ -0,0 +1,11 @@ +#include "vl.h" @@ -59,7 +59,7 @@ Index: qemu/usb-stub.c + return NULL; +} Index: qemu/usb-bsd.c -@@ -0,0 +1,601 @@ +@@ -0,0 +1,608 @@ +/* + * BSD host USB redirector + * @@ -87,6 +87,7 @@ Index: qemu/usb-bsd.c + */ + +#include "qemu-common.h" ++#include "console.h" +#include "hw/usb.h" + +/* usb.h declares these */ @@ -661,31 +662,9 @@ Index: qemu/usb-bsd.c +{ + usb_host_scan(NULL, usb_host_info_device); +} -Index: qemu/usb-linux.c -@@ -23,7 +23,6 @@ - */ - #include "vl.h" - --#if defined(__linux__) - #include - #include - #include -@@ -505,18 +504,3 @@ - { - usb_host_scan(NULL, usb_host_info_device); - } -- --#else -- --void usb_host_info(void) --{ -- term_printf("USB host devices not supported\n"); --} -- --/* XXX: modify configure to compile the right host driver */ --USBDevice *usb_host_device_open(const char *devname) --{ -- return NULL; --} -- --#endif ++ ++/* XXX add this */ ++int usb_host_device_close(const char *devname) ++{ ++ return 0; ++} Index: files/patch-bt =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-bt,v retrieving revision 1.6 diff -u -p -r1.6 patch-bt --- files/patch-bt 9 Aug 2007 20:03:30 -0000 1.6 +++ files/patch-bt 17 Nov 2008 19:39:45 -0000 @@ -1,4 +1,4 @@ -Index: qemu/vl.c +Index: qemu/net.c @@ -76,6 +76,11 @@ #endif #endif Index: files/patch-configure =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-configure,v retrieving revision 1.3 diff -u -p -r1.3 patch-configure --- files/patch-configure 3 Jun 2008 18:39:51 -0000 1.3 +++ files/patch-configure 17 Nov 2008 19:39:45 -0000 @@ -1,4 +1,13 @@ Index: qemu/configure +@@ -490,7 +490,7 @@ + if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then + AIOLIBS= + elif [ "$bsd" = "yes" ]; then +- AIOLIBS="-lpthread" ++# AIOLIBS="-lpthread" + else + # Some Linux architectures (e.g. s390) don't imply -lpthread automatically. + AIOLIBS="-lrt -lpthread" @@ -689,7 +689,7 @@ fi # test "$curses" Index: files/patch-cpu-exec.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-cpu-exec.c,v retrieving revision 1.5 diff -u -p -r1.5 patch-cpu-exec.c --- files/patch-cpu-exec.c 8 Jul 2008 18:42:09 -0000 1.5 +++ files/patch-cpu-exec.c 17 Nov 2008 19:39:45 -0000 @@ -1,27 +0,0 @@ -Index: qemu/cpu-exec.c -@@ -394,16 +394,18 @@ - (env->eflags & IF_MASK && - !(env->hflags & HF_INHIBIT_IRQ_MASK))))) { - int intno; -- svm_check_intercept(SVM_EXIT_INTR); - env->interrupt_request &= ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ); - intno = cpu_get_pic_interrupt(env); -- if (loglevel & CPU_LOG_TB_IN_ASM) { -- fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno); -+ if (intno>=0) { -+ svm_check_intercept(SVM_EXIT_INTR); -+ if (loglevel & CPU_LOG_TB_IN_ASM) { -+ fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno); -+ } -+ do_interrupt(intno, 0, 0, 0, 1); -+ /* ensure that no TB jump will be modified as -+ the program flow was changed */ -+ next_tb = 0; - } -- do_interrupt(intno, 0, 0, 0, 1); -- /* ensure that no TB jump will be modified as -- the program flow was changed */ -- next_tb = 0; - #if !defined(CONFIG_USER_ONLY) - } else if ((interrupt_request & CPU_INTERRUPT_VIRQ) && - (env->eflags & IF_MASK) && Index: files/patch-exec.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-exec.c,v retrieving revision 1.3 diff -u -p -r1.3 patch-exec.c --- files/patch-exec.c 8 Jul 2008 18:42:09 -0000 1.3 +++ files/patch-exec.c 17 Nov 2008 19:39:45 -0000 @@ -1,30 +0,0 @@ -Index: qemu/exec.c -@@ -405,6 +405,28 @@ - exit(1); - } - } -+#elif defined(__FreeBSD__) -+ { -+ int flags; -+ void *addr = NULL; -+ flags = MAP_PRIVATE | MAP_ANONYMOUS; -+#if defined(__x86_64__) -+ /* FreeBSD doesn't have MAP_32BIT, use MAP_FIXED and assume -+ * 0x40000000 is free */ -+ flags |= MAP_FIXED; -+ addr = (void *)0x40000000; -+ /* Cannot map more than that */ -+ if (code_gen_buffer_size > (800 * 1024 * 1024)) -+ code_gen_buffer_size = (800 * 1024 * 1024); -+#endif -+ code_gen_buffer = mmap(addr, code_gen_buffer_size, -+ PROT_WRITE | PROT_READ | PROT_EXEC, -+ flags, -1, 0); -+ if (code_gen_buffer == MAP_FAILED) { -+ fprintf(stderr, "Could not allocate dynamic translator buffer\n"); -+ exit(1); -+ } -+ } - #else - code_gen_buffer = qemu_malloc(code_gen_buffer_size); - if (!code_gen_buffer) { Index: files/patch-fbsd =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-fbsd,v retrieving revision 1.12 diff -u -p -r1.12 patch-fbsd --- files/patch-fbsd 8 Jul 2008 18:42:09 -0000 1.12 +++ files/patch-fbsd 17 Nov 2008 19:39:45 -0000 @@ -20,14 +20,14 @@ Index: qemu/Makefile rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ $(MAKE) -C tests clean Index: qemu/Makefile.target -@@ -651,8 +651,8 @@ +@@ -663,8 +663,8 @@ main.o: CFLAGS+=-p endif -$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a -- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) +- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) +$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a ../bsd/libmath.a -+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) ../bsd/libmath.a ++ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(OS_LDFLAGS) ../bsd/libmath.a endif # !CONFIG_USER_ONLY @@ -90,17 +90,16 @@ Index: qemu/fpu/softfloat-native.h #define fabsf(f) ((float)fabs(f)) #else #include -@@ -60,7 +80,9 @@ - /*---------------------------------------------------------------------------- +@@ -109,6 +109,8 @@ | Software IEC/IEEE floating-point rounding mode. *----------------------------------------------------------------------------*/ -#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) +#if (defined(_BSD) && !defined(__APPLE__) && \ -+ (!defined(__FreeBSD__) || __FreeBSD_version < 500000)) || \ -+ defined(HOST_SOLARIS) - enum { - float_round_nearest_even = FP_RN, - float_round_down = FP_RM, ++ (!defined(__FreeBSD__) || __FreeBSD_version < 500000)) || \ ++ defined(HOST_SOLARIS) + #if defined(__OpenBSD__) + #define FE_RM FP_RM + #define FE_RP FP_RP Index: qemu/fpu/softfloat.h @@ -84,7 +84,8 @@ #define FLOAT128 Index: files/patch-hw-vmware_vga.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-hw-vmware_vga.c,v retrieving revision 1.1 diff -u -p -r1.1 patch-hw-vmware_vga.c --- files/patch-hw-vmware_vga.c 2 May 2007 19:55:07 -0000 1.1 +++ files/patch-hw-vmware_vga.c 17 Nov 2008 19:39:45 -0000 @@ -10,3 +10,63 @@ Index: qemu/hw/vmware_vga.c #define HW_MOUSE_ACCEL #ifdef EMBED_STDVGA +@@ -76,6 +76,7 @@ + uint32_t wblue; + int syncing; + int fb_size; ++ int empty; + + union { + uint32_t *fifo; +@@ -487,7 +488,7 @@ + + static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s) + { +- if (!s->config || !s->enable) ++ if (!s->config || !s->enable || s->empty) + return 1; + return (s->cmd->next_cmd == s->cmd->stop); + } +@@ -495,6 +496,10 @@ + static inline uint32_t vmsvga_fifo_read_raw(struct vmsvga_state_s *s) + { + uint32_t cmd = s->fifo[CMD(stop) >> 2]; ++ if (s->cmd->next_cmd == s->cmd->stop) { ++ s->empty = 1; ++ return 0; ++ } + s->cmd->stop = cpu_to_le32(CMD(stop) + 4); + if (CMD(stop) >= CMD(max)) + s->cmd->stop = s->cmd->min; +@@ -512,6 +517,7 @@ + int args = 0; + int x, y, dx, dy, width, height; + struct vmsvga_cursor_definition_s cursor; ++ s->empty = 0; + while (!vmsvga_fifo_empty(s)) + switch (cmd = vmsvga_fifo_read(s)) { + case SVGA_CMD_UPDATE: +@@ -533,6 +539,7 @@ + vmsvga_fill_rect(s, colour, x, y, width, height); + break; + #else ++ args = 0; + goto badcmd; + #endif + +@@ -547,6 +554,7 @@ + vmsvga_copy_rect(s, x, y, dx, dy, width, height); + break; + #else ++ args = 0; + goto badcmd; + #endif + +@@ -609,6 +617,7 @@ + break; /* Nop */ + + default: ++ args = 0; + badcmd: + while (args --) + vmsvga_fifo_read(s); Index: files/patch-osdep.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-osdep.c,v retrieving revision 1.4 diff -u -p -r1.4 patch-osdep.c --- files/patch-osdep.c 8 Jul 2008 18:42:09 -0000 1.4 +++ files/patch-osdep.c 17 Nov 2008 19:39:45 -0000 @@ -1,43 +1,30 @@ Index: qemu/osdep.c -@@ -68,7 +68,9 @@ - - #if defined(USE_KQEMU) - +@@ -75,8 +75,10 @@ + #include + #include + #else +#ifndef __FreeBSD__ #include + #endif +#endif + #include #include - -@@ -79,6 +81,7 @@ - const char *tmpdir; - char phys_ram_file[1024]; +@@ -87,7 +87,7 @@ + static int phys_ram_size = 0; void *ptr; -+#ifndef __FreeBSD__ - #ifdef HOST_SOLARIS - struct statvfs stfs; + +-#ifdef __OpenBSD__ /* no need (?) for a dummy file on OpenBSD */ ++#if defined(__OpenBSD__) || defined(__FreeBSD__) /* no need (?) for a dummy file on OpenBSD/FreeBSD */ + int map_anon = MAP_ANON; #else -@@ -138,7 +141,9 @@ - } - unlink(phys_ram_file); + int map_anon = 0; +@@ -154,7 +154,7 @@ } -+#endif size = (size + 4095) & ~4095; -+#ifndef __FreeBSD__ ftruncate(phys_ram_fd, phys_ram_size + size); +-#endif /* !__OpenBSD__ */ ++#endif /* !(__OpenBSD__ || __FreeBSD__) */ ptr = mmap(NULL, size, -@@ -148,6 +153,13 @@ - fprintf(stderr, "Could not map physical memory\n"); - exit(1); - } -+#else -+ ptr = malloc(size); -+ if (ptr == NULL) { -+ fprintf(stderr, "Could not allocate physical memory\n"); -+ exit(1); -+ } -+#endif - phys_ram_size += size; - return ptr; - } + PROT_WRITE | PROT_READ, map_anon | MAP_SHARED, Index: files/patch-target-i386-translate.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-target-i386-translate.c,v retrieving revision 1.3 diff -u -p -r1.3 patch-target-i386-translate.c --- files/patch-target-i386-translate.c 8 Jul 2008 18:42:09 -0000 1.3 +++ files/patch-target-i386-translate.c 17 Nov 2008 19:39:45 -0000 @@ -1,16 +0,0 @@ -Index: qemu/target-i386/translate.c -@@ -3330,8 +3330,12 @@ - op1_offset = offsetof(CPUX86State,xmm_regs[reg]); - tcg_gen_addi_ptr(cpu_ptr0, cpu_env, op1_offset); - sse_op2 = sse_op_table3[(s->dflag == 2) * 2 + ((b >> 8) - 2)]; -- tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); -- tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_tmp2_i32); -+ if (ot == OT_LONG) { -+ tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); -+ tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_tmp2_i32); -+ } else { -+ tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_T[0]); -+ } - break; - case 0x02c: /* cvttps2pi */ - case 0x12c: /* cvttpd2pi */ Index: files/patch-tcg-i386-tcg-target.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-tcg-i386-tcg-target.c,v retrieving revision 1.1 diff -u -p -r1.1 patch-tcg-i386-tcg-target.c --- files/patch-tcg-i386-tcg-target.c 8 Jul 2008 18:42:09 -0000 1.1 +++ files/patch-tcg-i386-tcg-target.c 17 Nov 2008 19:39:45 -0000 @@ -1,28 +0,0 @@ -Index: qemu/tcg/i386/tcg-target.c -@@ -360,22 +360,22 @@ - case TCG_COND_LT: - tcg_out_brcond(s, TCG_COND_LT, args[1], args[3], const_args[3], args[5]); - tcg_out_jxx(s, JCC_JNE, label_next); -- tcg_out_brcond(s, TCG_COND_LT, args[0], args[2], const_args[2], args[5]); -+ tcg_out_brcond(s, TCG_COND_LTU, args[0], args[2], const_args[2], args[5]); - break; - case TCG_COND_LE: - tcg_out_brcond(s, TCG_COND_LT, args[1], args[3], const_args[3], args[5]); - tcg_out_jxx(s, JCC_JNE, label_next); -- tcg_out_brcond(s, TCG_COND_LE, args[0], args[2], const_args[2], args[5]); -+ tcg_out_brcond(s, TCG_COND_LEU, args[0], args[2], const_args[2], args[5]); - break; - case TCG_COND_GT: - tcg_out_brcond(s, TCG_COND_GT, args[1], args[3], const_args[3], args[5]); - tcg_out_jxx(s, JCC_JNE, label_next); -- tcg_out_brcond(s, TCG_COND_GT, args[0], args[2], const_args[2], args[5]); -+ tcg_out_brcond(s, TCG_COND_GTU, args[0], args[2], const_args[2], args[5]); - break; - case TCG_COND_GE: - tcg_out_brcond(s, TCG_COND_GT, args[1], args[3], const_args[3], args[5]); - tcg_out_jxx(s, JCC_JNE, label_next); -- tcg_out_brcond(s, TCG_COND_GE, args[0], args[2], const_args[2], args[5]); -+ tcg_out_brcond(s, TCG_COND_GEU, args[0], args[2], const_args[2], args[5]); - break; - case TCG_COND_LTU: - tcg_out_brcond(s, TCG_COND_LTU, args[1], args[3], const_args[3], args[5]); Index: files/patch-vl.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-vl.c,v retrieving revision 1.11 diff -u -p -r1.11 patch-vl.c --- files/patch-vl.c 8 Jul 2008 18:42:09 -0000 1.11 +++ files/patch-vl.c 17 Nov 2008 19:39:45 -0000 @@ -1,39 +1,20 @@ Index: qemu/vl.c -@@ -1727,6 +1728,7 @@ - chr->chr_ioctl = pp_ioctl; - return chr; - } -+#endif /* defined(__linux__) */ +@@ -9850,15 +9850,15 @@ + phys_ram_size += ram_size; + } - #else - CharDriverState *qemu_chr_open_pty(void) -@@ -2334,7 +2334,7 @@ - } - #endif ++ /* init the dynamic translator */ ++ cpu_exec_init_all(tb_size * 1024 * 1024); ++ + phys_ram_base = qemu_vmalloc(phys_ram_size); + if (!phys_ram_base) { + fprintf(stderr, "Could not allocate physical memory\n"); + exit(1); + } --#if defined(__linux__) || defined(__sun__) -+#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) - static CharDriverState *qemu_chr_open_pty(void) - { - struct termios tty; -@@ -3036,7 +3036,7 @@ - return qemu_chr_open_pp(filename); - } else - #endif --#if defined(__linux__) || defined(__sun__) -+#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) - if (strstart(filename, "/dev/", NULL)) { - return qemu_chr_open_tty(filename); - } else -@@ -8423,6 +8423,11 @@ - nb_nics = 0; - /* default mac address of the first network interface */ +- /* init the dynamic translator */ +- cpu_exec_init_all(tb_size * 1024 * 1024); +- + bdrv_init(emulate_aio); -+#ifdef __FreeBSD__ -+ if (modfind("aio") == -1) -+ fprintf(stderr, "warning: aio not (kld)loaded, may cause `Invalid system call' traps on disk IO\n"); -+#endif -+ - optind = 1; - for(;;) { - if (optind >= argc) + /* we always create the cdrom drive, even if no disk is there */ Index: files/patch-vl.c-ppbus =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-vl.c-ppbus,v retrieving revision 1.5 diff -u -p -r1.5 patch-vl.c-ppbus --- files/patch-vl.c-ppbus 9 Aug 2007 20:03:30 -0000 1.5 +++ files/patch-vl.c-ppbus 17 Nov 2008 19:39:45 -0000 @@ -1,20 +1,17 @@ -Index: qemu/vl.c -@@ -78,8 +78,10 @@ - #endif +Index: qemu/qemu-char.c +@@ -63,6 +63,8 @@ + #include #ifdef __FreeBSD__ - #include - #include - #include + #include +#include +#include + #else + #include #endif - - #if defined(CONFIG_SLIRP) -@@ -1728,7 +1730,64 @@ - chr->chr_ioctl = pp_ioctl; - return chr; +@@ -1268,6 +1270,65 @@ } --#endif /* defined(__linux__) */ + #endif /* __linux__ */ + +#if defined(__FreeBSD__) +static int pp_ioctl(CharDriverState *chr, int cmd, void *arg) +{ @@ -73,20 +70,18 @@ Index: qemu/vl.c + return chr; +} +#endif ++ + #else /* _WIN32 */ - #else - CharDriverState *qemu_chr_open_pty(void) -@@ -2562,6 +2622,13 @@ - #endif - #if defined(__linux__) + typedef struct { +@@ -2151,6 +2212,10 @@ if (strstart(filename, "/dev/parport", NULL)) { -+ return qemu_chr_open_pp(filename); -+ } else -+ if (strstart(filename, "/dev/", NULL)) { -+ return qemu_chr_open_tty(filename); -+ } else + chr = qemu_chr_open_pp(filename); + } else +#elif defined(__FreeBSD__) + if (strstart(filename, "/dev/ppi", NULL)) { - return qemu_chr_open_pp(filename); - } else - if (strstart(filename, "/dev/", NULL)) { ++ chr = qemu_chr_open_pp(filename); ++ } else + #endif + #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ + || defined(__NetBSD__) || defined(__OpenBSD__) Index: files/patch-vl.c-serial =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-vl.c-serial,v retrieving revision 1.2 diff -u -p -r1.2 patch-vl.c-serial --- files/patch-vl.c-serial 10 Mar 2007 17:03:05 -0000 1.2 +++ files/patch-vl.c-serial 17 Nov 2008 19:39:45 -0000 @@ -1,4 +1,4 @@ -Index: qemu/vl.c +Index: qemu/qemu-char.c @@ -1606,10 +1606,13 @@ cfsetospeed(&tty, spd); Index: files/pcap-patch =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/pcap-patch,v retrieving revision 1.1 diff -u -p -r1.1 pcap-patch --- files/pcap-patch 2 Aug 2008 18:29:39 -0000 1.1 +++ files/pcap-patch 17 Nov 2008 19:39:45 -0000 @@ -86,8 +86,7 @@ if test "$slirp" = "yes" ; then echo "CONFIG_SLIRP=yes" >> $config_mak echo "#define CONFIG_SLIRP 1" >> $config_h ---- vl.c.orig 2008-07-18 15:19:26.000000000 -0400 -+++ vl.c 2008-07-18 15:31:25.000000000 -0400 +Index: net.c @@ -102,6 +102,13 @@ int inet_aton(const char *cp, struct in_addr *ia); #endif @@ -284,6 +283,8 @@ #ifdef CONFIG_SLIRP if (!strcmp(device, "user")) { if (get_param_value(buf, sizeof(buf), "hostname", p)) { +--- vl.c.orig 2008-07-18 15:19:26.000000000 -0400 ++++ vl.c 2008-07-18 15:31:25.000000000 -0400 @@ -7398,6 +7575,10 @@ "Network options:\n" "-net nic[,vlan=n][,macaddr=addr][,model=type]\n" Index: files/patch-emulate-aio @@ -0,0 +1,117 @@ +Index: qemu/block.h +@@ -53,10 +53,9 @@ + + #define BDRV_O_CACHE_MASK (BDRV_O_NOCACHE | BDRV_O_CACHE_WB) + +-void bdrv_info(void); ++void bdrv_init(int emulate_aio); + void bdrv_info_stats(void); + +-void bdrv_init(void); + BlockDriver *bdrv_find_format(const char *format_name); + int bdrv_create(BlockDriver *drv, + const char *filename, int64_t size_in_sectors, +Index: qemu/block.c +@@ -177,9 +177,9 @@ + } + + +-static void bdrv_register(BlockDriver *bdrv) ++static void bdrv_register(BlockDriver *bdrv, int emulate_aio) + { +- if (!bdrv->bdrv_aio_read) { ++ if (!bdrv->bdrv_aio_read || emulate_aio) { + /* add AIO emulation layer */ + bdrv->bdrv_aio_read = bdrv_aio_read_em; + bdrv->bdrv_aio_write = bdrv_aio_write_em; +@@ -1374,23 +1374,23 @@ + return async_ret; + } + +-void bdrv_init(void) ++void bdrv_init(int emulate_aio) + { +- bdrv_register(&bdrv_raw); +- bdrv_register(&bdrv_host_device); ++ bdrv_register(&bdrv_raw, emulate_aio); ++ bdrv_register(&bdrv_host_device, emulate_aio); + #ifndef _WIN32 +- bdrv_register(&bdrv_cow); ++ bdrv_register(&bdrv_cow, 0); + #endif +- bdrv_register(&bdrv_qcow); +- bdrv_register(&bdrv_vmdk); +- bdrv_register(&bdrv_cloop); +- bdrv_register(&bdrv_dmg); +- bdrv_register(&bdrv_bochs); +- bdrv_register(&bdrv_vpc); +- bdrv_register(&bdrv_vvfat); +- bdrv_register(&bdrv_qcow2); +- bdrv_register(&bdrv_parallels); +- bdrv_register(&bdrv_nbd); ++ bdrv_register(&bdrv_qcow, 0); ++ bdrv_register(&bdrv_vmdk, 0); ++ bdrv_register(&bdrv_cloop, 0); ++ bdrv_register(&bdrv_dmg, 0); ++ bdrv_register(&bdrv_bochs, 0); ++ bdrv_register(&bdrv_vpc, 0); ++ bdrv_register(&bdrv_vvfat, 0); ++ bdrv_register(&bdrv_qcow2, 0); ++ bdrv_register(&bdrv_parallels, 0); ++ bdrv_register(&bdrv_nbd, 0); + } + + void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb, +Index: qemu/vl.c +@@ -76,6 +76,10 @@ + #endif + #endif + #endif ++#ifdef __FreeBSD__ ++#include ++#include ++#endif + + #if defined(CONFIG_SLIRP) + #include "libslirp.h" +@@ -8884,6 +8884,7 @@ + VLANState *vlan; + int autostart; + const char *incoming = NULL; ++ int emulate_aio = 0; + + LIST_INIT (&vm_change_state_head); + #ifndef _WIN32 +@@ -8957,6 +8958,13 @@ + tb_size = 0; + autostart= 1; + ++#ifdef __FreeBSD__ ++ if (modfind("aio") == -1) { ++ emulate_aio = 1; ++ fprintf(stderr, "warning: aio not (kld)loaded, disabling (may slow down on disk IO)\n"); ++ } ++#endif ++ + optind = 1; + for(;;) { + if (optind >= argc) +@@ -9692,7 +9700,7 @@ + /* init the dynamic translator */ + cpu_exec_init_all(tb_size * 1024 * 1024); + +- bdrv_init(); ++ bdrv_init(emulate_aio); + + /* we always create the cdrom drive, even if no disk is there */ + +Index: qemu/qemu-img.c +@@ -733,7 +733,7 @@ + { + const char *cmd; + +- bdrv_init(); ++ bdrv_init(1); + if (argc < 2) + help(); + cmd = argv[1];