Index: ioemu/Makefile.target
===================================================================
--- ioemu.orig/Makefile.target	2006-08-06 02:21:42.270461924 +0100
+++ ioemu/Makefile.target	2006-08-06 02:22:26.380544784 +0100
@@ -355,7 +355,7 @@
 # Hardware support
 VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8254.o pcspk.o pc.o
-VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o
+VL_OBJS+= cirrus_vga.o mixeng.o parallel.o acpi.o piix_pci.o
 VL_OBJS+= usb-uhci.o
 DEFINES += -DHAS_AUDIO
 endif
Index: ioemu/hw/pc.c
===================================================================
--- ioemu.orig/hw/pc.c	2006-08-06 02:22:01.524315611 +0100
+++ ioemu/hw/pc.c	2006-08-06 02:22:11.875161758 +0100
@@ -39,7 +39,9 @@
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
+#ifndef CONFIG_DM
 static IOAPICState *ioapic;
+#endif /* !CONFIG_DM */
 
 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
 {
@@ -640,9 +642,11 @@
 #endif /* !CONFIG_DM */
         register_savevm("cpu", i, 3, cpu_save, cpu_load, env);
         qemu_register_reset(main_cpu_reset, env);
+#ifndef CONFIG_DM
         if (pci_enabled) {
             apic_init(env);
         }
+#endif /* !CONFIG_DM */
     }
 
     /* allocate RAM */
@@ -789,9 +793,11 @@
     register_ioport_read(0x92, 1, 1, ioport92_read, NULL);
     register_ioport_write(0x92, 1, 1, ioport92_write, NULL);
 
+#ifndef CONFIG_DM
     if (pci_enabled) {
         ioapic = ioapic_init();
     }
+#endif /* !CONFIG_DM */
     isa_pic = pic_init(pic_irq_request, first_cpu);
     pit = pit_init(0x40, 0);
     pcspk_init(pit);
