o update to 0.9.1, lots from brad@

o see http://qemu.org/changelog.html for details
o see README.OpenBSD for an intro to qemu on OpenBSD
o disable broken arm host support for now
This commit is contained in:
todd 2008-04-28 22:52:38 +00:00
parent d3c9529769
commit 2feda3c1f5
32 changed files with 517 additions and 544 deletions

View File

@ -1,19 +1,18 @@
# $OpenBSD: Makefile,v 1.31 2008/04/01 08:51:18 ajacoutot Exp $ # $OpenBSD: Makefile,v 1.32 2008/04/28 22:52:38 todd Exp $
# no success building on other archs yet # no success building on other archs yet
ONLY_FOR_ARCHS= amd64 arm i386 powerpc ONLY_FOR_ARCHS= amd64 i386 powerpc
COMMENT= multi system emulator COMMENT= multi system emulator
DISTNAME= qemu-0.9.0 DISTNAME= qemu-0.9.1
PKGNAME= ${DISTNAME}p5
CATEGORIES= emulators CATEGORIES= emulators
HOMEPAGE= http://fabrice.bellard.free.fr/qemu/ HOMEPAGE= http://fabrice.bellard.free.fr/qemu/
MAINTAINER= Todd T. Fries <todd@openbsd.org> MAINTAINER= Todd T. Fries <todd@openbsd.org>
# GPLv2 - LGPL # GPLv2/LGPLv2/BSD
PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_CDROM= Yes
@ -23,8 +22,10 @@ MASTER_SITES= ${HOMEPAGE}
BUILD_DEPENDS= ::textproc/texi2html BUILD_DEPENDS= ::textproc/texi2html
USE_GMAKE= Yes USE_GMAKE= Yes
WANTLIB= m z ossaudio c WANTLIB= c m ossaudio z
CONFIGURE_STYLE= gnu CONFIGURE_STYLE= simple
CONFIGURE_ARGS+= --prefix=${PREFIX} \
--disable-vnc-tls
# Currently, the regression tests are utterly broken. # Currently, the regression tests are utterly broken.
REGRESS_TARGET= test test2 REGRESS_TARGET= test test2
@ -36,17 +37,14 @@ PATCH_LIST= patch-* misc-*
FLAVORS= no_x11 FLAVORS= no_x11
FLAVOR?= FLAVOR?=
CONFIGURE_ENV+= USE_KQEMU=yes
.if ${FLAVOR:L:Mno_x11} .if ${FLAVOR:L:Mno_x11}
CONFIGURE_ARGS+= --disable-gfx-check \ CONFIGURE_ARGS+= --disable-gfx-check \
--disable-sdl --disable-sdl
.else .else
LIB_DEPENDS= SDL::devel/sdl \ LIB_DEPENDS= SDL::devel/sdl
aa::graphics/aalib
USE_X11= Yes USE_X11= Yes
WANTLIB+= X11 Xext pthread usbhid WANTLIB+= pthread
.endif .endif
pre-configure: pre-configure:
@ -55,5 +53,8 @@ pre-configure:
post-install: post-install:
@${INSTALL_DATA_DIR} ${PREFIX}/share/examples/qemu @${INSTALL_DATA_DIR} ${PREFIX}/share/examples/qemu
@${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup ${PREFIX}/share/examples/qemu @${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup ${PREFIX}/share/examples/qemu
@${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown ${PREFIX}/share/examples/qemu
@${INSTALL_DATA_DIR} ${PREFIX}/share/doc/qemu
@${INSTALL_SCRIPT} ${FILESDIR}/README.OpenBSD ${PREFIX}/share/doc/qemu
.include <bsd.port.mk> .include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (qemu-0.9.0.tar.gz) = ab11a03ba30cf4a70641f0f170473d69 MD5 (qemu-0.9.1.tar.gz) = ZZHfjpJw6zWMiB3k6+oSYg==
RMD160 (qemu-0.9.0.tar.gz) = 4296542b6da18a6ac93d20787330d3c1c2ac0a19 RMD160 (qemu-0.9.1.tar.gz) = 7nvbVaRUDfIILUvenr/S9ObyAaU=
SHA1 (qemu-0.9.0.tar.gz) = 1e57e48a06eb8729913d92601000466eecef06cb SHA1 (qemu-0.9.1.tar.gz) = Yw6iC1mJ8N8AEo3n975mHFc+0EE=
SHA256 (qemu-0.9.0.tar.gz) = 491facf9335654967ee53d8fb3540a274bfcbdcc225506bd38c4ee8e9ab405c1 SHA256 (qemu-0.9.1.tar.gz) = R1bQtKTcfdiDVLxrN9OB5EYt0yjQ/u+UgD6QwEVYNaU=
SIZE (qemu-0.9.0.tar.gz) = 1901741 SIZE (qemu-0.9.1.tar.gz) = 2804104

View File

@ -0,0 +1,176 @@
README for OpenBSD users
------------------------
==> Quick Start
1. get a bootable floppy image
2. qemu-img create -f qcow2 virtual.hd 10G
3. qemu -m 32 -fda floppy.fs -boot a -monitor stdio virtual.hd
(initial install to hard drive)
4. qemu-img convert -c -O qcow2 virtual.hd tmp && mv tmp virtual.hd
(compress hard drive while qemu is not running)
5. qemu -m 32 -monitor stdio virtual.hd
(normal boot from hard drive)
==> Networking
1. Default Settings
By default, qemu sets up the equivalent of the following networking:
-net nic,vlan=0,model=ne2k_pci,macaddr=52:54:00:12:34:56
-net user,vlan=0
Also, inside this virtual usermode network, it uses the 10.0.2.0/24 and
serves dhcp from inside this virtual network. Static address can be used
if one cannot or does not want to do dhcp in the guest os:
Guest OS IP : 10.0.2.15
Default Gateway : 10.0.2.2
Nameserver : 10.0.2.3
It is sufficient for most operations, qemu itself performs NAT and then
makes userland network calls for tcp/udp operations. icmp and other things
are not possible in this mode.
It is recommended to use this if at all possible, because other options
involve running qemu as root.
Note: If you use one '-net' cmdline argument, qemu assumes you know what you
want and clears defaults for the rest of the -net defaults.
Note: The guest mode networking does not currently support IPv6, and
qemu will complain that it cannot find a dns server if /etc/resolv.conf
contains only IPv6 dns servers.
2. tap mode
Sometimes it is desirable to configure qemu to access a network via layer2
directly. This has the side effect that currently it requires root
privileges to open and configure /dev/tunN. There is no way to drop from
root privileges at this point.
%SYSCONFDIR%/qemu-ifup contains some default settings that permit one to do
the following:
# qemu -net nic -net tap virtual.hd
It presumes you have a 'trunk0' interface you wish the tun(4) interface to
talk to. It presumes you want 'bridge0' to be used to bridge the two.
If you wish to over-ride these settings, setting the environment variables
ETHER and BRIDGE will over-ride these settings, respectively.
When starting qemu, the script attempts to output useful information, but
there are also error messages that occur as well. On my laptop, I want to
route / nat natively using pf and also have layer2 access to the qemu
networks. I thus have this as /etc/hostname.trunk101:
inet6 fe80::1c 64 lladdr 00:03:25:0d:7a:2c
inet 10.7.255.1 255.255.255.0
inet6 alias 2001:240:58a:45::1c
I have dhcpd configured to run on trunk101, and also run rtadvd. For qemu,
the startup looks like this:
# export ETHER=trunk101
# export BRIDGE=bridge101
# qemu -net nic,vlan=0,model=rtl8139,macaddr=52:54:00:12:35:00 \
-net tap,vlan=0 -vnc :0 -localtime -usb -usbdevice tablet \
-m 256 -hda virtual.hd -monitor stdio
{tun0 (bridge101 <-> trunk101)brconfig: bridge101: No such process
brconfig: bridge101: No such process
}
(qemu)
The errors are normal and should be ignored. One can verify the networking
is properly configured by verifying the bridge interface:
$ brconfig bridge101
bridge101: flags=41<UP,RUNNING>
priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp
designated: id 00:00:00:00:00:00 priority 0
tun0 flags=3<LEARNING,DISCOVER>
port 16 ifpriority 0 ifcost 0
trunk101 flags=3<LEARNING,DISCOVER>
port 6 ifpriority 0 ifcost 0
Addresses (max cache: 100, timeout: 240):
Note: when running multiple qemu sessions simultaneously on the same bridge,
care must be taken because the network mac address defaults
to 52:54:00:12:34:56 for every qemu instance. To change this, observe
the macaddr= syntax in the above example.
==> Mice
Note: Certain m$ os's work so much better with the tablet usb device than
the normal ps2 mouse handling. See the above example for usage.
==> Serial Console
1. Installing OpenBSD via serial console is sometimes desirable. X may not
be available, and so on. There are two ways to accomplish this, both in
effect the same solution:
a. qemu -vnc :0 -serial stdio .. virtual.hd -cdrom install43.iso -boot d
- this option permits you to use vnc from some system to connect to
the qemu instance and 'set tty com0' at the 'boot>' prompt.
- you may then disconnect vnc and use the terminal from which you
started qemu to do the install
b. qemu -nographic .. virtual.hd -fda floppy43.fs -boot a
- this maps both the serial port and the (qemu) monitor prompt to
the terminal qemu was started on
- to flip between them, Ctrl-a c; see the qemu man page for other
commands that work in -nographic mode.
- preparation of the floppy image to force serial console mode is
straightforward:
vnconfig svnd0 floppy43.fs
mount /dev/svnd0c /mnt
mkdir /mnt/etc
echo set tty com0 > /mnt/etc/boot.conf
umount /mnt
vnconfig -u svnd0
.. be sure to choose 'yes' for setting com0 to be the serial console.
Note: OpenBSD poweroff does work with qemu, which actually causes qemu
itself to exit. This is a good thing, as it is currently not possible to
set what block device is booted from at runtime from qemu. So if you start
an installation booting from a cdrom, you will always boot off a cdrom
every time you reboot that qemu session until you exit and start qemu
again booting off the virtual hard drive.
==> daemonized qemu
Sometimes you want qemu to start as part of a system script.
Adding to some of the above, the -daemonize option comes in handy,
as well as the telnet: designator for -serial and monitor. This
is a complete example that may be cut-and-pasted into rc.local:
hddir=/var/vm
if [ -x /usr/local/bin/qemu ]; then
echo -n 'Qemu: vmi386'
(
export ETHER=trunk101
export BRIDGE=bridge101
/usr/local/bin/qemu \
-daemonize \
-nographic \
-net nic,vlan=0,model=rtl8139,macaddr=52:54:00:4e:62:8f \
-net tap,vlan=0 \
-m 128 \
-hda $hddir/vmi386.hd \
-serial telnet:127.0.0.1:1010,server,nowait \
-monitor telnet:127.0.0.1:1011,server,nowait
)
echo "."
fi

View File

@ -0,0 +1,14 @@
#! /bin/sh
_ETHER=trunk0
_BRIDGE=bridge0
# Let the environment over-ride this
[ "$BRIDGE" ] || BRIDGE=${_BRIDGE}
[ "$ETHER" ] || ETHER=${_ETHER}
if test `id -u` -ne 0; then
SUDO=sudo
fi
$SUDO brconfig $brif del $1 > /dev/null 2>&1

View File

@ -1,11 +1,10 @@
$OpenBSD: misc-target-i386_helper_c,v 1.2 2008/01/19 23:53:58 todd Exp $ $OpenBSD: misc-target-i386_helper_c,v 1.3 2008/04/28 22:52:38 todd Exp $
--- target-i386/helper.c.orig Mon Feb 5 17:01:54 2007 --- target-i386/helper.c.orig Sun Jan 6 14:38:45 2008
+++ target-i386/helper.c Wed Jan 16 11:22:08 2008 +++ target-i386/helper.c Wed Apr 2 01:43:09 2008
@@ -3838,3 +3838,13 @@ void tlb_fill(target_ulong addr, int is_write, int is_ @@ -3954,6 +3954,16 @@ void tlb_fill(target_ulong addr, int is_write, int mmu
}
env = saved_env; env = saved_env;
} }
+
+void helper_fchs_ST0(void) +void helper_fchs_ST0(void)
+{ +{
+ ST0 = floatx_chs(ST0); + ST0 = floatx_chs(ST0);
@ -15,3 +14,7 @@ $OpenBSD: misc-target-i386_helper_c,v 1.2 2008/01/19 23:53:58 todd Exp $
+{ +{
+ ST0 = floatx_abs(ST0); + ST0 = floatx_abs(ST0);
+} +}
+
/* Secure Virtual Machine helpers */

View File

@ -1,7 +1,7 @@
$OpenBSD: misc-target-i386_op_c,v 1.2 2008/01/19 23:53:58 todd Exp $ $OpenBSD: misc-target-i386_op_c,v 1.3 2008/04/28 22:52:38 todd Exp $
--- target-i386/op.c.orig Mon Feb 5 17:01:54 2007 --- target-i386/op.c.orig Sun Jan 6 14:38:45 2008
+++ target-i386/op.c Wed Jan 16 11:22:08 2008 +++ target-i386/op.c Wed Apr 2 01:43:10 2008
@@ -2164,12 +2164,12 @@ void OPPROTO op_fdivr_STN_ST0(void) @@ -2214,12 +2214,12 @@ void OPPROTO op_fdivr_STN_ST0(void)
/* misc FPU operations */ /* misc FPU operations */
void OPPROTO op_fchs_ST0(void) void OPPROTO op_fchs_ST0(void)
{ {

View File

@ -1,17 +1,8 @@
$OpenBSD: patch-Makefile,v 1.6 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-Makefile,v 1.7 2008/04/28 22:52:38 todd Exp $
--- Makefile.orig Mon Feb 5 17:01:54 2007 --- Makefile.orig Sun Jan 6 14:38:41 2008
+++ Makefile Tue Mar 20 19:21:54 2007 +++ Makefile Tue Apr 1 01:33:38 2008
@@ -27,7 +27,7 @@ endif @@ -149,7 +149,7 @@ clean:
ifndef CONFIG_DARWIN rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d
ifndef CONFIG_WIN32
ifndef CONFIG_SOLARIS
-LIBS+=-lrt
+#LIBS+=-lrt
endif
endif
endif
@@ -51,7 +51,7 @@ clean:
rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
$(MAKE) -C tests clean $(MAKE) -C tests clean
for d in $(TARGET_DIRS); do \ for d in $(TARGET_DIRS); do \
- $(MAKE) -C $$d $@ || exit 1 ; \ - $(MAKE) -C $$d $@ || exit 1 ; \
@ -19,7 +10,7 @@ $OpenBSD: patch-Makefile,v 1.6 2007/05/01 12:55:14 todd Exp $
done done
distclean: clean distclean: clean
@@ -106,7 +106,7 @@ cscope: @@ -206,7 +206,7 @@ cscope:
# documentation # documentation
%.html: %.texi %.html: %.texi

View File

@ -1,7 +1,24 @@
$OpenBSD: patch-Makefile_target,v 1.11 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-Makefile_target,v 1.12 2008/04/28 22:52:38 todd Exp $
--- Makefile.target.orig Mon Feb 5 17:01:54 2007 --- Makefile.target.orig Sun Jan 6 14:38:41 2008
+++ Makefile.target Tue Apr 3 08:21:24 2007 +++ Makefile.target Wed Apr 9 23:28:03 2008
@@ -150,7 +150,7 @@ BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld @@ -136,11 +136,11 @@ endif
endif
endif
-ifeq ($(ARCH),x86_64)
- ifneq ($(CONFIG_SOLARIS),yes)
- BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
- endif
-endif
+#ifeq ($(ARCH),x86_64)
+# ifneq ($(CONFIG_SOLARIS),yes)
+# BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+# endif
+#endif
ifeq ($(ARCH),ppc)
CPPFLAGS+= -D__powerpc__
@@ -188,7 +188,7 @@ BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif endif
ifeq ($(ARCH),arm) ifeq ($(ARCH),arm)
@ -10,8 +27,8 @@ $OpenBSD: patch-Makefile_target,v 1.11 2007/05/01 12:55:14 todd Exp $
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif endif
@@ -163,6 +163,12 @@ ifeq ($(ARCH),mips) @@ -215,6 +215,16 @@ BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif
endif endif
+# Very important for this 'ifeq' block to be after other +# Very important for this 'ifeq' block to be after other
@ -20,10 +37,14 @@ $OpenBSD: patch-Makefile_target,v 1.11 2007/05/01 12:55:14 todd Exp $
+OP_CFLAGS+= -fno-stack-protector +OP_CFLAGS+= -fno-stack-protector
+endif +endif
+ +
ifeq ($(HAVE_GCC3_OPTIONS),yes) +ifdef CONFIG_OSS_LIBRARY
# very important to generate a return at the end of every operation +LIBS+=-lossaudio
OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls +endif
@@ -182,6 +188,7 @@ OP_CFLAGS+=$(OS_CFLAGS) +
ifeq ($(CONFIG_DARWIN),yes)
LIBS+=-lmx
endif
@@ -232,6 +242,7 @@ OP_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
######################################################### #########################################################
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
@ -31,22 +52,31 @@ $OpenBSD: patch-Makefile_target,v 1.11 2007/05/01 12:55:14 todd Exp $
LIBS+=-lm LIBS+=-lm
ifndef CONFIG_USER_ONLY ifndef CONFIG_USER_ONLY
LIBS+=-lz LIBS+=-lz
@@ -329,6 +336,9 @@ endif @@ -537,7 +548,7 @@ endif
SOUND_HW = sb16.o es1370.o
AUDIODRV = audio.o noaudio.o wavaudio.o
+ifdef CONFIG_OSS_LIBRARY
+LIBS += -lossaudio
+endif
ifdef CONFIG_SDL
AUDIODRV += sdlaudio.o
endif
@@ -440,7 +450,7 @@ endif
ifndef CONFIG_DARWIN ifndef CONFIG_DARWIN
ifndef CONFIG_WIN32 ifndef CONFIG_WIN32
ifndef CONFIG_SOLARIS ifndef CONFIG_SOLARIS
-VL_LIBS=-lutil -lrt -VL_LIBS+=-lutil
+#VL_LIBS=-lutil -lrt +#VL_LIBS+=-lutil
endif endif
endif endif
endif endif
@@ -557,12 +568,12 @@ ifeq ($(ARCH),sparc64)
endif
endif
-ifeq ($(ARCH),x86_64)
- VL_LDFLAGS+=-m64
- ifneq ($(CONFIG_SOLARIS),yes)
- VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
- endif
-endif
+#ifeq ($(ARCH),x86_64)
+# VL_LDFLAGS+=-m64
+# ifneq ($(CONFIG_SOLARIS),yes)
+# VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+# endif
+#endif
ifdef CONFIG_WIN32
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-audio_ossaudio_c,v 1.3 2007/05/01 12:55:14 todd Exp $
--- audio/ossaudio.c.orig Mon Feb 5 17:01:54 2007
+++ audio/ossaudio.c Sat Mar 10 16:39:38 2007
@@ -21,10 +21,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#include <stdlib.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/ioctl.h>
+#ifdef __OpenBSD__
+#include <soundcard.h>
+#else
#include <sys/soundcard.h>
+#endif
#include "vl.h"
#define AUDIO_CAP "oss"

View File

@ -1,27 +0,0 @@
$OpenBSD: patch-block-qcow2_c,v 1.1 2007/05/01 12:55:14 todd Exp $
--- block-qcow2.c.orig Mon Feb 5 17:01:54 2007
+++ block-qcow2.c Fri Apr 6 13:05:45 2007
@@ -1884,6 +1884,8 @@ static int grow_refcount_table(BlockDriverState *bs, i
int new_table_size, new_table_size2, refcount_table_clusters, i, ret;
uint64_t *new_table;
int64_t table_offset;
+ int old_table_size;
+ int64_t old_table_offset;
uint64_t data64;
uint32_t data32;
@@ -1931,10 +1933,14 @@ static int grow_refcount_table(BlockDriverState *bs, i
&data32, sizeof(data32)) != sizeof(data32))
goto fail;
qemu_free(s->refcount_table);
+ old_table_offset = s->refcount_table_offset;
+ old_table_size = s->refcount_table_size;
s->refcount_table = new_table;
s->refcount_table_size = new_table_size;
+ s->refcount_table_offset = table_offset;
update_refcount(bs, table_offset, new_table_size2, 1);
+ free_clusters(bs, old_table_offset, old_table_size * sizeof(uint64_t));
return 0;
fail:
free_clusters(bs, table_offset, new_table_size2);

View File

@ -1,35 +1,29 @@
$OpenBSD: patch-block-raw_c,v 1.1 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-block-raw-posix_c,v 1.1 2008/04/28 22:52:38 todd Exp $
--- block-raw.c.orig Mon Feb 5 17:01:54 2007 --- block-raw-posix.c.orig Sun Jan 6 14:38:42 2008
+++ block-raw.c Tue Apr 3 08:21:25 2007 +++ block-raw-posix.c Tue Apr 1 22:38:47 2008
@@ -25,7 +25,9 @@ @@ -28,7 +28,9 @@
#endif
#include "block_int.h" #include "block_int.h"
#include <assert.h> #include <assert.h>
#ifndef _WIN32
+#ifndef CONFIG_NO_AIO +#ifndef CONFIG_NO_AIO
#include <aio.h> #include <aio.h>
+#endif +#endif
#ifndef QEMU_TOOL #ifdef CONFIG_COCOA
#include "exec-all.h" #include <paths.h>
@@ -53,10 +55,16 @@ @@ -55,6 +57,11 @@
#include <linux/cdrom.h> #ifdef __FreeBSD__
#include <linux/fd.h>
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__)
#include <sys/disk.h> #include <sys/disk.h>
#endif #endif
+#ifdef __OpenBSD__ +#ifdef __OpenBSD__
+#include <sys/ioctl.h> +#include <sys/ioctl.h>
+#include <sys/disklabel.h> +#include <sys/disklabel.h>
+#include <sys/dkio.h> +#include <sys/dkio.h>
+#endif +#endif
+
//#define DEBUG_FLOPPY //#define DEBUG_FLOPPY
#define FTYPE_FILE 0 @@ -231,6 +238,7 @@ label__raw_write__success:
@@ -158,6 +166,7 @@ static int raw_pwrite(BlockDriverState *bs, int64_t of
} }
/***********************************************************/ /***********************************************************/
@ -37,7 +31,7 @@ $OpenBSD: patch-block-raw_c,v 1.1 2007/05/01 12:55:14 todd Exp $
/* Unix AIO using POSIX AIO */ /* Unix AIO using POSIX AIO */
typedef struct RawAIOCB { typedef struct RawAIOCB {
@@ -380,6 +389,37 @@ static void raw_aio_cancel(BlockDriverAIOCB *blockacb) @@ -456,6 +464,37 @@ static void raw_aio_cancel(BlockDriverAIOCB *blockacb)
} }
} }
@ -61,8 +55,8 @@ $OpenBSD: patch-block-raw_c,v 1.1 2007/05/01 12:55:14 todd Exp $
+ +
+void qemu_aio_wait(void) +void qemu_aio_wait(void)
+{ +{
+#ifndef QEMU_TOOL +#ifndef QEMU_IMG
+ qemu_bh_poll(); + qemu_bh_poll();
+#endif +#endif
+} +}
+ +
@ -75,25 +69,25 @@ $OpenBSD: patch-block-raw_c,v 1.1 2007/05/01 12:55:14 todd Exp $
static void raw_close(BlockDriverState *bs) static void raw_close(BlockDriverState *bs)
{ {
BDRVRawState *s = bs->opaque; BDRVRawState *s = bs->opaque;
@@ -399,8 +439,25 @@ static int raw_truncate(BlockDriverState *bs, int64_t @@ -475,8 +514,25 @@ static int raw_truncate(BlockDriverState *bs, int64_t
return 0; return 0;
} }
+#ifdef __OpenBSD__ +#ifdef __OpenBSD__
static int64_t raw_getlength(BlockDriverState *bs) static int64_t raw_getlength(BlockDriverState *bs)
{ {
+ int fd = ((BDRVRawState*)bs->opaque)->fd; + int fd = ((BDRVRawState*)bs->opaque)->fd;
+ struct stat st; + struct stat st;
+ if(fstat(fd, &st)) + if (fstat(fd, &st))
+ return -1; + return -1;
+ if(S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)){ + if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) {
+ struct disklabel dl; + struct disklabel dl;
+ if(ioctl(fd, DIOCGDINFO, &dl)) + if (ioctl(fd, DIOCGDINFO, &dl))
+ return -1; + return -1;
+ return (uint64_t)dl.d_secsize * + return (uint64_t)dl.d_secsize *
+ dl.d_partitions[DISKPART(st.st_rdev)].p_size; + dl.d_partitions[DISKPART(st.st_rdev)].p_size;
+ }else + } else
+ return st.st_size; + return st.st_size;
+} +}
+#else /* !__OpenBSD__ */ +#else /* !__OpenBSD__ */
+static int64_t raw_getlength(BlockDriverState *bs) +static int64_t raw_getlength(BlockDriverState *bs)
@ -101,7 +95,7 @@ $OpenBSD: patch-block-raw_c,v 1.1 2007/05/01 12:55:14 todd Exp $
BDRVRawState *s = bs->opaque; BDRVRawState *s = bs->opaque;
int fd = s->fd; int fd = s->fd;
int64_t size; int64_t size;
@@ -445,6 +502,7 @@ static int64_t raw_getlength(BlockDriverState *bs) @@ -521,6 +577,7 @@ static int64_t raw_getlength(BlockDriverState *bs)
} }
return size; return size;
} }
@ -109,33 +103,31 @@ $OpenBSD: patch-block-raw_c,v 1.1 2007/05/01 12:55:14 todd Exp $
static int raw_create(const char *filename, int64_t total_size, static int raw_create(const char *filename, int64_t total_size,
const char *backing_file, int flags) const char *backing_file, int flags)
@@ -479,11 +537,13 @@ BlockDriver bdrv_raw = { @@ -555,11 +612,12 @@ BlockDriver bdrv_raw = {
raw_close, raw_close,
raw_create, raw_create,
raw_flush, raw_flush,
- -
+
+#ifndef CONFIG_NO_AIO +#ifndef CONFIG_NO_AIO
.bdrv_aio_read = raw_aio_read, .bdrv_aio_read = raw_aio_read,
.bdrv_aio_write = raw_aio_write, .bdrv_aio_write = raw_aio_write,
.bdrv_aio_cancel = raw_aio_cancel, .bdrv_aio_cancel = raw_aio_cancel,
.aiocb_size = sizeof(RawAIOCB), .aiocb_size = sizeof(RawAIOCB),
+#endif /* !CONFIG_NO_AIO */ +#endif
.protocol_name = "file", .protocol_name = "file",
.bdrv_pread = raw_pread, .bdrv_pread = raw_pread,
.bdrv_pwrite = raw_pwrite, .bdrv_pwrite = raw_pwrite,
@@ -815,11 +875,13 @@ BlockDriver bdrv_host_device = { @@ -907,11 +965,12 @@ BlockDriver bdrv_host_device = {
raw_close, raw_close,
NULL, NULL,
raw_flush, raw_flush,
- -
+
+#ifndef CONFIG_NO_AIO +#ifndef CONFIG_NO_AIO
.bdrv_aio_read = raw_aio_read, .bdrv_aio_read = raw_aio_read,
.bdrv_aio_write = raw_aio_write, .bdrv_aio_write = raw_aio_write,
.bdrv_aio_cancel = raw_aio_cancel, .bdrv_aio_cancel = raw_aio_cancel,
.aiocb_size = sizeof(RawAIOCB), .aiocb_size = sizeof(RawAIOCB),
+#endif /* !CONFIG_NO_AIO */ +#endif
.bdrv_pread = raw_pread, .bdrv_pread = raw_pread,
.bdrv_pwrite = raw_pwrite, .bdrv_pwrite = raw_pwrite,
.bdrv_getlength = raw_getlength, .bdrv_getlength = raw_getlength,

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-configure,v 1.9 2008/01/19 23:53:58 todd Exp $ $OpenBSD: patch-configure,v 1.10 2008/04/28 22:52:38 todd Exp $
--- configure.orig Mon Feb 5 17:01:54 2007 --- configure.orig Sun Jan 6 14:38:42 2008
+++ configure Wed Jan 16 11:23:08 2008 +++ configure Thu Apr 10 01:34:20 2008
@@ -21,10 +21,10 @@ prefix="" @@ -21,10 +21,10 @@ prefix=""
interp_prefix="/usr/gnemul/qemu-%M" interp_prefix="/usr/gnemul/qemu-%M"
static="no" static="no"
@ -8,7 +8,7 @@ $OpenBSD: patch-configure,v 1.9 2008/01/19 23:53:58 todd Exp $
-cc="gcc" -cc="gcc"
+cc="${CC:-cc}" +cc="${CC:-cc}"
gcc3_search="yes" gcc3_search="yes"
gcc3_list="gcc-3.4 gcc34 gcc-3.3 gcc33 gcc-3.2 gcc32" gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
-host_cc="gcc" -host_cc="gcc"
+host_cc="${CC:-cc}" +host_cc="${CC:-cc}"
ar="ar" ar="ar"
@ -23,7 +23,7 @@ $OpenBSD: patch-configure,v 1.9 2008/01/19 23:53:58 todd Exp $
cpu="powerpc" cpu="powerpc"
;; ;;
mips) mips)
@@ -68,6 +68,9 @@ case "$cpu" in @@ -74,6 +74,9 @@ case "$cpu" in
x86_64|amd64) x86_64|amd64)
cpu="x86_64" cpu="x86_64"
;; ;;
@ -33,28 +33,37 @@ $OpenBSD: patch-configure,v 1.9 2008/01/19 23:53:58 todd Exp $
*) *)
cpu="unknown" cpu="unknown"
;; ;;
@@ -122,7 +125,11 @@ oss="yes" @@ -142,7 +145,11 @@ oss="yes"
;; ;;
OpenBSD) OpenBSD)
bsd="yes" bsd="yes"
+openbsd="yes" +openbsd="yes"
oss="yes" oss="yes"
+if [ "$USE_KQEMU" = "yes" ] ; then +if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
+ kqemu="yes" + kqemu="yes"
+fi +fi
;; ;;
Darwin) Darwin)
bsd="yes" bsd="yes"
@@ -573,7 +580,7 @@ else @@ -329,7 +336,7 @@ else
if test -z "$prefix" ; then
prefix="/usr/local"
fi fi
-mandir="$prefix/share/man"
+mandir="$prefix/man" # default flags for all hosts
datadir="$prefix/share/qemu" -CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
docdir="$prefix/share/doc/qemu" +CFLAGS="$CFLAGS -Wall -g -fno-strict-aliasing"
bindir="$prefix/bin" LDFLAGS="$LDFLAGS -g"
@@ -601,9 +608,7 @@ if test "$darwin" = "yes" ; then if test "$werror" = "yes" ; then
CFLAGS="$CFLAGS -Werror"
@@ -680,7 +687,7 @@ else
if test -z "$prefix" ; then
prefix="/usr/local"
fi
- mansuffix="/share/man"
+ mansuffix="/man"
datasuffix="/share/qemu"
docsuffix="/share/doc/qemu"
binsuffix="/bin"
@@ -709,9 +716,7 @@ if test "$darwin" = "yes" ; then
echo "Cocoa support $cocoa" echo "Cocoa support $cocoa"
fi fi
echo "SDL support $sdl" echo "SDL support $sdl"
@ -65,15 +74,15 @@ $OpenBSD: patch-configure,v 1.9 2008/01/19 23:53:58 todd Exp $
echo "mingw32 support $mingw32" echo "mingw32 support $mingw32"
echo "Adlib support $adlib" echo "Adlib support $adlib"
echo "CoreAudio support $coreaudio" echo "CoreAudio support $coreaudio"
@@ -648,6 +653,7 @@ echo "mandir=$mandir" >> $config_mak @@ -772,6 +777,7 @@ echo "mandir=\${prefix}$mansuffix" >> $config_mak
echo "datadir=$datadir" >> $config_mak echo "datadir=\${prefix}$datasuffix" >> $config_mak
echo "docdir=$docdir" >> $config_mak echo "docdir=\${prefix}$docsuffix" >> $config_mak
echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
+echo "#define CONFIG_NO_AIO 1" >> $config_h +echo "#define CONFIG_NO_AIO 1" >> $config_h
echo "MAKE=$make" >> $config_mak echo "MAKE=$make" >> $config_mak
echo "INSTALL=$install" >> $config_mak echo "INSTALL=$install" >> $config_mak
echo "CC=$cc" >> $config_mak echo "CC=$cc" >> $config_mak
@@ -667,6 +673,9 @@ if test "$cpu" = "i386" ; then @@ -793,6 +799,9 @@ if test "$cpu" = "i386" ; then
elif test "$cpu" = "x86_64" ; then elif test "$cpu" = "x86_64" ; then
echo "ARCH=x86_64" >> $config_mak echo "ARCH=x86_64" >> $config_mak
echo "#define HOST_X86_64 1" >> $config_h echo "#define HOST_X86_64 1" >> $config_h
@ -83,7 +92,7 @@ $OpenBSD: patch-configure,v 1.9 2008/01/19 23:53:58 todd Exp $
elif test "$cpu" = "armv4b" ; then elif test "$cpu" = "armv4b" ; then
echo "ARCH=arm" >> $config_mak echo "ARCH=arm" >> $config_mak
echo "#define HOST_ARM 1" >> $config_h echo "#define HOST_ARM 1" >> $config_h
@@ -746,6 +755,9 @@ fi @@ -892,6 +901,9 @@ fi
if test "$oss" = "yes" ; then if test "$oss" = "yes" ; then
echo "CONFIG_OSS=yes" >> $config_mak echo "CONFIG_OSS=yes" >> $config_mak
echo "#define CONFIG_OSS 1" >> $config_h echo "#define CONFIG_OSS 1" >> $config_h
@ -93,9 +102,9 @@ $OpenBSD: patch-configure,v 1.9 2008/01/19 23:53:58 todd Exp $
fi fi
if test "$coreaudio" = "yes" ; then if test "$coreaudio" = "yes" ; then
echo "CONFIG_COREAUDIO=yes" >> $config_mak echo "CONFIG_COREAUDIO=yes" >> $config_mak
@@ -777,6 +789,13 @@ echo "TARGET_DIRS=$target_list" >> $config_mak @@ -952,6 +964,13 @@ if test "$cocoa" = "yes" ; then
if [ "$build_docs" = "yes" ] ; then echo "#define CONFIG_COCOA 1" >> $config_h
echo "BUILD_DOCS=yes" >> $config_mak echo "CONFIG_COCOA=yes" >> $config_mak
fi fi
+ +
+if [ "$openbsd" = "yes" ] ; then +if [ "$openbsd" = "yes" ] ; then

