ports/emulators/qemu-devel/files/patch-block-raw.c
Juergen Lock 8598b8520e Update qemu to 2007-01-11 snapshot:
- add slirp udp fix
  [this should fix the dns problems with some guests]
- document slirp problems on recent -current (I don't have a -current box
  so if someone wants to help debug this you are most welcome!)
- memsave monitor command
- Dynamic handling of guest mice, by Lonnie Mendez.
- PPC32 Trace Exception and Trap instruction, by Jason Wessel.
- Add -option-rom option to allow loading of PCI option ROMs, by
  Anthony Liguori.
- Add -boot n option for x86 using PXE, by Anthony Liguori.
  [for use with tuntap]
- Support for Bochs "growing" images, by Volker Ruppert.
- Japanese keyboard patch (kazu)
- Revert -disk patch, as requested by Fabrice. The general idea of this
  patch is sound, but the implementation is just too ugly.
  [this should fix the hanging linux guests]
- Devfn number for the PIIX3 southbridge, by Aurelien Jarno.
- Increase MIPS BIOS from 128kB to 4MB, by Aurelien Jarno.
- And some more bugfixes.

Approved by:	miwi (mentor)
2007-01-12 00:13:58 +00:00

51 lines
1.1 KiB
C

Index: qemu/block-raw.c
@@ -51,7 +51,10 @@
#include <linux/cdrom.h>
#include <linux/fd.h>
#endif
#ifdef __FreeBSD__
+#include <signal.h>
+#endif
+#if defined(__FreeBSD__) && __FreeBSD__ > 4
#include <sys/disk.h>
#endif
@@ -167,9 +167,20 @@
static int aio_sig_num = SIGUSR2;
static RawAIOCB *first_aio; /* AIO issued */
static int aio_initialized = 0;
+// FreeBSD 4.x doesn't have sigwait
+#if defined(__FreeBSD__) && __FreeBSD__ <= 4
+static int sigaio_dont = 0;
+#endif
static void aio_signal_handler(int signum)
{
+// FreeBSD 4.x doesn't have sigwait
+#if defined(__FreeBSD__) && __FreeBSD__ <= 4
+ if (sigaio_dont) {
+ --sigaio_dont;
+ return;
+ }
+#endif
#ifndef QEMU_TOOL
CPUState *env = cpu_single_env;
if (env) {
@@ -284,9 +295,17 @@
if (qemu_bh_poll())
return;
#endif
+// FreeBSD 4.x doesn't have sigwait
+#if defined(__FreeBSD__) && __FreeBSD__ <= 4
+ ++sigaio_dont;
+ do
+ sigsuspend(&wait_oset);
+ while (sigaio_dont);
+#else
sigemptyset(&set);
sigaddset(&set, aio_sig_num);
sigwait(&set, &nb_sigs);
+#endif
qemu_aio_poll();
}