udev support
[linux-based-stubdoms.git] / ioemu.patch
blob27858875978d6964abd373a9698d5e866fcd9dd9
1 diff --git a/Makefile b/Makefile
2 index 67c0268..dcb39f9 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -47,7 +47,11 @@ config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
6 -include $(SUBDIR_DEVICES_MAK_DEP)
8 %/config-devices.mak: default-configs/%.mak
9 +ifneq ($(CONFIG_STUBDOM),y)
10 $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, " GEN $@")
11 +else
12 + $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ default-configs/stubdom.mak, " GEN $@")
13 +endif
14 @if test -f $@; then \
15 if cmp -s $@.old $@; then \
16 mv $@.tmp $@; \
17 diff --git a/Makefile.objs b/Makefile.objs
18 index 9d8851e..8c42dd8 100644
19 --- a/Makefile.objs
20 +++ b/Makefile.objs
21 @@ -14,15 +14,20 @@ oslib-obj-$(CONFIG_POSIX) += oslib-posix.o
22 # block-obj-y is code used by both qemu system emulation and qemu-img
24 block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o async.o
25 -block-obj-y += nbd.o block.o aio.o aes.o qemu-config.o qemu-progress.o qemu-sockets.o
26 +ifneq ($(CONFIG_STUBDOM),y)
27 +block-obj-y += nbd.o qemu-sockets.o
28 +endif
29 +block-obj-y += block.o aio.o aes.o qemu-config.o qemu-progress.o
30 block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
31 block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
33 +ifneq ($(CONFIG_STUBDOM),y)
34 block-nested-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
35 block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o
36 block-nested-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
37 block-nested-y += qed-check.o
38 block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o
39 +endif
40 block-nested-$(CONFIG_WIN32) += raw-win32.o
41 block-nested-$(CONFIG_POSIX) += raw-posix.o
42 block-nested-$(CONFIG_CURL) += curl.o
43 @@ -32,7 +37,9 @@ block-obj-y += $(addprefix block/, $(block-nested-y))
45 net-obj-y = net.o
46 net-nested-y = queue.o checksum.o util.o
47 +ifneq ($(CONFIG_STUBDOM),y)
48 net-nested-y += socket.o
49 +endif
50 net-nested-y += dump.o
51 net-nested-$(CONFIG_POSIX) += tap.o
52 net-nested-$(CONFIG_LINUX) += tap-linux.o
53 @@ -68,7 +75,9 @@ common-obj-y += $(oslib-obj-y)
54 common-obj-$(CONFIG_WIN32) += os-win32.o
55 common-obj-$(CONFIG_POSIX) += os-posix.o
57 +ifneq ($(CONFIG_STUBDOM),y)
58 common-obj-y += tcg-runtime.o host-utils.o
59 +endif
60 common-obj-y += irq.o ioport.o input.o
61 common-obj-$(CONFIG_PTIMER) += ptimer.o
62 common-obj-$(CONFIG_MAX7310) += max7310.o
63 @@ -83,31 +92,45 @@ common-obj-$(CONFIG_SSD0323) += ssd0323.o
64 common-obj-$(CONFIG_ADS7846) += ads7846.o
65 common-obj-$(CONFIG_MAX111X) += max111x.o
66 common-obj-$(CONFIG_DS1338) += ds1338.o
67 -common-obj-y += i2c.o smbus.o smbus_eeprom.o
68 -common-obj-y += eeprom93xx.o
69 -common-obj-y += scsi-disk.o cdrom.o
70 +common-obj-y += i2c.o smbus.o
71 +ifneq ($(CONFIG_STUBDOM),y)
72 +common-obj-y += smbus_eeprom.o eeprom93xx.o scsi-disk.o
73 +endif
74 +common-obj-y += cdrom.o
75 common-obj-y += scsi-generic.o scsi-bus.o
76 -common-obj-y += usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
77 -common-obj-y += usb-serial.o usb-net.o usb-bus.o usb-desc.o
78 +common-obj-y += usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o
79 +ifneq ($(CONFIG_STUBDOM),y)
80 +common-obj-y += usb-wacom.o usb-serial.o
81 +endif
82 +common-obj-y += usb-net.o usb-bus.o usb-desc.o
83 common-obj-$(CONFIG_SSI) += ssi.o
84 common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
85 common-obj-$(CONFIG_SD) += sd.o
86 +ifneq ($(CONFIG_STUBDOM),y)
87 common-obj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
88 common-obj-y += bt-hci-csr.o
89 -common-obj-y += buffered_file.o migration.o migration-tcp.o
90 +common-obj-y += migration.o migration-tcp.o
91 +endif
92 +common-obj-y += buffered_file.o
93 common-obj-y += qemu-char.o savevm.o #aio.o
94 common-obj-y += msmouse.o ps2.o
95 common-obj-y += qdev.o qdev-properties.o
96 -common-obj-y += block-migration.o iohandler.o
97 +ifneq ($(CONFIG_STUBDOM),y)
98 +common-obj-y += block-migration.o
99 +endif
100 +common-obj-y += iohandler.o
101 common-obj-y += pflib.o
102 common-obj-y += bitmap.o bitops.o
104 common-obj-$(CONFIG_BRLAPI) += baum.o
105 +ifneq ($(CONFIG_STUBDOM),y)
106 common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
107 +endif
108 common-obj-$(CONFIG_WIN32) += version.o
110 common-obj-$(CONFIG_SPICE) += ui/spice-core.o ui/spice-input.o ui/spice-display.o spice-qemu-char.o
112 +ifneq ($(CONFIG_STUBDOM),y)
113 audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
114 audio-obj-$(CONFIG_SDL) += sdlaudio.o
115 audio-obj-$(CONFIG_OSS) += ossaudio.o
116 @@ -122,6 +145,7 @@ audio-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
117 audio-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
118 audio-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
119 audio-obj-y += wavcapture.o
120 +endif
121 common-obj-y += $(addprefix audio/, $(audio-obj-y))
123 ui-obj-y += keymaps.o
124 @@ -160,10 +184,12 @@ common-obj-$(CONFIG_XEN) += xen_console.o xenfb.o xen_disk.o xen_nic.o
125 ######################################################################
126 # libuser
128 +ifneq ($(CONFIG_STUBDOM),y)
129 user-obj-y =
130 user-obj-y += envlist.o path.o
131 user-obj-y += tcg-runtime.o host-utils.o
132 user-obj-y += cutils.o cache-utils.o
133 +endif
135 ######################################################################
136 # libhw
137 @@ -175,8 +201,10 @@ hw-obj-y += fw_cfg.o
138 hw-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
139 hw-obj-$(CONFIG_PCI) += msix.o msi.o
140 hw-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
141 +ifneq ($(CONFIG_STUBDOM),y)
142 hw-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o
143 hw-obj-y += watchdog.o
144 +endif
145 hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
146 hw-obj-$(CONFIG_ECC) += ecc.o
147 hw-obj-$(CONFIG_NAND) += nand.o
148 @@ -225,7 +253,9 @@ hw-obj-$(CONFIG_PPCE500_PCI) += ppce500_pci.o
149 hw-obj-$(CONFIG_PIIX4) += piix4.o
151 # PCI watchdog devices
152 +ifneq ($(CONFIG_STUBDOM),y)
153 hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o
154 +endif
156 hw-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
158 @@ -347,6 +377,7 @@ trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
160 simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
162 +ifneq ($(CONFIG_STUBDOM),y)
163 ifeq ($(TRACE_BACKEND),dtrace)
164 trace-obj-y = trace-dtrace.o
165 else
166 @@ -356,13 +387,16 @@ trace-obj-y += simpletrace.o
167 user-obj-y += qemu-timer-common.o
168 endif
169 endif
170 +endif
172 ######################################################################
173 # smartcard
175 +ifneq ($(CONFIG_STUBDOM),y)
176 libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o card_7816.o
178 vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
180 vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
181 +endif
183 diff --git a/Makefile.target b/Makefile.target
184 index 2e281a4..0a77fff 100644
185 --- a/Makefile.target
186 +++ b/Makefile.target
187 @@ -69,14 +69,20 @@ all: $(PROGS) stap
189 #########################################################
190 # cpu emulator library
191 +ifneq ($(CONFIG_STUBDOM),y)
192 libobj-y = exec.o translate-all.o cpu-exec.o translate.o
193 libobj-y += tcg/tcg.o
194 +else
195 +libobj-y = exec.o translate-all-stub.o cpu-exec.o
196 +endif
197 libobj-$(CONFIG_SOFTFLOAT) += fpu/softfloat.o
198 libobj-$(CONFIG_NOSOFTFLOAT) += fpu/softfloat-native.o
199 libobj-y += op_helper.o helper.o
200 ifeq ($(TARGET_BASE_ARCH), i386)
201 +ifneq ($(CONFIG_STUBDOM),y)
202 libobj-y += cpuid.o
203 endif
204 +endif
205 libobj-$(CONFIG_NEED_MMU) += mmu.o
206 libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
208 @@ -186,13 +192,15 @@ endif #CONFIG_BSD_USER
209 # System emulator target
210 ifdef CONFIG_SOFTMMU
212 -obj-y = arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o
213 +obj-y = arch_init.o cpus.o monitor.o machine.o balloon.o
214 # virtio has to be here due to weird dependency between PCI and virtio-net.
215 # need to fix this properly
216 obj-$(CONFIG_NO_PCI) += pci-stub.o
217 obj-$(CONFIG_VIRTIO) += virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o
218 obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
219 -obj-y += vhost_net.o
220 +ifneq ($(CONFIG_STUBDOM),y)
221 +obj-y += gdbstub.o vhost_net.o
222 +endif
223 obj-$(CONFIG_VHOST_NET) += vhost.o
224 obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p.o
225 obj-y += rwhandler.o
226 @@ -234,9 +242,12 @@ obj-i386-y += vga.o
227 obj-i386-y += mc146818rtc.o i8259.o pc.o
228 obj-i386-y += cirrus_vga.o apic.o ioapic.o piix_pci.o
229 obj-i386-y += vmport.o
230 -obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o
231 -obj-i386-y += debugcon.o multiboot.o
232 -obj-i386-y += pc_piix.o kvmclock.o
233 +obj-i386-y += device-hotplug.o pci-hotplug.o
234 +ifneq ($(CONFIG_STUBDOM),y)
235 +obj-i386-y += smbios.o wdt_ib700.o
236 +obj-i386-y += debugcon.o multiboot.o kvmclock.o
237 +endif
238 +obj-i386-y += pc_piix.o
239 obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
241 # shared objects
242 diff --git a/arch_init.c b/arch_init.c
243 index 484b39d..7fdb91e 100644
244 --- a/arch_init.c
245 +++ b/arch_init.c
246 @@ -40,7 +40,9 @@
247 #include "migration.h"
248 #include "net.h"
249 #include "gdbstub.h"
250 +#ifndef CONFIG_STUBDOM
251 #include "hw/smbios.h"
252 +#endif
254 #ifdef TARGET_SPARC
255 int graphic_width = 1024;
256 @@ -92,6 +94,7 @@ const uint32_t arch_type = QEMU_ARCH;
257 #define RAM_SAVE_FLAG_EOS 0x10
258 #define RAM_SAVE_FLAG_CONTINUE 0x20
260 +#ifndef CONFIG_STUBDOM
261 static int is_dup_page(uint8_t *page, uint8_t ch)
263 uint32_t val = ch << 24 | ch << 16 | ch << 8 | ch;
264 @@ -174,6 +177,8 @@ static int ram_save_block(QEMUFile *f)
265 return bytes_sent;
268 +#endif
270 static uint64_t bytes_transferred;
272 static ram_addr_t ram_save_remaining(void)
273 @@ -215,6 +220,7 @@ uint64_t ram_bytes_total(void)
274 return total;
277 +#ifndef CONFIG_STUBDOM
278 static int block_compar(const void *a, const void *b)
280 RAMBlock * const *ablock = a;
281 @@ -334,6 +340,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
283 return (stage == 2) && (expected_time <= migrate_max_downtime());
285 +#endif
287 static inline void *host_from_stream_offset(QEMUFile *f,
288 ram_addr_t offset,
289 @@ -668,8 +675,10 @@ int qemu_uuid_parse(const char *str, uint8_t *uuid)
290 return -1;
292 #ifdef TARGET_I386
293 +#ifndef CONFIG_STUBDOM
294 smbios_add_field(1, offsetof(struct smbios_type_1, uuid), 16, uuid);
295 #endif
296 +#endif
297 return 0;
300 @@ -683,6 +692,7 @@ void do_acpitable_option(const char *optarg)
301 #endif
304 +#ifndef CONFIG_STUBDOM
305 void do_smbios_option(const char *optarg)
307 #ifdef TARGET_I386
308 @@ -692,10 +702,11 @@ void do_smbios_option(const char *optarg)
310 #endif
312 +#endif
314 void cpudef_init(void)
316 -#if defined(cpudef_setup)
317 +#if defined(cpudef_setup) && !defined(CONFIG_STUBDOM)
318 cpudef_setup(); /* parse cpu definitions in target config file */
319 #endif
321 diff --git a/configure b/configure
322 index 3ba6401..47347e7 100755
323 --- a/configure
324 +++ b/configure
325 @@ -180,6 +180,8 @@ smartcard=""
326 smartcard_nss=""
327 opengl=""
329 +stubdom="no"
331 # parse CC options first
332 for opt do
333 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
334 @@ -742,6 +744,8 @@ for opt do
336 --enable-smartcard-nss) smartcard_nss="yes"
338 + --enable-stubdom) stubdom="yes"
339 + ;;
340 *) echo "ERROR: unknown option $opt"; show_help="yes"
342 esac
343 @@ -946,6 +950,7 @@ echo " --disable-smartcard disable smartcard support"
344 echo " --enable-smartcard enable smartcard support"
345 echo " --disable-smartcard-nss disable smartcard nss support"
346 echo " --enable-smartcard-nss enable smartcard nss support"
347 +echo " --enable-stubdom enable building the ioemu-stubdom"
348 echo ""
349 echo "NOTE: The object files are built at the place where configure is launched"
350 exit 1
351 @@ -1133,6 +1138,46 @@ else
352 hostlongbits=32
355 +if test "$stubdom"="yes"; then
356 + sdl="no"
357 + vnc="no"
358 + vnc_tls="no"
359 + vnc_sasl="no"
360 + vnc_jpeg="no"
361 + vnc_png="no"
362 + vnc_thread="no"
363 + slirp="no"
364 + debug_tcg="no"
365 + debug_mon="no"
366 + sparse="no"
367 + strip_opt="no"
368 + uuid="no"
369 + vde="no"
370 + brlapi="no"
371 + bluez="no"
372 + kvm="no"
373 + spice="no"
374 + bsd_user="no"
375 + darwin_user="no"
376 + guest_base="no"
377 + user_pie="no"
378 + curses="no"
379 + curl="no"
380 + check_utests="no"
381 + nptl="no"
382 + linux_aio="no"
383 + attr="no"
384 + blobs="no"
385 + docs="no"
386 + vhost_net="no"
387 + opengl="no"
388 + rbd="no"
389 + smartcard="no"
390 + smartcard_nss="no"
391 + audio_drv_list=""
392 + audio_card_list=""
396 ##########################################
397 # NPTL probe
398 @@ -2596,6 +2641,7 @@ if test "$softmmu" = yes ; then
401 # Mac OS X ships with a broken assembler
402 +if test "$stubdom" = "no"; then
403 roms=
404 if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
405 "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
406 @@ -2605,6 +2651,7 @@ fi
407 if test "$cpu" = "ppc64" ; then
408 roms="$roms spapr-rtas"
412 echo "Install prefix $prefix"
413 echo "BIOS directory `eval echo $datadir`"
414 @@ -2685,6 +2732,7 @@ echo "rbd support $rbd"
415 echo "xfsctl support $xfs"
416 echo "nss used $smartcard_nss"
417 echo "OpenGL support $opengl"
418 +echo "Stubdom support" $stubdom
420 if test $sdl_too_old = "yes"; then
421 echo "-> Your SDL version is too old - please upgrade to have SDL support"
422 @@ -2786,6 +2834,7 @@ for card in $audio_card_list; do
423 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
424 echo "$def=y" >> $config_host_mak
425 done
426 +#if test "$stubdom" = "no"; then
427 echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
428 for drv in $audio_drv_list; do
429 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
430 @@ -2794,6 +2843,7 @@ for drv in $audio_drv_list; do
431 echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak
433 done
434 +#fi
435 if test "$audio_pt_int" = "yes" ; then
436 echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak
438 @@ -2994,6 +3044,11 @@ if test "$rbd" = "yes" ; then
439 echo "CONFIG_RBD=y" >> $config_host_mak
442 +# stubdom support
443 +if test "$stubdom" = "yes"; then
444 + echo "CONFIG_STUBDOM=y" >> $config_host_mak
447 # USB host support
448 case "$usb" in
449 linux)
450 @@ -3020,7 +3075,9 @@ if test "$trace_backend" = "dtrace" -a "$trace_backend_stap" = "yes" ; then
452 echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
454 -echo "TOOLS=$tools" >> $config_host_mak
455 +if test "$stubdom" = "no"; then
456 + echo "TOOLS=$tools" >> $config_host_mak
458 echo "ROMS=$roms" >> $config_host_mak
459 echo "MAKE=$make" >> $config_host_mak
460 echo "INSTALL=$install" >> $config_host_mak
461 @@ -3358,7 +3415,11 @@ if test ! -z "$gdb_xml_files" ; then
462 echo "TARGET_XML_FILES=$list" >> $config_target_mak
465 -echo "CONFIG_SOFTFLOAT=y" >> $config_target_mak
466 +if test "$stubdom" = "no" ; then
467 + echo "CONFIG_SOFTFLOAT=y" >> $config_target_mak
468 +else
469 + echo "CONFIG_NOSOFTFLOAT=y" >> $config_target_mak
472 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
473 echo "TARGET_HAS_BFLT=y" >> $config_target_mak
474 @@ -3463,6 +3524,7 @@ alpha)
475 esac
477 if test "$target_softmmu" = "yes" ; then
478 + if test "$stubdom" = "no"; then
479 case "$TARGET_BASE_ARCH" in
480 arm)
481 cflags="-DHAS_AUDIO $cflags"
482 @@ -3474,6 +3536,7 @@ if test "$target_softmmu" = "yes" ; then
483 cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
485 esac
486 + fi
489 if test "$target_user_only" = "yes" -a "$static" = "no" -a \
490 diff --git a/cpus.c b/cpus.c
491 index 1fc34b7..b0fe50c 100644
492 --- a/cpus.c
493 +++ b/cpus.c
494 @@ -27,7 +27,9 @@
496 #include "monitor.h"
497 #include "sysemu.h"
498 +#ifndef CONFIG_STUBDOM
499 #include "gdbstub.h"
500 +#endif
501 #include "dma.h"
502 #include "kvm.h"
503 #include "exec-all.h"
504 @@ -167,6 +169,7 @@ bool all_cpu_threads_idle(void)
505 return true;
508 +#ifndef CONFIG_STUBDOM
509 static void cpu_handle_guest_debug(CPUState *env)
511 gdb_set_stop_cpu(env);
512 @@ -175,6 +178,7 @@ static void cpu_handle_guest_debug(CPUState *env)
513 env->stopped = 1;
514 #endif
516 +#endif
518 #ifdef CONFIG_IOTHREAD
519 static void cpu_signal(int sig)
520 @@ -1100,10 +1104,12 @@ bool cpu_exec_all(void)
521 } else {
522 r = tcg_cpu_exec(env);
524 +#ifndef CONFIG_STUBDOM
525 if (r == EXCP_DEBUG) {
526 cpu_handle_guest_debug(env);
527 break;
529 +#endif
530 } else if (env->stop || env->stopped) {
531 break;
533 @@ -1161,7 +1167,7 @@ int64_t cpu_get_icount(void)
534 void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
536 /* XXX: implement xxx_cpu_list for targets that still miss it */
537 -#if defined(cpu_list_id)
538 +#if defined(cpu_list_id) && !defined(CONFIG_STUBDOM)
539 cpu_list_id(f, cpu_fprintf, optarg);
540 #elif defined(cpu_list)
541 cpu_list(f, cpu_fprintf); /* deprecated */
542 diff --git a/default-configs/stubdom.mak b/default-configs/stubdom.mak
543 new file mode 100644
544 index 0000000..4467827
545 --- /dev/null
546 +++ b/default-configs/stubdom.mak
547 @@ -0,0 +1,36 @@
548 +CONFIG_PCI=y
549 +CONFIG_VIRTIO_PCI=n
550 +CONFIG_VIRTIO=n
551 +CONFIG_USB_UHCI=y
552 +CONFIG_USB_OHCI=n
553 +CONFIG_NE2000_PCI=n
554 +CONFIG_EEPRO100_PCI=n
555 +CONFIG_PCNET_PCI=y
556 +CONFIG_PCNET_COMMON=y
557 +CONFIG_LSI_SCSI_PCI=n
558 +CONFIG_RTL8139_PCI=n
559 +CONFIG_E1000_PCI=y
560 +CONFIG_IDE_CORE=y
561 +CONFIG_IDE_QDEV=y
562 +CONFIG_IDE_PCI=y
563 +CONFIG_AHCI=n
564 +CONFIG_VGA_PCI=y
565 +CONFIG_VGA_ISA=n
566 +CONFIG_VMWARE_VGA=n
567 +CONFIG_VMMOUSE=n
568 +CONFIG_SERIAL=n
569 +CONFIG_PARALLEL=n
570 +CONFIG_I8254=y
571 +CONFIG_PCSPK=n
572 +CONFIG_PCKBD=y
573 +CONFIG_FDC=y
574 +CONFIG_ACPI=y
575 +CONFIG_APM=y
576 +CONFIG_DMA=y
577 +CONFIG_IDE_ISA=y
578 +CONFIG_IDE_PIIX=y
579 +CONFIG_NE2000_ISA=n
580 +CONFIG_PIIX_PCI=y
581 +CONFIG_SOUND=n
582 +CONFIG_HPET=y
583 +CONFIG_APPLESMC=n
584 diff --git a/exec.c b/exec.c
585 index 063d2f6..9ba0d81 100644
586 --- a/exec.c
587 +++ b/exec.c
588 @@ -577,8 +577,10 @@ void cpu_exec_init_all(unsigned long tb_size)
589 #if !defined(CONFIG_USER_ONLY) || !defined(CONFIG_USE_GUEST_BASE)
590 /* There's no guest base to take into account, so go ahead and
591 initialize the prologue now. */
592 +#ifndef CONFIG_STUBDOM
593 tcg_prologue_init(&tcg_ctx);
594 #endif
595 +#endif
598 #if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
599 @@ -1662,7 +1664,6 @@ static void tcg_handle_interrupt(CPUState *env, int mask)
602 CPUInterruptHandler cpu_interrupt_handler = tcg_handle_interrupt;
604 #else /* CONFIG_USER_ONLY */
606 void cpu_interrupt(CPUState *env, int mask)
607 @@ -4475,7 +4476,9 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fprintf)
608 cpu_fprintf(f, "TB flush count %d\n", tb_flush_count);
609 cpu_fprintf(f, "TB invalidate count %d\n", tb_phys_invalidate_count);
610 cpu_fprintf(f, "TLB flush count %d\n", tlb_flush_count);
611 +#ifndef CONFIG_STUBDOM
612 tcg_dump_info(f, cpu_fprintf);
613 +#endif
616 #define MMUSUFFIX _cmmu
617 diff --git a/hmp-commands.hx b/hmp-commands.hx
618 index 834e6a8..7589204 100644
619 --- a/hmp-commands.hx
620 +++ b/hmp-commands.hx
621 @@ -315,6 +315,7 @@ STEXI
622 Resume emulation.
623 ETEXI
625 +#ifndef CONFIG_STUBDOM
627 .name = "gdbserver",
628 .args_type = "device:s?",
629 @@ -322,6 +323,7 @@ ETEXI
630 .help = "start gdbserver on given device (default 'tcp::1234'), stop with 'none'",
631 .mhandler.cmd = do_gdbserver,
633 +#endif
635 STEXI
636 @item gdbserver [@var{port}]
637 @@ -329,6 +331,7 @@ STEXI
638 Start gdbserver session (default @var{port}=1234)
639 ETEXI
643 .name = "x",
644 .args_type = "fmt:/,addr:l",
645 @@ -752,6 +755,7 @@ STEXI
646 Inject an NMI on the given CPU (x86 only).
647 ETEXI
649 +#ifndef CONFIG_STUBDOM
651 .name = "migrate",
652 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
653 @@ -836,6 +840,7 @@ Set the spice/vnc connection info for the migration target. The spice/vnc
654 server will ask the spice/vnc client to automatically reconnect using the
655 new parameters (if specified) once the vm migration finished successfully.
656 ETEXI
657 +#endif
660 .name = "snapshot_blkdev",
661 @@ -1053,6 +1058,7 @@ STEXI
662 Switch link @var{name} on (i.e. up) or off (i.e. down).
663 ETEXI
665 +#ifndef CONFIG_STUBDOM
667 .name = "watchdog_action",
668 .args_type = "action:s",
669 @@ -1066,6 +1072,7 @@ STEXI
670 @findex watchdog_action
671 Change watchdog action.
672 ETEXI
673 +#endif
676 .name = "acl_show",
677 diff --git a/hw/apic.c b/hw/apic.c
678 index 9febf40..85a216e 100644
679 --- a/hw/apic.c
680 +++ b/hw/apic.c
681 @@ -307,8 +307,9 @@ void cpu_set_apic_base(DeviceState *d, uint64_t val)
682 /* if disabled, cannot be enabled again */
683 if (!(val & MSR_IA32_APICBASE_ENABLE)) {
684 s->apicbase &= ~MSR_IA32_APICBASE_ENABLE;
685 +#ifndef CONFIG_STUBDOM
686 cpu_clear_apic_feature(s->cpu_env);
687 - s->spurious_vec &= ~APIC_SV_ENABLE;
688 +#endif
692 diff --git a/hw/pc.c b/hw/pc.c
693 index 8106197..baa1b6d 100644
694 --- a/hw/pc.c
695 +++ b/hw/pc.c
696 @@ -34,9 +34,11 @@
697 #include "smbios.h"
698 #include "loader.h"
699 #include "elf.h"
700 +#ifndef CONFIG_STUBDOM
701 #include "multiboot.h"
702 -#include "mc146818rtc.h"
703 +#endif
704 #include "msix.h"
705 +#include "mc146818rtc.h"
706 #include "sysbus.h"
707 #include "sysemu.h"
708 #include "blockdev.h"
709 @@ -579,8 +581,10 @@ int e820_add_entry(uint64_t address, uint64_t length, uint32_t type)
710 static void *bochs_bios_init(void)
712 void *fw_cfg;
713 +#ifndef CONFIG_STUBDOM
714 uint8_t *smbios_table;
715 size_t smbios_len;
716 +#endif
717 uint64_t *numa_fw_cfg;
718 int i, j;
720 @@ -603,10 +607,13 @@ static void *bochs_bios_init(void)
721 acpi_tables_len);
722 fw_cfg_add_bytes(fw_cfg, FW_CFG_IRQ0_OVERRIDE, &irq0override, 1);
724 +#ifndef CONFIG_STUBDOM
725 smbios_table = smbios_get_table(&smbios_len);
726 if (smbios_table)
727 fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
728 smbios_table, smbios_len);
729 +#endif
731 fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE, (uint8_t *)&e820_table,
732 sizeof(struct e820_table));
734 @@ -685,9 +692,11 @@ static void load_linux(void *fw_cfg,
735 else {
736 /* This looks like a multiboot kernel. If it is, let's stop
737 treating it like a Linux kernel. */
738 +#ifndef CONFIG_STUBDOM
739 if (load_multiboot(fw_cfg, f, kernel_filename, initrd_filename,
740 kernel_cmdline, kernel_size, header))
741 return;
742 +#endif
743 protocol = 0;
746 @@ -1106,13 +1115,17 @@ void pc_basic_device_init(qemu_irq *isa_irq,
747 rtc_irq = qdev_get_gpio_in(hpet, 0);
751 +#ifndef CONFIG_STUBDOM
752 *rtc_state = rtc_init(2000, rtc_irq);
753 +#endif
755 qemu_register_boot_set(pc_boot_set, *rtc_state);
757 pit = pit_init(0x40, 0);
758 +#ifdef CONFIG_PCSPK
759 pcspk_init(pit);
761 +#endif
762 for(i = 0; i < MAX_SERIAL_PORTS; i++) {
763 if (serial_hds[i]) {
764 serial_isa_init(i, serial_hds[i]);
765 diff --git a/hw/pc_piix.c b/hw/pc_piix.c
766 index 9a22a8a..e396ba0 100644
767 --- a/hw/pc_piix.c
768 +++ b/hw/pc_piix.c
769 @@ -31,8 +31,10 @@
770 #include "net.h"
771 #include "boards.h"
772 #include "ide.h"
773 +#ifndef CONFIG_STUBDOM
774 #include "kvm.h"
775 #include "kvmclock.h"
776 +#endif
777 #include "sysemu.h"
778 #include "sysbus.h"
779 #include "arch_init.h"
780 @@ -92,9 +94,11 @@ static void pc_init1(ram_addr_t ram_size,
782 pc_cpus_init(cpu_model);
784 +#ifndef CONFIG_STUBDOM
785 if (kvmclock_enabled) {
786 kvmclock_create();
788 +#endif
790 if (ram_size >= 0xe0000000 ) {
791 above_4g_mem_size = ram_size - 0xe0000000;
792 @@ -177,8 +181,6 @@ static void pc_init1(ram_addr_t ram_size,
795 if (pci_enabled && acpi_enabled) {
796 - i2c_bus *smbus;
798 if (!xen_enabled()) {
799 cmos_s3 = qemu_allocate_irqs(pc_cmos_set_s3_resume, rtc_state, 1);
800 } else {
801 @@ -186,10 +188,13 @@ static void pc_init1(ram_addr_t ram_size,
803 smi_irq = qemu_allocate_irqs(pc_acpi_smi_interrupt, first_cpu, 1);
804 /* TODO: Populate SPD eeprom data. */
805 +#ifndef CONFIG_STUBDOM
806 + i2c_bus *smbus;
807 smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100,
808 isa_get_irq(9), *cmos_s3, *smi_irq,
809 kvm_enabled());
810 smbus_eeprom_init(smbus, 8, NULL, 0);
811 +#endif
814 if (i440fx_state) {
815 diff --git a/monitor.c b/monitor.c
816 index 5f3bc72..99548ac 100644
817 --- a/monitor.c
818 +++ b/monitor.c
819 @@ -28,9 +28,11 @@
820 #include "hw/pcmcia.h"
821 #include "hw/pc.h"
822 #include "hw/pci.h"
823 +#ifndef CONFIG_STUBDOM
824 #include "hw/watchdog.h"
825 -#include "hw/loader.h"
826 #include "gdbstub.h"
827 +#endif
828 +#include "hw/loader.h"
829 #include "net.h"
830 #include "net/slirp.h"
831 #include "qemu-char.h"
832 @@ -44,7 +46,9 @@
833 #include "disas.h"
834 #include "balloon.h"
835 #include "qemu-timer.h"
836 +#ifndef CONFIG_STUBDOM
837 #include "migration.h"
838 +#endif
839 #include "kvm.h"
840 #include "acl.h"
841 #include "qint.h"
842 @@ -456,6 +460,7 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
843 case QEVENT_RTC_CHANGE:
844 event_name = "RTC_CHANGE";
845 break;
846 +#ifndef CONFIG_STUBDOM
847 case QEVENT_WATCHDOG:
848 event_name = "WATCHDOG";
849 break;
850 @@ -468,6 +473,7 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
851 case QEVENT_SPICE_DISCONNECTED:
852 event_name = "SPICE_DISCONNECTED";
853 break;
854 +#endif
855 default:
856 abort();
857 break;
858 @@ -1185,6 +1191,7 @@ static int expire_password(Monitor *mon, const QDict *qdict, QObject **ret_data)
859 return -1;
862 +#ifndef CONFIG_STUBDOM
863 static int client_migrate_info(Monitor *mon, const QDict *qdict, QObject **ret_data)
865 const char *protocol = qdict_get_str(qdict, "protocol");
866 @@ -1211,6 +1218,7 @@ static int client_migrate_info(Monitor *mon, const QDict *qdict, QObject **ret_d
867 qerror_report(QERR_INVALID_PARAMETER, "protocol");
868 return -1;
870 +#endif
872 static int do_screen_dump(Monitor *mon, const QDict *qdict, QObject **ret_data)
874 @@ -1275,10 +1283,13 @@ static int do_cont(Monitor *mon, const QDict *qdict, QObject **ret_data)
876 struct bdrv_iterate_context context = { mon, 0 };
878 +#ifndef CONFIG_STUBDOM
879 if (incoming_expected) {
880 qerror_report(QERR_MIGRATION_EXPECTED);
881 return -1;
883 +#endif
885 bdrv_iterate(encrypted_bdrv_it, &context);
886 /* only resume the vm if all keys are set and valid */
887 if (!context.err) {
888 @@ -1309,6 +1320,7 @@ static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs)
892 +#ifndef CONFIG_STUBDOM
893 static void do_gdbserver(Monitor *mon, const QDict *qdict)
895 const char *device = qdict_get_try_str(qdict, "device");
896 @@ -1332,6 +1344,7 @@ static void do_watchdog_action(Monitor *mon, const QDict *qdict)
897 monitor_printf(mon, "Unknown watchdog action '%s'\n", action);
900 +#endif
902 static void monitor_printc(Monitor *mon, int c)
904 @@ -3046,6 +3059,7 @@ static const mon_cmd_t info_cmds[] = {
905 .mhandler.info = do_info_usernet,
907 #endif
908 +#ifndef CONFIG_STUBDOM
910 .name = "migrate",
911 .args_type = "",
912 @@ -3054,6 +3068,7 @@ static const mon_cmd_t info_cmds[] = {
913 .user_print = do_info_migrate_print,
914 .mhandler.info_new = do_info_migrate,
916 +#endif
918 .name = "balloon",
919 .args_type = "",
920 @@ -3225,6 +3240,7 @@ static const mon_cmd_t qmp_query_cmds[] = {
921 .user_print = do_info_uuid_print,
922 .mhandler.info_new = do_info_uuid,
924 +#ifndef CONFIG_STUBDOM
926 .name = "migrate",
927 .args_type = "",
928 @@ -3233,6 +3249,7 @@ static const mon_cmd_t qmp_query_cmds[] = {
929 .user_print = do_info_migrate_print,
930 .mhandler.info_new = do_info_migrate,
932 +#endif
934 .name = "balloon",
935 .args_type = "",
936 diff --git a/net.c b/net.c
937 index 4f777c3..f2ce66f 100644
938 --- a/net.c
939 +++ b/net.c
940 @@ -26,14 +26,18 @@
941 #include "config-host.h"
943 #include "net/tap.h"
944 +#ifndef CONFIG_STUBDOM
945 #include "net/socket.h"
946 +#endif
947 #include "net/dump.h"
948 #include "net/slirp.h"
949 #include "net/vde.h"
950 #include "net/util.h"
951 #include "monitor.h"
952 #include "qemu-common.h"
953 +#ifndef CONFIG_STUBDOM
954 #include "qemu_socket.h"
955 +#endif
956 #include "hw/qdev.h"
957 #include "iov.h"
959 @@ -73,6 +77,7 @@ static void hex_dump(FILE *f, const uint8_t *buf, int size)
961 #endif
963 +#ifndef CONFIG_STUBDOM
964 static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
966 const char *p, *p1;
967 @@ -122,6 +127,7 @@ int parse_host_port(struct sockaddr_in *saddr, const char *str)
968 saddr->sin_port = htons(port);
969 return 0;
971 +#endif
973 void qemu_format_nic_info_str(VLANClientState *vc, uint8_t macaddr[6])
975 @@ -976,6 +982,7 @@ static const struct {
976 { /* end of list */ }
978 }, {
979 +#ifndef CONFIG_STUBDOM
980 .type = "socket",
981 .init = net_init_socket,
982 .desc = {
983 @@ -1003,6 +1010,7 @@ static const struct {
985 { /* end of list */ }
987 +#endif
988 #ifdef CONFIG_VDE
989 }, {
990 .type = "vde",
991 diff --git a/net/tap.c b/net/tap.c
992 index b8cd252..2a2a587 100644
993 --- a/net/tap.c
994 +++ b/net/tap.c
995 @@ -42,7 +42,9 @@
997 #include "net/tap-linux.h"
999 +#ifndef CONFIG_STUBDOM
1000 #include "hw/vhost_net.h"
1001 +#endif
1003 /* Maximum GSO packet size (64k) plus plenty of room for
1004 * the ethernet and virtio_net headers
1005 @@ -59,7 +61,9 @@ typedef struct TAPState {
1006 unsigned int write_poll : 1;
1007 unsigned int using_vnet_hdr : 1;
1008 unsigned int has_ufo: 1;
1009 +#ifndef CONFIG_STUBDOM
1010 VHostNetState *vhost_net;
1011 +#endif
1012 unsigned host_vnet_hdr_len;
1013 } TAPState;
1015 @@ -280,10 +284,12 @@ static void tap_cleanup(VLANClientState *nc)
1017 TAPState *s = DO_UPCAST(TAPState, nc, nc);
1019 +#ifndef CONFIG_STUBDOM
1020 if (s->vhost_net) {
1021 vhost_net_cleanup(s->vhost_net);
1022 s->vhost_net = NULL;
1024 +#endif
1026 qemu_purge_queued_packets(nc);
1028 @@ -341,7 +347,9 @@ static TAPState *net_tap_fd_init(VLANState *vlan,
1029 s->has_ufo = tap_probe_has_ufo(s->fd);
1030 tap_set_offload(&s->nc, 0, 0, 0, 0, 0);
1031 tap_read_poll(s, 1);
1032 +#ifndef CONFIG_STUBDOM
1033 s->vhost_net = NULL;
1034 +#endif
1035 return s;
1038 @@ -491,6 +499,7 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan
1042 +#ifndef CONFIG_STUBDOM
1043 if (qemu_opt_get_bool(opts, "vhost", !!qemu_opt_get(opts, "vhostfd") ||
1044 qemu_opt_get_bool(opts, "vhostforce", false))) {
1045 int vhostfd, r;
1046 @@ -513,13 +522,16 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan
1047 error_report("vhostfd= is not valid without vhost");
1048 return -1;
1050 +#endif
1052 return 0;
1055 +#ifndef CONFIG_STUBDOM
1056 VHostNetState *tap_get_vhost_net(VLANClientState *nc)
1058 TAPState *s = DO_UPCAST(TAPState, nc, nc);
1059 assert(nc->info->type == NET_CLIENT_TYPE_TAP);
1060 return s->vhost_net;
1062 +#endif
1063 diff --git a/qemu-char.c b/qemu-char.c
1064 index 5e04a20..121ecf6 100644
1065 --- a/qemu-char.c
1066 +++ b/qemu-char.c
1067 @@ -1803,6 +1803,7 @@ typedef struct {
1068 int max_size;
1069 } NetCharDriver;
1071 +#ifndef CONFIG_STUBDOM
1072 static int udp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
1074 NetCharDriver *s = chr->opaque;
1075 @@ -1902,6 +1903,7 @@ return_err:
1076 closesocket(fd);
1077 return NULL;
1079 +#endif
1081 /***********************************************************/
1082 /* TCP Net console */
1083 @@ -1918,6 +1920,7 @@ typedef struct {
1085 static void tcp_chr_accept(void *opaque);
1087 +#ifndef CONFIG_STUBDOM
1088 static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
1090 TCPCharDriver *s = chr->opaque;
1091 @@ -1928,6 +1931,7 @@ static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
1092 return len;
1095 +#endif
1097 static int tcp_chr_read_poll(void *opaque)
1099 @@ -1989,6 +1993,7 @@ static void tcp_chr_process_IAC_bytes(CharDriverState *chr,
1100 *size = j;
1103 +#ifndef CONFIG_STUBDOM
1104 static int tcp_get_msgfd(CharDriverState *chr)
1106 TCPCharDriver *s = chr->opaque;
1107 @@ -1996,6 +2001,7 @@ static int tcp_get_msgfd(CharDriverState *chr)
1108 s->msgfd = -1;
1109 return fd;
1111 +#endif
1113 #ifndef _WIN32
1114 static void unix_process_msgfd(CharDriverState *chr, struct msghdr *msg)
1115 @@ -2164,6 +2170,7 @@ static void tcp_chr_accept(void *opaque)
1116 tcp_chr_connect(chr);
1119 +#ifndef CONFIG_STUBDOM
1120 static void tcp_chr_close(CharDriverState *chr)
1122 TCPCharDriver *s = chr->opaque;
1123 @@ -2276,6 +2283,7 @@ static CharDriverState *qemu_chr_open_socket(QemuOpts *opts)
1124 qemu_free(chr);
1125 return NULL;
1127 +#endif
1129 /***********************************************************/
1130 /* Memory chardev */
1131 @@ -2470,8 +2478,10 @@ static const struct {
1132 CharDriverState *(*open)(QemuOpts *opts);
1133 } backend_table[] = {
1134 { .name = "null", .open = qemu_chr_open_null },
1135 +#ifndef CONFIG_STUBDOM
1136 { .name = "socket", .open = qemu_chr_open_socket },
1137 { .name = "udp", .open = qemu_chr_open_udp },
1138 +#endif
1139 { .name = "msmouse", .open = qemu_chr_open_msmouse },
1140 { .name = "vc", .open = text_console_init },
1141 #ifdef _WIN32
1142 diff --git a/qemu-options.hx b/qemu-options.hx
1143 index 9f121ad..55753eb 100644
1144 --- a/qemu-options.hx
1145 +++ b/qemu-options.hx
1146 @@ -1956,8 +1956,10 @@ STEXI
1147 Do not start CPU at startup (you must type 'c' in the monitor).
1148 ETEXI
1150 +#ifndef CONFIG_STUBDOM
1151 DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
1152 "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
1153 +#endif
1154 STEXI
1155 @item -gdb @var{dev}
1156 @findex -gdb
1157 @@ -1970,9 +1972,11 @@ within gdb and establish the connection via a pipe:
1158 @end example
1159 ETEXI
1161 +#ifndef CONFIG_STUBDOM
1162 DEF("s", 0, QEMU_OPTION_s, \
1163 "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
1164 QEMU_ARCH_ALL)
1165 +#endif
1166 STEXI
1167 @item -s
1168 @findex -s
1169 diff --git a/qmp-commands.hx b/qmp-commands.hx
1170 index fbd98ee..8c871d8 100644
1171 --- a/qmp-commands.hx
1172 +++ b/qmp-commands.hx
1173 @@ -429,6 +429,7 @@ Example:
1175 EQMP
1177 +#ifndef CONFIG_STUBDOM
1179 .name = "migrate",
1180 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
1181 @@ -441,6 +442,7 @@ EQMP
1182 .user_print = monitor_user_noop,
1183 .mhandler.cmd_new = do_migrate,
1185 +#endif
1187 SQMP
1188 migrate
1189 @@ -469,6 +471,7 @@ Notes:
1191 EQMP
1193 +#ifndef CONFIG_STUBDOM
1195 .name = "migrate_cancel",
1196 .args_type = "",
1197 @@ -477,6 +480,7 @@ EQMP
1198 .user_print = monitor_user_noop,
1199 .mhandler.cmd_new = do_migrate_cancel,
1201 +#endif
1203 SQMP
1204 migrate_cancel
1205 @@ -493,6 +497,7 @@ Example:
1207 EQMP
1209 +#ifndef CONFIG_STUBDOM
1211 .name = "migrate_set_speed",
1212 .args_type = "value:o",
1213 @@ -501,6 +506,7 @@ EQMP
1214 .user_print = monitor_user_noop,
1215 .mhandler.cmd_new = do_migrate_set_speed,
1217 +#endif
1219 SQMP
1220 migrate_set_speed
1221 @@ -518,7 +524,7 @@ Example:
1222 <- { "return": {} }
1224 EQMP
1226 +#ifndef CONFIG_STUBDOM
1228 .name = "migrate_set_downtime",
1229 .args_type = "value:T",
1230 @@ -527,6 +533,7 @@ EQMP
1231 .user_print = monitor_user_noop,
1232 .mhandler.cmd_new = do_migrate_set_downtime,
1234 +#endif
1236 SQMP
1237 migrate_set_downtime
1238 @@ -545,6 +552,7 @@ Example:
1240 EQMP
1242 +#ifndef CONFIG_STUBDOM
1244 .name = "client_migrate_info",
1245 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
1246 @@ -553,6 +561,7 @@ EQMP
1247 .user_print = monitor_user_noop,
1248 .mhandler.cmd_new = client_migrate_info,
1250 +#endif
1252 SQMP
1253 client_migrate_info
1254 diff --git a/target-i386/helper.c b/target-i386/helper.c
1255 index 89df997..2d11c3f 100644
1256 --- a/target-i386/helper.c
1257 +++ b/target-i386/helper.c
1258 @@ -1255,16 +1255,20 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
1259 /* init various static tables */
1260 if (!inited) {
1261 inited = 1;
1262 +#ifndef CONFIG_STUBDOM
1263 optimize_flags_init();
1264 +#endif
1265 #ifndef CONFIG_USER_ONLY
1266 prev_debug_excp_handler =
1267 cpu_set_debug_excp_handler(breakpoint_handler);
1268 #endif
1270 +#ifndef CONFIG_STUBDOM
1271 if (cpu_x86_register(env, cpu_model) < 0) {
1272 cpu_x86_close(env);
1273 return NULL;
1275 +#endif
1276 mce_init(env);
1278 qemu_init_vcpu(env);
1279 diff --git a/target-i386/helper.h b/target-i386/helper.h
1280 index 6b518ad..eff4a0c 100644
1281 --- a/target-i386/helper.h
1282 +++ b/target-i386/helper.h
1283 @@ -78,7 +78,9 @@ DEF_HELPER_1(cmpxchg8b, void, tl)
1284 DEF_HELPER_1(cmpxchg16b, void, tl)
1285 #endif
1286 DEF_HELPER_0(single_step, void)
1287 +#ifndef CONFIG_STUBDOM
1288 DEF_HELPER_0(cpuid, void)
1289 +#endif
1290 DEF_HELPER_0(rdtsc, void)
1291 DEF_HELPER_0(rdtscp, void)
1292 DEF_HELPER_0(rdpmc, void)
1293 diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
1294 index 3c539f3..a8179fc 100644
1295 --- a/target-i386/op_helper.c
1296 +++ b/target-i386/op_helper.c
1297 @@ -1947,6 +1947,7 @@ void helper_single_step(void)
1298 raise_exception(EXCP01_DB);
1301 +#ifndef CONFIG_STUBDOM
1302 void helper_cpuid(void)
1304 uint32_t eax, ebx, ecx, edx;
1305 @@ -1959,6 +1960,7 @@ void helper_cpuid(void)
1306 ECX = ecx;
1307 EDX = edx;
1309 +#endif
1311 void helper_enter_level(int level, int data32, target_ulong t1)
1313 diff --git a/target-i386/translate.c b/target-i386/translate.c
1314 index 199302e..b1b50fb 100644
1315 --- a/target-i386/translate.c
1316 +++ b/target-i386/translate.c
1317 @@ -6914,12 +6914,14 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
1319 break;
1320 #endif
1321 +#ifndef CONFIG_STUBDOM
1322 case 0x1a2: /* cpuid */
1323 if (s->cc_op != CC_OP_DYNAMIC)
1324 gen_op_set_cc_op(s->cc_op);
1325 gen_jmp_im(pc_start - s->cs_base);
1326 gen_helper_cpuid();
1327 break;
1328 +#endif
1329 case 0xf4: /* hlt */
1330 if (s->cpl != 0) {
1331 gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base);
1332 diff --git a/translate-all-stub.c b/translate-all-stub.c
1333 new file mode 100644
1334 index 0000000..fe94760
1335 --- /dev/null
1336 +++ b/translate-all-stub.c
1337 @@ -0,0 +1,65 @@
1339 + * Host code generation stub
1341 + * Copyright (c) 2003 Fabrice Bellard
1343 + * This library is free software; you can redistribute it and/or
1344 + * modify it under the terms of the GNU Lesser General Public
1345 + * License as published by the Free Software Foundation; either
1346 + * version 2 of the License, or (at your option) any later version.
1348 + * This library is distributed in the hope that it will be useful,
1349 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1350 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1351 + * Lesser General Public License for more details.
1353 + * You should have received a copy of the GNU Lesser General Public
1354 + * License along with this library; if not, see <http://www.gnu.org/licenses/>.
1355 + */
1356 +#include <stdarg.h>
1357 +#include <stdlib.h>
1358 +#include <stdio.h>
1359 +#include <string.h>
1360 +#include <inttypes.h>
1362 +#include "config.h"
1364 +#define NO_CPU_IO_DEFS
1365 +#include "cpu.h"
1366 +#include "exec-all.h"
1367 +#include "disas.h"
1368 +#include "tcg.h"
1369 +#include "qemu-timer.h"
1371 +/* code generation context */
1372 +TCGContext tcg_ctx;
1374 +uint16_t gen_opc_buf[OPC_BUF_SIZE];
1375 +TCGArg gen_opparam_buf[OPPARAM_BUF_SIZE];
1377 +target_ulong gen_opc_pc[OPC_BUF_SIZE];
1378 +uint16_t gen_opc_icount[OPC_BUF_SIZE];
1379 +uint8_t gen_opc_instr_start[OPC_BUF_SIZE];
1381 +void cpu_gen_init(void)
1383 + return ;
1386 +/* return non zero if the very first instruction is invalid so that
1387 + the virtual CPU can trigger an exception.
1389 + '*gen_code_size_ptr' contains the size of the generated code (host
1390 + code).
1392 +int cpu_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr)
1394 + return 0;
1396 +/* The cpu state corresponding to 'searched_pc' is restored.
1397 + */
1398 +int cpu_restore_state(TranslationBlock *tb,
1399 + CPUState *env, unsigned long searched_pc)
1401 + return 0;
1403 diff --git a/vl.c b/vl.c
1404 index bffba69..645717f 100644
1405 --- a/vl.c
1406 +++ b/vl.c
1407 @@ -118,9 +118,12 @@ int main(int argc, char **argv)
1408 #include "hw/pc.h"
1409 #include "hw/isa.h"
1410 #include "hw/baum.h"
1411 +#ifndef CONFIG_STUBDOM
1412 #include "hw/bt.h"
1413 #include "hw/watchdog.h"
1414 #include "hw/smbios.h"
1415 +#include "gdbstub.h"
1416 +#endif
1417 #include "hw/xen.h"
1418 #include "hw/qdev.h"
1419 #include "hw/loader.h"
1420 @@ -130,7 +133,6 @@ int main(int argc, char **argv)
1421 #include "monitor.h"
1422 #include "console.h"
1423 #include "sysemu.h"
1424 -#include "gdbstub.h"
1425 #include "qemu-timer.h"
1426 #include "qemu-char.h"
1427 #include "cache-utils.h"
1428 @@ -431,6 +433,9 @@ static void configure_rtc(QemuOpts *opts)
1430 /***********************************************************/
1431 /* Bluetooth support */
1433 +#ifndef CONFIG_STUBDOM
1435 static int nb_hcis;
1436 static int cur_hci;
1437 static struct HCIInfo *hci_table[MAX_NICS];
1438 @@ -620,6 +625,8 @@ static int bt_parse(const char *opt)
1439 return 1;
1442 +#endif
1444 /***********************************************************/
1445 /* QEMU Block devices */
1447 @@ -922,10 +929,14 @@ static int usb_device_add(const char *devname)
1448 /* the other ones */
1449 if (strstart(devname, "host:", &p)) {
1450 dev = usb_host_device_open(p);
1451 - } else if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) {
1452 + }
1453 +#ifndef CONFIG_STUBDOM
1454 + else if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) {
1455 dev = usb_bt_init(devname[2] ? hci_init(p) :
1456 bt_new_hci(qemu_find_bt_vlan(0)));
1457 - } else {
1458 + }
1459 +#endif
1460 + else {
1461 return -1;
1463 if (!dev)
1464 @@ -2032,7 +2043,9 @@ static const QEMUOption *lookup_opt(int argc, char **argv,
1466 int main(int argc, char **argv, char **envp)
1468 +#ifndef CONFIG_STUBDOM
1469 const char *gdbstub_dev = NULL;
1470 +#endif
1471 int i;
1472 int snapshot, linux_boot;
1473 const char *icount_option = NULL;
1474 @@ -2379,6 +2392,7 @@ int main(int argc, char **argv, char **envp)
1475 case QEMU_OPTION_bt:
1476 add_device_config(DEV_BT, optarg);
1477 break;
1478 +#ifdef CONFIG_SOUND
1479 case QEMU_OPTION_audio_help:
1480 if (!(audio_available())) {
1481 printf("Option %s not supported for this target\n", popt->name);
1482 @@ -2387,6 +2401,7 @@ int main(int argc, char **argv, char **envp)
1483 AUD_help ();
1484 exit (0);
1485 break;
1486 +#endif
1487 case QEMU_OPTION_soundhw:
1488 if (!(audio_available())) {
1489 printf("Option %s not supported for this target\n", popt->name);
1490 @@ -2433,12 +2448,14 @@ int main(int argc, char **argv, char **envp)
1491 case QEMU_OPTION_d:
1492 set_cpu_log(optarg);
1493 break;
1494 +#ifndef CONFIG_STUBDOM
1495 case QEMU_OPTION_s:
1496 gdbstub_dev = "tcp::" DEFAULT_GDBSTUB_PORT;
1497 break;
1498 case QEMU_OPTION_gdb:
1499 gdbstub_dev = optarg;
1500 break;
1501 +#endif
1502 case QEMU_OPTION_L:
1503 data_dir = optarg;
1504 break;
1505 @@ -2595,12 +2612,14 @@ int main(int argc, char **argv, char **envp)
1507 watchdog = optarg;
1508 break;
1509 +#ifndef CONFIG_STUBDOM
1510 case QEMU_OPTION_watchdog_action:
1511 if (select_watchdog_action(optarg) == -1) {
1512 fprintf(stderr, "Unknown -watchdog-action parameter\n");
1513 exit(1);
1515 break;
1516 +#endif
1517 case QEMU_OPTION_virtiocon:
1518 add_device_config(DEV_VIRTCON, optarg);
1519 default_virtcon = 0;
1520 @@ -2661,9 +2680,11 @@ int main(int argc, char **argv, char **envp)
1521 case QEMU_OPTION_acpitable:
1522 do_acpitable_option(optarg);
1523 break;
1524 +#ifndef CONFIG_STUBDOM
1525 case QEMU_OPTION_smbios:
1526 do_smbios_option(optarg);
1527 break;
1528 +#endif
1529 case QEMU_OPTION_enable_kvm:
1530 olist = qemu_find_opts("machine");
1531 qemu_opts_reset(olist);
1532 @@ -3001,7 +3022,9 @@ int main(int argc, char **argv, char **envp)
1533 if (default_vga)
1534 vga_interface_type = VGA_CIRRUS;
1536 +#ifndef CONFIG_STUBDOM
1537 socket_init();
1538 +#endif
1540 if (qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, 1) != 0)
1541 exit(1);
1542 @@ -3048,20 +3071,26 @@ int main(int argc, char **argv, char **envp)
1543 exit(1);
1546 +#ifndef CONFIG_STUBDOM
1547 /* init the bluetooth world */
1548 if (foreach_device_config(DEV_BT, bt_parse))
1549 exit(1);
1550 +#endif
1552 /* init the memory */
1553 if (ram_size == 0)
1554 ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
1556 +#ifndef CONFIG_STUBDOM
1557 /* init the dynamic translator */
1558 cpu_exec_init_all(tb_size * 1024 * 1024);
1559 +#endif
1561 bdrv_init_with_whitelist();
1563 +#ifndef CONFIG_STUBDOM
1564 blk_mig_init();
1565 +#endif
1567 /* open the virtual block devices */
1568 if (snapshot)
1569 @@ -3076,8 +3105,10 @@ int main(int argc, char **argv, char **envp)
1570 default_drive(default_sdcard, snapshot, machine->use_scsi,
1571 IF_SD, 0, SD_OPTS);
1573 +#ifndef CONFIG_STUBDOM
1574 register_savevm_live(NULL, "ram", 0, 4, NULL, ram_save_live, NULL,
1575 ram_load, NULL);
1576 +#endif
1578 if (nb_numa_nodes > 0) {
1579 int i;
1580 @@ -3139,11 +3170,13 @@ int main(int argc, char **argv, char **envp)
1581 if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, 0) != 0)
1582 exit(0);
1584 +#ifndef CONFIG_STUBDOM
1585 if (watchdog) {
1586 i = select_watchdog(watchdog);
1587 if (i > 0)
1588 exit (i == 1 ? 1 : 0);
1590 +#endif
1592 if (machine->compat_props) {
1593 qdev_prop_register_global_list(machine->compat_props);
1594 @@ -3248,11 +3281,13 @@ int main(int argc, char **argv, char **envp)
1596 text_consoles_set_display(ds);
1598 +#ifndef CONFIG_STUBDOM
1599 if (gdbstub_dev && gdbserver_start(gdbstub_dev) < 0) {
1600 fprintf(stderr, "qemu: could not open gdbserver on device '%s'\n",
1601 gdbstub_dev);
1602 exit(1);
1604 +#endif
1606 qdev_machine_creation_done();
1608 @@ -3273,6 +3308,7 @@ int main(int argc, char **argv, char **envp)
1612 +#ifndef CONFIG_STUBDOM
1613 if (incoming) {
1614 int ret = qemu_start_incoming_migration(incoming);
1615 if (ret < 0) {
1616 @@ -3283,6 +3319,7 @@ int main(int argc, char **argv, char **envp)
1617 } else if (autostart) {
1618 vm_start();
1620 +#endif
1622 os_setup_post();