View File

@ -1,13 +1,13 @@
$OpenBSD: patch-cpu-all_h,v 1.2 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-cpu-all_h,v 1.3 2008/04/28 22:52:38 todd Exp $
--- cpu-all.h.orig Mon Feb 5 17:01:54 2007 --- cpu-all.h.orig Sun Jan 6 14:38:42 2008
+++ cpu-all.h Tue Apr 3 08:21:26 2007 +++ cpu-all.h Tue Apr 1 01:43:57 2008
@@ -1002,13 +1002,22 @@ static inline int64_t cpu_get_real_ticks (void) @@ -1008,13 +1008,22 @@ static inline int64_t cpu_get_real_ticks(void)
#endif
} }
#else #else
-/* The host CPU doesn't have an easily accessible cycle counter. -/* The host CPU doesn't have an easily accessible cycle counter.
- Just return a monotonically increasing vlue. This will be totally wrong, - Just return a monotonically increasing value. This will be
- but hopefully better than nothing. */ - totally wrong, but hopefully better than nothing. */
+# warning non-optimized CPU +# warning non-optimized CPU
+#include <sys/time.h> +#include <sys/time.h>
+#include <time.h> +#include <time.h>
@ -16,16 +16,16 @@ $OpenBSD: patch-cpu-all_h,v 1.2 2007/05/01 12:55:14 todd Exp $
{ {
- static int64_t ticks = 0; - static int64_t ticks = 0;
- return ticks++; - return ticks++;
+ struct timeval tv; + struct timeval tv;
+ static int64_t i = 0; + static int64_t i = 0;
+ int64_t j; + int64_t j;
+ +
+ gettimeofday(&tv, NULL); + gettimeofday(&tv, NULL);
+ do { + do {
+ j = (tv.tv_sec * (uint64_t) 1000000) + tv.tv_usec; + j = (tv.tv_sec * (uint64_t) 1000000) + tv.tv_usec;
+ } while (i == j); + } while (i == j);
+ i = j; + i = j;
+ return j; + return j;
} }
#endif #endif

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-cutils_c,v 1.1 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-cutils_c,v 1.2 2008/04/28 22:52:38 todd Exp $
--- cutils.c.orig Mon Feb 5 17:01:54 2007 --- cutils.c.orig Sun Jan 6 14:38:42 2008
+++ cutils.c Tue Apr 3 08:21:27 2007 +++ cutils.c Tue Apr 1 01:33:39 2008
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
*/ */
#include "vl.h" #include "qemu-common.h"
-void pstrcpy(char *buf, int buf_size, const char *str) -void pstrcpy(char *buf, int buf_size, const char *str)
+void pstrcpy(char *buf, size_t buf_size, const char *str) +void pstrcpy(char *buf, size_t buf_size, const char *str)

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-dyngen-exec_h,v 1.5 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-dyngen-exec_h,v 1.6 2008/04/28 22:52:38 todd Exp $
--- dyngen-exec.h.orig Mon Feb 5 17:01:54 2007 --- dyngen-exec.h.orig Sun Jan 6 14:38:42 2008
+++ dyngen-exec.h Sat Mar 10 16:39:39 2007 +++ dyngen-exec.h Tue Apr 1 01:40:00 2008
@@ -27,11 +27,15 @@ @@ -27,11 +27,15 @@
#define _FILEDEFED #define _FILEDEFED
#endif #endif
@ -12,7 +12,7 @@ $OpenBSD: patch-dyngen-exec_h,v 1.5 2007/05/01 12:55:14 todd Exp $
host headers do not allow that. */ host headers do not allow that. */
#include <stddef.h> #include <stddef.h>
- -
+#ifdef __OpenBSD__ +#ifdef _BSD
+#include <sys/types.h> +#include <sys/types.h>
+#else +#else
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
@ -26,19 +26,17 @@ $OpenBSD: patch-dyngen-exec_h,v 1.5 2007/05/01 12:55:14 todd Exp $
/* XXX: This may be wrong for 64-bit ILP32 hosts. */ /* XXX: This may be wrong for 64-bit ILP32 hosts. */
typedef void * host_reg_t; typedef void * host_reg_t;
@@ -78,11 +83,15 @@ typedef void * host_reg_t; @@ -82,12 +87,12 @@ typedef void * host_reg_t;
#define UINT32_MAX (4294967295U) typedef struct __sFILE FILE;
#define UINT64_MAX ((uint64_t)(18446744073709551615)) #else
+#ifdef __OpenBSD__
+typedef struct __sFILE FILE;
+#else
typedef struct FILE FILE; typedef struct FILE FILE;
-#endif
extern int fprintf(FILE *, const char *, ...); extern int fprintf(FILE *, const char *, ...);
extern int fputs(const char *, FILE *);
extern int printf(const char *, ...); extern int printf(const char *, ...);
#undef NULL #undef NULL
#define NULL 0 #define NULL 0
+#endif +#endif
#ifdef __i386__ #if defined(__i386__)
#define AREG0 "ebp" #define AREG0 "ebp"

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-exec_c,v 1.6 2007/05/01 12:55:14 todd Exp $
--- exec.c.orig Mon Feb 5 17:01:54 2007
+++ exec.c Tue Apr 3 08:21:30 2007
@@ -2027,7 +2027,7 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, u
target_phys_addr_t page;
unsigned long pd;
PhysPageDesc *p;
-
+
while (len > 0) {
page = addr & TARGET_PAGE_MASK;
l = (page + TARGET_PAGE_SIZE) - addr;

View File

@ -1,13 +1,13 @@
$OpenBSD: patch-fpu_softfloat-native_h,v 1.3 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-fpu_softfloat-native_h,v 1.4 2008/04/28 22:52:38 todd Exp $
--- fpu/softfloat-native.h.orig Mon Feb 5 17:01:54 2007 --- fpu/softfloat-native.h.orig Sun Jan 6 14:38:42 2008
+++ fpu/softfloat-native.h Sat Mar 10 16:39:40 2007 +++ fpu/softfloat-native.h Tue Apr 1 01:33:39 2008
@@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
/* Native implementation of soft float functions */ /* Native implementation of soft float functions */
+#include "gnu-c99-math.h" +#include "gnu-c99-math.h"
#include <math.h> #include <math.h>
#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) #if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
@@ -61,6 +62,11 @@ typedef union { @@ -84,6 +85,11 @@ typedef union {
| Software IEC/IEEE floating-point rounding mode. | Software IEC/IEEE floating-point rounding mode.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) #if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-hw_ne2000_c,v 1.4 2007/05/01 12:55:14 todd Exp $
--- hw/ne2000.c.orig Thu Apr 5 17:24:58 2007
+++ hw/ne2000.c Thu Apr 5 17:25:11 2007
@@ -206,7 +206,7 @@ static int ne2000_buffer_full(NE2000State *s)
index = s->curpag << 8;
boundary = s->boundary << 8;
- if (index <= boundary)
+ if (index < boundary)
avail = boundary - index;
else
avail = (s->stop - s->start) - (index - boundary);

View File

@ -1,47 +0,0 @@
$OpenBSD: patch-hw_pc_c,v 1.6 2007/05/01 12:55:14 todd Exp $
--- hw/pc.c.orig Mon Feb 5 17:01:54 2007
+++ hw/pc.c Fri Apr 6 13:07:38 2007
@@ -711,23 +711,36 @@ static void pc_init1(int ram_size, int vga_ram_size, i
if (i440fx_state) {
i440fx_init_memory_mappings(i440fx_state);
}
-#if 0
/* ??? Need to figure out some way for the user to
specify SCSI devices. */
- if (pci_enabled) {
+ if (pci_enabled && scsi_enabled) {
void *scsi;
BlockDriverState *bdrv;
scsi = lsi_scsi_init(pci_bus, -1);
- bdrv = bdrv_new("scsidisk");
- bdrv_open(bdrv, "scsi_disk.img", 0);
+ bdrv = bdrv_new("scsidisk0");
+ bdrv_open(bdrv, "scsi_disk0.img", 0);
lsi_scsi_attach(scsi, bdrv, -1);
- bdrv = bdrv_new("scsicd");
- bdrv_open(bdrv, "scsi_cd.iso", 0);
+ bdrv = bdrv_new("scsidisk1");
+ bdrv_open(bdrv, "scsi_disk1.img", 0);
+ lsi_scsi_attach(scsi, bdrv, -1);
+ bdrv = bdrv_new("scsidisk2");
+ bdrv_open(bdrv, "scsi_disk2.img", 0);
+ lsi_scsi_attach(scsi, bdrv, -1);
+ bdrv = bdrv_new("scsidisk3");
+ bdrv_open(bdrv, "scsi_disk3.img", 0);
+ lsi_scsi_attach(scsi, bdrv, -1);
+ bdrv = bdrv_new("scsidisk4");
+ bdrv_open(bdrv, "scsi_disk4.img", 0);
+ lsi_scsi_attach(scsi, bdrv, -1);
+ bdrv = bdrv_new("scsidisk5");
+ bdrv_open(bdrv, "scsi_disk5.img", 0);
+ lsi_scsi_attach(scsi, bdrv, -1);
+ bdrv = bdrv_new("scsicd0");
+ bdrv_open(bdrv, "scsi_cd0.iso", 0);
bdrv_set_type_hint(bdrv, BDRV_TYPE_CDROM);
lsi_scsi_attach(scsi, bdrv, -1);
}
-#endif
}
static void pc_init_pci(int ram_size, int vga_ram_size, int boot_device,

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-hw_pckbd_c,v 1.1 2008/04/28 22:52:38 todd Exp $
--- hw/pckbd.c.orig Thu Apr 10 01:20:44 2008
+++ hw/pckbd.c Thu Apr 10 01:21:00 2008
@@ -211,7 +211,7 @@ static void kbd_write_command(void *opaque, uint32_t a
#endif
switch(val) {
case KBD_CCMD_READ_MODE:
- kbd_queue(s, s->mode, 1);
+ kbd_queue(s, s->mode, 0);
break;
case KBD_CCMD_WRITE_MODE:
case KBD_CCMD_WRITE_OBUF:

View File

@ -1,8 +1,8 @@
$OpenBSD: patch-hw_rtl8139_c,v 1.3 2008/03/31 06:49:27 todd Exp $ $OpenBSD: patch-hw_rtl8139_c,v 1.4 2008/04/28 22:52:38 todd Exp $
--- hw/rtl8139.c.orig Fri Mar 21 16:19:01 2008 --- hw/rtl8139.c.orig Sun Jan 6 14:38:42 2008
+++ hw/rtl8139.c Fri Mar 21 16:19:18 2008 +++ hw/rtl8139.c Tue Apr 1 01:33:39 2008
@@ -58,7 +58,7 @@ @@ -60,7 +60,7 @@
//#define RTL8139_CALCULATE_RXCRC 1 #define RTL8139_CALCULATE_RXCRC 1
/* Uncomment to enable on-board timer interrupts */ /* Uncomment to enable on-board timer interrupts */
-//#define RTL8139_ONBOARD_TIMER 1 -//#define RTL8139_ONBOARD_TIMER 1

View File

@ -1,78 +0,0 @@
$OpenBSD: patch-monitor_c,v 1.1 2008/03/31 20:16:52 todd Exp $
--- monitor.c.orig Mon Mar 31 21:41:53 2008
+++ monitor.c Mon Mar 31 21:42:05 2008
@@ -362,6 +362,8 @@ static void do_eject(int force, const char *filename)
eject_device(bs, force);
}
+static int changing_rem_device;
+
static void do_change(const char *device, const char *filename)
{
BlockDriverState *bs;
@@ -377,6 +379,7 @@ static void do_change(const char *device, const char *
return;
bdrv_open(bs, filename, 0);
if (bdrv_is_encrypted(bs)) {
+ changing_rem_device=1;
term_printf("%s is encrypted.\n", device);
for(i = 0; i < 3; i++) {
monitor_readline("Password: ", 1, password, sizeof(password));
@@ -384,6 +387,7 @@ static void do_change(const char *device, const char *
break;
term_printf("invalid password\n");
}
+ changing_rem_device=0;
}
}
@@ -2441,6 +2445,8 @@ static void monitor_start_input(void)
readline_start("(qemu) ", 0, monitor_handle_command1, NULL);
}
+static int monitor_readline_started;
+
static void term_event(void *opaque, int event)
{
if (event != CHR_EVENT_RESET)
@@ -2449,7 +2455,8 @@ static void term_event(void *opaque, int event)
if (!hide_banner)
term_printf("QEMU %s monitor - type 'help' for more information\n",
QEMU_VERSION);
- monitor_start_input();
+ if (!monitor_readline_started)
+ monitor_start_input();
}
void monitor_init(CharDriverState *hd, int show_banner)
@@ -2462,7 +2469,6 @@ void monitor_init(CharDriverState *hd, int show_banner
/* XXX: use threads ? */
/* modal monitor readline */
-static int monitor_readline_started;
static char *monitor_readline_buf;
static int monitor_readline_buf_size;
@@ -2472,6 +2478,8 @@ static void monitor_readline_cb(void *opaque, const ch
monitor_readline_started = 0;
}
+void gui_update(void);
+
void monitor_readline(const char *prompt, int is_password,
char *buf, int buf_size)
{
@@ -2483,6 +2491,12 @@ void monitor_readline(const char *prompt, int is_passw
monitor_readline_buf_size = buf_size;
monitor_readline_started = 1;
while (monitor_readline_started) {
- main_loop_wait(10);
+ if (!changing_rem_device)
+ main_loop_wait(10);
+ else
+ gui_update();
}
+
+ if (!changing_rem_device)
+ monitor_start_input();
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-osdep_c,v 1.1 2008/01/19 23:53:58 todd Exp $ $OpenBSD: patch-osdep_c,v 1.2 2008/04/28 22:52:38 todd Exp $
--- osdep.c.orig Mon Feb 5 17:01:54 2007 --- osdep.c.orig Sun Jan 6 14:38:42 2008
+++ osdep.c Mon Jan 7 19:01:42 2008 +++ osdep.c Tue Apr 1 01:36:02 2008
@@ -79,7 +79,14 @@ void qemu_vfree(void *ptr) @@ -83,7 +83,14 @@ void qemu_vfree(void *ptr)
#if defined(USE_KQEMU) #if defined(USE_KQEMU)
@ -16,7 +16,7 @@ $OpenBSD: patch-osdep_c,v 1.1 2008/01/19 23:53:58 todd Exp $
#include <sys/mman.h> #include <sys/mman.h>
#include <fcntl.h> #include <fcntl.h>
@@ -87,9 +94,15 @@ void *kqemu_vmalloc(size_t size) @@ -91,9 +98,15 @@ static void *kqemu_vmalloc(size_t size)
{ {
static int phys_ram_fd = -1; static int phys_ram_fd = -1;
static int phys_ram_size = 0; static int phys_ram_size = 0;
@ -33,7 +33,7 @@ $OpenBSD: patch-osdep_c,v 1.1 2008/01/19 23:53:58 todd Exp $
#ifdef HOST_SOLARIS #ifdef HOST_SOLARIS
struct statvfs stfs; struct statvfs stfs;
#else #else
@@ -151,11 +164,13 @@ void *kqemu_vmalloc(size_t size) @@ -155,11 +168,13 @@ static void *kqemu_vmalloc(size_t size)
} }
unlink(phys_ram_file); unlink(phys_ram_file);
} }

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-osdep_h,v 1.3 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-osdep_h,v 1.4 2008/04/28 22:52:38 todd Exp $
--- osdep.h.orig Mon Feb 5 17:01:54 2007 --- osdep.h.orig Sun Jan 6 14:38:42 2008
+++ osdep.h Sat Mar 10 16:39:40 2007 +++ osdep.h Tue Apr 1 01:33:39 2008
@@ -2,6 +2,10 @@ @@ -2,6 +2,10 @@
#define QEMU_OSDEP_H #define QEMU_OSDEP_H
@ -10,5 +10,5 @@ $OpenBSD: patch-osdep_h,v 1.3 2007/05/01 12:55:14 todd Exp $
+#include <sys/signal.h> +#include <sys/signal.h>
+#endif +#endif
#define qemu_printf printf #ifndef glue
#define xglue(x, y) x ## y

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-qemu-common_h,v 1.1 2008/04/28 22:52:38 todd Exp $
--- qemu-common.h.orig Tue Apr 1 01:45:33 2008
+++ qemu-common.h Tue Apr 1 01:45:59 2008
@@ -77,8 +77,8 @@ int qemu_bh_poll(void);
uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
/* cutils.c */
-void pstrcpy(char *buf, int buf_size, const char *str);
-char *pstrcat(char *buf, int buf_size, const char *s);
+void pstrcpy(char *buf, size_t buf_size, const char *str);
+char *pstrcat(char *buf, size_t buf_size, const char *s);
int strstart(const char *str, const char *val, const char **ptr);
int stristart(const char *str, const char *val, const char **ptr);
time_t mktimegm(struct tm *tm);

View File

@ -1,17 +1,17 @@
$OpenBSD: patch-qemu-doc_texi,v 1.2 2008/03/31 14:26:00 todd Exp $ $OpenBSD: patch-qemu-doc_texi,v 1.3 2008/04/28 22:52:38 todd Exp $
--- qemu-doc.texi.orig Tue Feb 6 00:01:54 2007 --- qemu-doc.texi.orig Sun Jan 6 14:38:42 2008
+++ qemu-doc.texi Sun Feb 10 02:32:12 2008 +++ qemu-doc.texi Tue Apr 1 01:33:39 2008
@@ -461,7 +461,7 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windo @@ -632,7 +632,7 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windo
Then @file{dir} can be accessed in @file{\\smbserver\qemu}. Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
Note that a SAMBA server must be installed on the host OS in Note that a SAMBA server must be installed on the host OS in
-@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd version -@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd version
+@file{!!LOCALBASE!!/libexec/smbd}. QEMU was tested successfully with smbd version +@file{!!LOCALBASE!!/libexec/smbd}. QEMU was tested successfully with smbd version
2.2.7a from the Red Hat 9 and version 3.0.10-1.fc3 from Fedora Core 3. 2.2.7a from the Red Hat 9 and version 3.0.10-1.fc3 from Fedora Core 3.
@item -redir [tcp|udp]:host-port:[guest-host]:guest-port @item -redir [tcp|udp]:@var{host-port}:[@var{guest-host}]:@var{guest-port}
@@ -511,6 +511,16 @@ Use @var{cmdline} as kernel command line @@ -682,6 +682,16 @@ Use @var{cmdline} as kernel command line
@item -initrd file @item -initrd @var{file}
Use @var{file} as initial ram disk. Use @var{file} as initial ram disk.
+@end table +@end table

View File

@ -1,21 +1,21 @@
$OpenBSD: patch-target-i386_helper2_c,v 1.5 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-target-i386_helper2_c,v 1.6 2008/04/28 22:52:38 todd Exp $
--- target-i386/helper2.c.orig Mon Feb 5 17:01:54 2007 --- target-i386/helper2.c.orig Sun Jan 6 14:38:45 2008
+++ target-i386/helper2.c Mon Mar 12 15:48:39 2007 +++ target-i386/helper2.c Tue Apr 1 01:49:51 2008
@@ -127,7 +127,7 @@ CPUX86State *cpu_x86_init(void) @@ -133,7 +133,7 @@ typedef struct x86_def_t {
env->cpuid_model[i >> 2] |= c << (8 * (i & 3)); CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \
} CPUID_PAE | CPUID_SEP | CPUID_APIC)
} static x86_def_t x86_defs[] = {
-#ifdef TARGET_X86_64 -#ifdef TARGET_X86_64
+/* #ifdef TARGET_X86_64 -- You must enable it for Mac OS X x86 */ +/* #ifdef TARGET_X86_64 -- You must enable it for Mac OS X x86 */
/* currently not enabled for std i386 because not fully tested */ {
env->cpuid_ext2_features = (env->cpuid_features & 0x0183F3FF); .name = "qemu64",
env->cpuid_ext2_features |= CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX; .level = 2,
@@ -137,7 +137,7 @@ CPUX86State *cpu_x86_init(void) @@ -154,7 +154,7 @@ static x86_def_t x86_defs[] = {
env->cpuid_features |= CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA; .ext3_features = CPUID_EXT3_SVM,
/* this feature is needed for Solaris and isn't fully implemented */ .xlevel = 0x8000000A,
env->cpuid_features |= CPUID_PSE36; },
-#endif -#endif
+/* #endif -- To run Mac OS X x86 */ +/* #endif -- To run Mac OS X x86 */
} {
cpu_reset(env); .name = "qemu32",
#ifdef USE_KQEMU .level = 2,

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-target-ppc_op_helper_c,v 1.4 2007/05/01 12:55:14 todd Exp $ $OpenBSD: patch-target-ppc_op_helper_c,v 1.5 2008/04/28 22:52:38 todd Exp $
--- target-ppc/op_helper.c.orig Mon Feb 5 17:01:54 2007 --- target-ppc/op_helper.c.orig Sun Jan 6 14:38:45 2008
+++ target-ppc/op_helper.c Sat Mar 10 16:39:41 2007 +++ target-ppc/op_helper.c Tue Apr 1 01:33:40 2008
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
+#include <math.h> +#include <math.h>
#include "exec.h" #include "exec.h"
#include "host-utils.h"
#define MEMSUFFIX _raw

View File

@ -1,8 +1,8 @@
$OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $ $OpenBSD: patch-vl_c,v 1.17 2008/04/28 22:52:38 todd Exp $
--- vl.c.orig Tue Feb 6 00:01:54 2007 --- vl.c.orig Sun Jan 6 14:38:42 2008
+++ vl.c Mon Mar 31 21:42:05 2008 +++ vl.c Tue Apr 1 22:43:39 2008
@@ -44,7 +44,8 @@ @@ -61,7 +61,8 @@
#include <netdb.h> #include <arpa/inet.h>
#ifdef _BSD #ifdef _BSD
#include <sys/stat.h> #include <sys/stat.h>
-#ifndef __APPLE__ -#ifndef __APPLE__
@ -10,8 +10,8 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
+#if !defined(__APPLE__) && !defined(__OpenBSD__) +#if !defined(__APPLE__) && !defined(__OpenBSD__)
#include <libutil.h> #include <libutil.h>
#endif #endif
#else #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
@@ -92,7 +93,7 @@ @@ -136,7 +137,7 @@ int inet_aton(const char *cp, struct in_addr *ia);
#ifdef __sun__ #ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd" #define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else #else
@ -20,16 +20,8 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
#endif #endif
//#define DEBUG_UNUSED_IOPORT //#define DEBUG_UNUSED_IOPORT
@@ -168,6 +169,7 @@ const char *vnc_display; @@ -3491,7 +3492,7 @@ static int parse_macaddr(uint8_t *macaddr, const char
int acpi_enabled = 1; return -1;
int fd_bootchk = 1;
int no_reboot = 0;
+int scsi_enabled = 0;
int daemonize = 0;
const char *option_rom[MAX_OPTION_ROMS];
int nb_option_roms;
@@ -2808,7 +2810,7 @@ static int parse_macaddr(uint8_t *macaddr, const char
return 0;
} }
-static int get_str_sep(char *buf, int buf_size, const char **pp, int sep) -static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
@ -37,13 +29,13 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
{ {
const char *p, *p1; const char *p, *p1;
int len; int len;
@@ -3226,11 +3228,85 @@ static int tap_open(char *ifname, int ifname_size) @@ -3922,11 +3923,85 @@ static int tap_open(char *ifname, int ifname_size)
char *dev; char *dev;
struct stat s; struct stat s;
+ /* If the device was specified on the command line, use it */ + /* If the device was specified on the command line, use it */
+ if (ifname[0]) { + if (ifname[0]) {
+ fd = open(ifname, O_RDWR); + TFR(fd = open(ifname, O_RDWR));
+ if (fd < 0) { + if (fd < 0) {
+ fprintf(stderr, "warning: could not open %s: no virtual network emulation\n", ifname); + fprintf(stderr, "warning: could not open %s: no virtual network emulation\n", ifname);
+ return -1; + return -1;
@ -52,7 +44,7 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
+#ifdef __OpenBSD__ +#ifdef __OpenBSD__
+ struct ifreq ifr; + struct ifreq ifr;
+ int i = 0, enoentcount = 0, err = 0, sock; + int i = 0, enoentcount = 0, err = 0, sock;
+ char dname[100], iname[100]; + char dname[100];
+ +
+ bzero(&ifr, sizeof(ifr)); + bzero(&ifr, sizeof(ifr));
+ if (ifname != NULL && ifname[0] != '\0') { + if (ifname != NULL && ifname[0] != '\0') {
@ -62,9 +54,9 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
+ } else { + } else {
+ for (; i != -1; i++) { + for (; i != -1; i++) {
+ snprintf(dname, sizeof dname, "/dev/tun%d", i); + snprintf(dname, sizeof dname, "/dev/tun%d", i);
+ bzero(&ifr.ifr_name, sizeof(ifr.ifr_name)); + bzero(&ifr.ifr_name, sizeof(ifr.ifr_name));
+ snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "tun%d", i); + snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "tun%d", i);
+ fd = open(dname, O_RDWR); + TFR(fd = open(dname, O_RDWR));
+ if (fd >= 0) + if (fd >= 0)
+ break; + break;
+ else if (errno != ENOENT || ++enoentcount > 3) { + else if (errno != ENOENT || ++enoentcount > 3) {
@ -113,7 +105,7 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
+ } + }
+ +
+#else +#else
fd = open("/dev/tap", O_RDWR); TFR(fd = open("/dev/tap", O_RDWR));
if (fd < 0) { if (fd < 0) {
fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n"); fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n");
return -1; return -1;
@ -123,15 +115,15 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
fstat(fd, &s); fstat(fd, &s);
dev = devname(s.st_rdev, S_IFCHR); dev = devname(s.st_rdev, S_IFCHR);
@@ -3282,6 +3358,7 @@ static int net_tap_init(VLANState *vlan, const char *i @@ -4141,6 +4216,7 @@ static int net_tap_init(VLANState *vlan, const char *i
char *args[3]; TAPState *s;
char **parg; int fd;
char ifname[128]; char ifname[128];
+ bzero(&ifname,sizeof(ifname)); + bzero(&ifname,sizeof(ifname));
if (ifname1 != NULL) if (ifname1 != NULL)
pstrcpy(ifname, sizeof(ifname), ifname1); pstrcpy(ifname, sizeof(ifname), ifname1);
@@ -3476,7 +3553,7 @@ static int net_socket_mcast_create(struct sockaddr_in @@ -4320,7 +4396,7 @@ static int net_socket_mcast_create(struct sockaddr_in
/* Force mcast msgs to loopback (eg. several QEMUs in same host */ /* Force mcast msgs to loopback (eg. several QEMUs in same host */
val = 1; val = 1;
ret=setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, ret=setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
@ -140,8 +132,8 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
if (ret < 0) { if (ret < 0) {
perror("setsockopt(SOL_IP, IP_MULTICAST_LOOP)"); perror("setsockopt(SOL_IP, IP_MULTICAST_LOOP)");
goto fail; goto fail;
@@ -3732,7 +3809,8 @@ static int net_socket_mcast_init(VLANState *vlan, cons @@ -4609,7 +4685,8 @@ static const char *get_word(char *buf, int buf_size, c
return p;
} }
-static int get_param_value(char *buf, int buf_size, -static int get_param_value(char *buf, int buf_size,
@ -150,16 +142,17 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
const char *tag, const char *str) const char *tag, const char *str)
{ {
const char *p; const char *p;
@@ -3856,6 +3934,8 @@ static int net_client_init(const char *str) @@ -4748,6 +4825,9 @@ static int net_client_init(const char *str)
if (!strcmp(device, "tap")) {
char ifname[64]; char ifname[64];
char setup_script[1024]; char setup_script[1024], down_script[1024];
+ bzero(&ifname,sizeof(ifname));
+ bzero(&setup_script,sizeof(setup_script));
int fd; int fd;
+ bzero(&ifname, sizeof(ifname));
+ bzero(&setup_script, sizeof(setup_script));
+ bzero(&down_script, sizeof(down_script));
vlan->nb_host_devs++;
if (get_param_value(buf, sizeof(buf), "fd", p) > 0) { if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
fd = strtol(buf, NULL, 0); fd = strtol(buf, NULL, 0);
@@ -3863,13 +3943,13 @@ static int net_client_init(const char *str) @@ -4755,16 +4835,16 @@ static int net_client_init(const char *str)
if (net_tap_fd_init(vlan, fd)) if (net_tap_fd_init(vlan, fd))
ret = 0; ret = 0;
} else { } else {
@ -169,49 +162,18 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) { if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) {
pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT); pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT);
} }
- ret = net_tap_init(vlan, ifname, setup_script); if (get_param_value(down_script, sizeof(down_script), "downscript", p) == 0) {
pstrcpy(down_script, sizeof(down_script), DEFAULT_NETWORK_DOWN_SCRIPT);
}
- ret = net_tap_init(vlan, ifname, setup_script, down_script);
+ if (get_param_value(ifname, sizeof(ifname), "ifname", p) == 0) + if (get_param_value(ifname, sizeof(ifname), "ifname", p) == 0)
+ ret = net_tap_init(vlan, NULL, setup_script); + ret = net_tap_init(vlan, NULL, setup_script, down_script);
+ else + else
+ ret = net_tap_init(vlan, NULL, setup_script); + ret = net_tap_init(vlan, NULL, setup_script, down_script);
} }
} else } else
#endif #endif
@@ -6117,6 +6197,7 @@ void help(void) @@ -8130,19 +8210,23 @@ int main(int argc, char **argv)
"-no-acpi disable ACPI\n"
#endif
"-no-reboot exit instead of rebooting\n"
+ "-scsienable enable scsi devices\n"
"-loadvm file start right away with a saved state (loadvm in monitor)\n"
"-vnc display start a VNC server on display\n"
#ifndef _WIN32
@@ -6205,7 +6286,8 @@ enum {
QEMU_OPTION_no_reboot,
QEMU_OPTION_daemonize,
QEMU_OPTION_option_rom,
- QEMU_OPTION_semihosting
+ QEMU_OPTION_semihosting,
+ QEMU_OPTION_scsi
};
typedef struct QEMUOption {
@@ -6281,6 +6363,7 @@ const QEMUOption qemu_options[] = {
{ "usbdevice", HAS_ARG, QEMU_OPTION_usbdevice },
{ "smp", HAS_ARG, QEMU_OPTION_smp },
{ "vnc", HAS_ARG, QEMU_OPTION_vnc },
+ { "scsienable", 0, QEMU_OPTION_scsi },
/* temporary options */
{ "usb", 0, QEMU_OPTION_usb },
@@ -6329,6 +6412,7 @@ static void read_passwords(void)
for(i = 0; i < 6; i++) {
bs = get_bdrv(i);
if (bs && bdrv_is_encrypted(bs)) {
+ qemu_bh_poll();
term_printf("%s is encrypted.\n", bdrv_get_device_name(bs));
for(j = 0; j < 3; j++) {
monitor_readline("Password: ",
@@ -6570,7 +6654,11 @@ int main(int argc, char **argv)
gdbstub_port = DEFAULT_GDBSTUB_PORT; gdbstub_port = DEFAULT_GDBSTUB_PORT;
#endif #endif
snapshot = 0; snapshot = 0;
@ -222,13 +184,10 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
+#endif +#endif
kernel_filename = NULL; kernel_filename = NULL;
kernel_cmdline = ""; kernel_cmdline = "";
#ifdef TARGET_PPC
@@ -6580,14 +6668,14 @@ int main(int argc, char **argv)
#endif
cyls = heads = secs = 0; cyls = heads = secs = 0;
translation = BIOS_ATA_TRANSLATION_AUTO; translation = BIOS_ATA_TRANSLATION_AUTO;
- pstrcpy(monitor_device, sizeof(monitor_device), "vc"); - pstrcpy(monitor_device, sizeof(monitor_device), "vc");
+ pstrcpy(monitor_device, sizeof(monitor_device), nographic ? "stdio" : "vc" ); + pstrcpy(monitor_device, sizeof(monitor_device), nographic ? "stdio" : "vc");
- pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "vc"); - pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "vc");
+ pstrcpy(serial_devices[0], sizeof(serial_devices[0]), nographic ? "stdio" : "vc"); + pstrcpy(serial_devices[0], sizeof(serial_devices[0]), nographic ? "stdio" : "vc");
@ -241,13 +200,3 @@ $OpenBSD: patch-vl_c,v 1.16 2008/03/31 20:16:52 todd Exp $
for(i = 1; i < MAX_PARALLEL_PORTS; i++) for(i = 1; i < MAX_PARALLEL_PORTS; i++)
parallel_devices[i][0] = '\0'; parallel_devices[i][0] = '\0';
parallel_device_index = 0; parallel_device_index = 0;
@@ -6940,6 +7028,9 @@ int main(int argc, char **argv)
break;
case QEMU_OPTION_no_acpi:
acpi_enabled = 0;
+ break;
+ case QEMU_OPTION_scsi:
+ scsi_enabled = 1;
break;
case QEMU_OPTION_no_reboot:
no_reboot = 1;

View File

@ -1,22 +0,0 @@
$OpenBSD: patch-vl_h,v 1.7 2007/05/01 12:55:14 todd Exp $
--- vl.h.orig Mon Feb 5 17:01:54 2007
+++ vl.h Fri Apr 6 13:18:16 2007
@@ -101,8 +101,8 @@ static inline char *realpath(const char *path, char *r
#endif
/* cutils.c */
-void pstrcpy(char *buf, int buf_size, const char *str);
-char *pstrcat(char *buf, int buf_size, const char *s);
+void pstrcpy(char *buf, size_t buf_size, const char *str);
+char *pstrcat(char *buf, size_t buf_size, const char *s);
int strstart(const char *str, const char *val, const char **ptr);
int stristart(const char *str, const char *val, const char **ptr);
@@ -114,6 +114,7 @@ void hw_error(const char *fmt, ...);
extern const char *bios_dir;
extern int vm_running;
+extern int scsi_enabled;
typedef struct vm_change_state_entry VMChangeStateEntry;
typedef void VMChangeStateHandler(void *opaque, int running);

View File

@ -1,14 +1,2 @@
+--------------- Please see ${LOCALBASE}/share/doc/qemu/README.OpenBSD for
| Quick Start: a brief intro to using qemu on OpenBSD.
| 1. get a bootable floppy image
| 2. qemu-img create -f qcow2 virtual.hd 10G
| 3. qemu -m 32 -fda floppy.fs -boot a -monitor stdio virtual.hd
| (initial install to hard drive)
| 4. qemu-img convert -c -O qcow2 virtual.hd tmp && mv tmp virtual.hd
| (compress hard drive while qemu is not running)
| 5. qemu -m 32 -monitor stdio virtual.hd
| (normal boot from hard drive)
|
| Note: Customize ${SYSCONFDIR}/qemu-ifup to use '-net tap' on your system.
+---------------

View File

@ -1,23 +1,37 @@
@comment $OpenBSD: PLIST,v 1.9 2008/03/31 20:59:21 okan Exp $ @comment $OpenBSD: PLIST,v 1.10 2008/04/28 22:52:38 todd Exp $
@pkgpath emulators/qemu,kqemu @pkgpath emulators/qemu,kqemu
bin/qemu bin/qemu
bin/qemu-img bin/qemu-img
bin/qemu-system-arm bin/qemu-system-arm
bin/qemu-system-cris
bin/qemu-system-m68k
bin/qemu-system-mips bin/qemu-system-mips
bin/qemu-system-mips64
bin/qemu-system-mips64el
bin/qemu-system-mipsel bin/qemu-system-mipsel
bin/qemu-system-ppc bin/qemu-system-ppc
bin/qemu-system-ppc64
bin/qemu-system-ppcemb
bin/qemu-system-sh4
bin/qemu-system-sh4eb
bin/qemu-system-sparc bin/qemu-system-sparc
bin/qemu-system-x86_64 bin/qemu-system-x86_64
@man man/man1/qemu-img.1 @man man/man1/qemu-img.1
@man man/man1/qemu.1 @man man/man1/qemu.1
share/doc/qemu/ share/doc/qemu/
share/doc/qemu/README.OpenBSD
share/doc/qemu/qemu-doc.html share/doc/qemu/qemu-doc.html
share/doc/qemu/qemu-tech.html share/doc/qemu/qemu-tech.html
share/examples/qemu/ share/examples/qemu/
share/examples/qemu/qemu-ifdown
@mode 755
@sample ${SYSCONFDIR}/qemu-ifdown
@mode
share/examples/qemu/qemu-ifup share/examples/qemu/qemu-ifup
@mode 755 @mode 755
@sample ${SYSCONFDIR}/qemu-ifup @sample ${SYSCONFDIR}/qemu-ifup
@mode @mode
share/nls/pl_PL.ISO_8859-2/
share/qemu/ share/qemu/
share/qemu/bios.bin share/qemu/bios.bin
share/qemu/keymaps/ share/qemu/keymaps/
@ -56,7 +70,6 @@ share/qemu/keymaps/sl
share/qemu/keymaps/sv share/qemu/keymaps/sv
share/qemu/keymaps/th share/qemu/keymaps/th
share/qemu/keymaps/tr share/qemu/keymaps/tr
share/qemu/linux_boot.bin
share/qemu/openbios-sparc32 share/qemu/openbios-sparc32
share/qemu/ppc_rom.bin share/qemu/ppc_rom.bin
share/qemu/pxe-ne2k_pci.bin share/qemu/pxe-ne2k_pci.bin