Merge lp:~fboudra/qemu-linaro/new-upstream-release-1.1.50-2012.08-0ubuntu1 into lp:ubuntu/quantal/qemu-linaro

Proposed by Fathi Boudra on 2012-08-21
Status: Merged
Merged at revision: 12924
Proposed branch: lp:~fboudra/qemu-linaro/new-upstream-release-1.1.50-2012.08-0ubuntu1
Merge into: lp:ubuntu/quantal/qemu-linaro
Diff against target: 277276 lines (+132951/-79172)
1210 files modified
.gitignore (+12/-0)
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/applied-patches (+0/-1)
.pc/powerpc-missing-include.patch/cache-utils.h (+0/-41)
CODING_STYLE (+1/-1)
Changelog (+1/-1)
Changelog.LINARO (+31/-0)
MAINTAINERS (+80/-18)
Makefile (+78/-65)
Makefile.dis (+0/-3)
Makefile.hw (+3/-5)
Makefile.objs (+79/-278)
Makefile.target (+68/-317)
Makefile.user (+2/-3)
QMP/qmp-events.txt (+18/-0)
QMP/qmp-spec.txt (+17/-3)
QMP/qom-fuse (+138/-0)
VERSION (+1/-1)
VERSION.LINARO (+1/-1)
aio.c (+82/-120)
arch_init.c (+197/-85)
arch_init.h (+1/-2)
arm-semi.c (+0/-509)
async.c (+4/-4)
audio/Makefile.objs (+14/-0)
audio/audio.c (+28/-6)
audio/audio_int.h (+6/-0)
audio/audio_template.h (+2/-0)
audio/mixeng.c (+24/-12)
audio/mixeng_template.h (+3/-1)
audio/paaudio.c (+460/-43)
audio/spiceaudio.c (+41/-0)
audio/winwaveaudio.c (+1/-1)
balloon.c (+15/-1)
balloon.h (+2/-0)
bitops.h (+103/-13)
block-migration.c (+158/-117)
block.c (+514/-410)
block.h (+33/-77)
block/Makefile.objs (+11/-0)
block/blkdebug.c (+67/-59)
block/cow.c (+1/-7)
block/curl.c (+8/-10)
block/iscsi.c (+420/-43)
block/nbd.c (+49/-28)
block/qcow.c (+2/-8)
block/qcow2-cache.c (+20/-23)
block/qcow2-cluster.c (+409/-165)
block/qcow2-refcount.c (+168/-100)
block/qcow2-snapshot.c (+20/-4)
block/qcow2.c (+381/-61)
block/qcow2.h (+85/-6)
block/qed-check.c (+11/-0)
block/qed-l2-cache.c (+18/-4)
block/qed.c (+33/-30)
block/qed.h (+0/-2)
block/raw-posix.c (+109/-4)
block/raw.c (+7/-3)
block/rbd.c (+96/-21)
block/sheepdog.c (+310/-151)
block/stream.c (+54/-120)
block/vdi.c (+149/-357)
block/vmdk.c (+3/-3)
block/vpc.c (+3/-6)
block/vvfat.c (+45/-27)
block_int.h (+162/-41)
blockdev.c (+129/-155)
blockdev.h (+2/-3)
bsd-user/Makefile.objs (+2/-0)
bsd-user/main.c (+12/-9)
bsd-user/qemu.h (+6/-6)
bsd-user/signal.c (+1/-1)
cache-utils.h (+2/-1)
check-qdict.c (+0/-378)
check-qfloat.c (+0/-53)
check-qint.c (+0/-87)
check-qjson.c (+0/-728)
check-qlist.c (+0/-127)
check-qstring.c (+0/-107)
cmd.c (+29/-23)
configure (+377/-205)
console.c (+25/-1)
console.h (+3/-0)
coroutine-sigaltstack.c (+334/-0)
coroutine-ucontext.c (+32/-0)
cpu-all.h (+53/-69)
cpu-common.h (+2/-2)
cpu-defs.h (+8/-19)
cpu-exec.c (+66/-31)
cpus.c (+178/-87)
cpus.h (+2/-0)
cputlb.c (+364/-0)
cputlb.h (+45/-0)
cursor.c (+2/-1)
cutils.c (+46/-213)
darwin-user/commpage.c (+0/-357)
darwin-user/ioctls.h (+0/-4)
darwin-user/ioctls_types.h (+0/-1)
darwin-user/machload.c (+0/-902)
darwin-user/main.c (+0/-1024)
darwin-user/mmap.c (+0/-409)
darwin-user/qemu.h (+0/-178)
darwin-user/signal.c (+0/-452)
darwin-user/syscall.c (+0/-1566)
darwin-user/syscalls.h (+0/-384)
debian/changelog (+25/-0)
debian/control (+28/-20)
debian/patches/define_AT_EMPTY_PATH.patch (+7/-5)
debian/patches/powerpc-missing-include.patch (+0/-18)
debian/patches/series (+0/-1)
debian/qemu-keymaps.install (+1/-1)
debian/qemu-kvm-spice.install (+2/-2)
debian/qemu-user-static.install (+7/-7)
debian/qemu-user.install (+6/-6)
debian/rules (+15/-8)
def-helper.h (+34/-1)
default-configs/i386-darwin-user.mak (+0/-1)
default-configs/microblaze-softmmu.mak (+2/-0)
default-configs/microblazeel-softmmu.mak (+2/-0)
default-configs/or32-linux-user.mak (+1/-0)
default-configs/or32-softmmu.mak (+4/-0)
default-configs/pci.mak (+3/-1)
default-configs/ppc-darwin-user.mak (+0/-3)
default-configs/ppc-softmmu.mak (+1/-0)
default-configs/ppc64-softmmu.mak (+1/-0)
default-configs/ppcemb-softmmu.mak (+1/-0)
default-configs/s390x-softmmu.mak (+0/-1)
device_tree.c (+136/-2)
device_tree.h (+25/-1)
dis-asm.h (+3/-0)
disas.c (+45/-12)
disas.h (+1/-1)
dma-helpers.c (+209/-18)
dma.h (+222/-11)
docs/ccid.txt (+1/-1)
docs/libcacard.txt (+13/-13)
docs/qapi-code-gen.txt (+4/-2)
docs/specs/acpi_pci_hotplug.txt (+13/-5)
docs/specs/ivshmem_device_spec.txt (+1/-1)
docs/specs/ppc-spapr-hcalls.txt (+78/-0)
docs/specs/qcow2.txt (+111/-25)
docs/tracing.txt (+41/-7)
docs/usb-storage.txt (+38/-0)
docs/usb2.txt (+15/-0)
docs/xen-save-devices-state.txt (+34/-0)
dump-stub.c (+64/-0)
dump.c (+873/-0)
dump.h (+35/-0)
dyngen-exec.h (+2/-2)
elf.h (+44/-0)
error.c (+16/-2)
error.h (+6/-1)
event_notifier.c (+21/-15)
event_notifier.h (+6/-2)
exec-all.h (+57/-42)
exec-obsolete.h (+32/-25)
exec.c (+318/-822)
fpu/softfloat-macros.h (+9/-9)
fpu/softfloat-specialize.h (+4/-4)
fpu/softfloat.c (+69/-69)
fpu/softfloat.h (+7/-8)
fsdev/Makefile.objs (+9/-0)
fsdev/virtfs-proxy-helper.texi (+1/-1)
gdbstub.c (+149/-81)
gdbstub.h (+17/-8)
gen-icount.h (+4/-4)
hmp-commands.hx (+47/-22)
hmp.c (+169/-3)
hmp.h (+7/-0)
hw/9pfs/Makefile.objs (+9/-0)
hw/9pfs/virtio-9p.c (+14/-9)
hw/Makefile.objs (+175/-0)
hw/a15mpcore.c (+34/-20)
hw/a9mpcore.c (+36/-40)
hw/ac97.c (+105/-116)
hw/acpi.c (+4/-1)
hw/acpi.h (+1/-1)
hw/acpi_piix4.c (+110/-73)
hw/alpha/Makefile.objs (+4/-0)
hw/alpha_dp264.c (+1/-1)
hw/alpha_sys.h (+1/-2)
hw/alpha_typhoon.c (+7/-7)
hw/an5206.c (+1/-1)
hw/apb_pci.c (+53/-14)
hw/apb_pci.h (+2/-1)
hw/apic-msidef.h (+30/-0)
hw/apic.c (+26/-15)
hw/apic.h (+5/-1)
hw/apic_common.c (+13/-3)
hw/apic_internal.h (+0/-1)
hw/arm-misc.h (+7/-7)
hw/arm/Makefile.objs (+46/-0)
hw/arm11mpcore.c (+33/-29)
hw/arm_boot.c (+60/-17)
hw/arm_gic.c (+152/-295)
hw/arm_gic_common.c (+194/-0)
hw/arm_gic_internal.h (+138/-0)
hw/arm_l2x0.c (+1/-1)
hw/arm_mptimer.c (+3/-2)
hw/arm_pic.c (+35/-9)
hw/armv7m.c (+12/-7)
hw/armv7m_nvic.c (+135/-23)
hw/axis_dev88.c (+5/-3)
hw/blizzard.c (+1/-3)
hw/block-common.c (+64/-0)
hw/block-common.h (+79/-0)
hw/boards.h (+1/-0)
hw/bt-l2cap.c (+7/-4)
hw/bt-sdp.c (+3/-3)
hw/cadence_gem.c (+1233/-0)
hw/cadence_ttc.c (+489/-0)
hw/cadence_uart.c (+513/-0)
hw/cirrus_vga.c (+6/-6)
hw/collie.c (+1/-1)
hw/cris-boot.c (+6/-4)
hw/cris-boot.h (+1/-1)
hw/cris/Makefile.objs (+13/-0)
hw/cris_pic_cpu.c (+2/-2)
hw/cuda.c (+1/-1)
hw/dp8393x.c (+4/-5)
hw/ds1338.c (+1/-0)
hw/dsi.c (+16/-10)
hw/dummy_m68k.c (+1/-1)
hw/e1000.c (+125/-59)
hw/e1000_hw.h (+12/-0)
hw/eepro100.c (+21/-16)
hw/es1370.c (+7/-7)
hw/escc.c (+0/-1)
hw/esp-pci.c (+518/-0)
hw/esp.c (+136/-199)
hw/esp.h (+119/-0)
hw/etraxfs.h (+1/-1)
hw/etraxfs_eth.c (+5/-5)
hw/etraxfs_ser.c (+2/-2)
hw/exynos4210.c (+87/-19)
hw/exynos4210.h (+8/-2)
hw/exynos4210_combiner.c (+0/-10)
hw/exynos4210_gic.c (+70/-62)
hw/exynos4210_i2c.c (+334/-0)
hw/exynos4210_mct.c (+1/-5)
hw/exynos4210_pwm.c (+1/-1)
hw/exynos4210_rtc.c (+592/-0)
hw/exynos4210_uart.c (+3/-3)
hw/exynos4_boards.c (+4/-3)
hw/fdc.c (+252/-114)
hw/fdc.h (+11/-23)
hw/grlib.h (+1/-1)
hw/hd-geometry.c (+157/-0)
hw/hda-audio.c (+198/-57)
hw/highbank.c (+14/-16)
hw/i2c.c (+19/-11)
hw/i386/Makefile.objs (+15/-0)
hw/i82374.c (+4/-1)
hw/i82378.c (+3/-2)
hw/i8254.c (+46/-241)
hw/i8254.h (+11/-0)
hw/i8254_common.c (+311/-0)
hw/i8254_internal.h (+85/-0)
hw/ide.h (+3/-1)
hw/ide/Makefile.objs (+10/-0)
hw/ide/ahci.c (+39/-27)
hw/ide/ahci.h (+3/-2)
hw/ide/atapi.c (+31/-0)
hw/ide/cmd646.c (+7/-9)
hw/ide/core.c (+199/-76)
hw/ide/ich.c (+10/-15)
hw/ide/internal.h (+17/-2)
hw/ide/macio.c (+5/-4)
hw/ide/piix.c (+6/-6)
hw/ide/qdev.c (+54/-26)
hw/ide/via.c (+4/-5)
hw/imx.h (+34/-0)
hw/imx_avic.c (+408/-0)
hw/imx_ccm.c (+321/-0)
hw/imx_serial.c (+467/-0)
hw/imx_timer.c (+689/-0)
hw/integratorcp.c (+9/-7)
hw/intel-hda.c (+23/-29)
hw/intel-hda.h (+3/-0)
hw/ioapic.c (+1/-1)
hw/ioh3420.c (+4/-7)
hw/irq.c (+17/-0)
hw/irq.h (+5/-0)
hw/isa-bus.c (+16/-7)
hw/isa.h (+8/-2)
hw/ivshmem.c (+76/-54)
hw/kvm/Makefile.objs (+1/-0)
hw/kvm/apic.c (+34/-4)
hw/kvm/arm_gic.c (+153/-0)
hw/kvm/clock.c (+16/-2)
hw/kvm/i8254.c (+301/-0)
hw/kvm/i8259.c (+1/-1)
hw/kvm/ioapic.c (+1/-1)
hw/kvmvapic.c (+14/-12)
hw/kzm.c (+154/-0)
hw/lan9118.c (+9/-7)
hw/lance.c (+2/-2)
hw/leon3.c (+10/-8)
hw/lm32/Makefile.objs (+23/-0)
hw/lm32_boards.c (+14/-10)
hw/loader.c (+3/-3)
hw/loader.h (+2/-1)
hw/lsi53c895a.c (+26/-35)
hw/m48t59.c (+25/-21)
hw/m68k/Makefile.objs (+4/-0)
hw/mainstone.c (+8/-8)
hw/mc146818rtc.c (+0/-42)
hw/mc146818rtc.h (+1/-2)
hw/mc146818rtc_regs.h (+62/-0)
hw/mcf.h (+2/-2)
hw/mcf5206.c (+2/-2)
hw/mcf5208.c (+2/-2)
hw/mcf_fec.c (+4/-5)
hw/mcf_intc.c (+2/-2)
hw/megasas.c (+2209/-0)
hw/mfi.h (+1249/-0)
hw/microblaze/Makefile.objs (+9/-0)
hw/microblaze_boot.c (+177/-0)
hw/microblaze_boot.h (+10/-0)
hw/microblaze_pic_cpu.c (+2/-2)
hw/microblaze_pic_cpu.h (+1/-1)
hw/milkymist-minimac2.c (+4/-4)
hw/milkymist-sysctl.c (+17/-9)
hw/milkymist-vgafb.c (+4/-1)
hw/milkymist.c (+9/-7)
hw/mips/Makefile.objs (+6/-0)
hw/mips_cpudevs.h (+2/-2)
hw/mips_fulong2e.c (+16/-13)
hw/mips_int.c (+3/-3)
hw/mips_jazz.c (+11/-8)
hw/mips_malta.c (+52/-60)
hw/mips_mipssim.c (+11/-8)
hw/mips_r4k.c (+11/-8)
hw/mips_timer.c (+10/-10)
hw/mipsnet.c (+5/-5)
hw/mpc8544_guts.c (+1/-1)
hw/msi.c (+25/-3)
hw/msi.h (+6/-0)
hw/msix.c (+290/-148)
hw/msix.h (+19/-10)
hw/multiboot.c (+9/-3)
hw/musicpal.c (+9/-9)
hw/ne2000-isa.c (+2/-2)
hw/ne2000.c (+10/-35)
hw/ne2000.h (+2/-2)
hw/nseries.c (+38/-38)
hw/omap.h (+2/-103)
hw/omap1.c (+16/-14)
hw/omap2.c (+4/-4)
hw/omap3.c (+10/-4)
hw/omap3_boot.c (+15/-3)
hw/omap_i2c.c (+28/-1)
hw/omap_lcdc.c (+2/-3)
hw/omap_sx1.c (+3/-3)
hw/omap_tap.c (+42/-6)
hw/omap_uart.c (+13/-1)
hw/opencores_eth.c (+7/-32)
hw/openpic.c (+2/-10)
hw/openrisc/Makefile.objs (+3/-0)
hw/openrisc_pic.c (+60/-0)
hw/openrisc_sim.c (+150/-0)
hw/openrisc_timer.c (+101/-0)
hw/overo.c (+1/-1)
hw/palm.c (+8/-8)
hw/pc.c (+79/-91)
hw/pc.h (+5/-2)
hw/pc_piix.c (+147/-250)
hw/pc_sysfw.c (+12/-0)
hw/pci-hotplug.c (+19/-9)
hw/pci.c (+120/-49)
hw/pci.h (+66/-22)
hw/pci_bridge.c (+20/-17)
hw/pci_bridge.h (+1/-1)
hw/pci_bridge_dev.c (+171/-0)
hw/pci_host.c (+3/-0)
hw/pci_ids.h (+4/-0)
hw/pci_internals.h (+5/-1)
hw/pci_regs.h (+2/-1)
hw/pcie_port.c (+1/-11)
hw/pcnet-pci.c (+4/-5)
hw/pcnet.c (+15/-4)
hw/pcnet.h (+4/-3)
hw/petalogix_ml605_mmu.c (+23/-137)
hw/petalogix_s3adsp1800_mmu.c (+27/-133)
hw/pflash_cfi01.c (+0/-1)
hw/piix_pci.c (+22/-3)
hw/pl011.c (+3/-1)
hw/pl031.c (+52/-29)
hw/ppc.c (+57/-66)
hw/ppc.h (+14/-14)
hw/ppc/Makefile.objs (+28/-0)
hw/ppc405.h (+4/-4)
hw/ppc405_uc.c (+21/-31)
hw/ppc440_bamboo.c (+11/-8)
hw/ppc4xx.h (+4/-4)
hw/ppc4xx_devs.c (+17/-7)
hw/ppc_booke.c (+10/-10)
hw/ppc_newworld.c (+15/-6)
hw/ppc_oldworld.c (+15/-6)
hw/ppc_prep.c (+21/-44)
hw/ppce500_mpc8544ds.c (+258/-58)
hw/ppce500_spin.c (+8/-7)
hw/prep_pci.c (+17/-0)
hw/ps2.c (+1/-1)
hw/ps2.h (+29/-0)
hw/ptimer.c (+13/-0)
hw/pxa.h (+3/-3)
hw/pxa2xx.c (+162/-212)
hw/pxa2xx_dma.c (+6/-6)
hw/pxa2xx_gpio.c (+6/-5)
hw/pxa2xx_lcd.c (+6/-6)
hw/pxa2xx_pic.c (+54/-42)
hw/qdev-addr.c (+2/-2)
hw/qdev-dma.h (+10/-0)
hw/qdev-monitor.c (+96/-74)
hw/qdev-properties.c (+376/-254)
hw/qdev.c (+247/-120)
hw/qdev.h (+59/-44)
hw/qxl-logger.c (+38/-13)
hw/qxl-render.c (+16/-12)
hw/qxl.c (+275/-170)
hw/qxl.h (+10/-4)
hw/r2d.c (+12/-8)
hw/realview.c (+10/-88)
hw/realview_gic.c (+26/-20)
hw/rtl8139.c (+65/-52)
hw/s390-virtio-bus.c (+56/-26)
hw/s390-virtio-bus.h (+10/-2)
hw/s390-virtio.c (+44/-21)
hw/s390x/Makefile.objs (+3/-0)
hw/scsi-bus.c (+383/-87)
hw/scsi-defs.h (+18/-3)
hw/scsi-disk.c (+810/-346)
hw/scsi-generic.c (+5/-8)
hw/scsi.h (+18/-0)
hw/serial.c (+16/-1)
hw/sh.h (+1/-1)
hw/sh4/Makefile.objs (+5/-0)
hw/sh7750.c (+1/-1)
hw/sh_intc.c (+1/-1)
hw/sh_serial.c (+4/-2)
hw/shix.c (+1/-1)
hw/shpc.c (+682/-0)
hw/shpc.h (+48/-0)
hw/slotid_cap.c (+44/-0)
hw/slotid_cap.h (+11/-0)
hw/smc91c111.c (+4/-4)
hw/spapr.c (+72/-14)
hw/spapr.h (+35/-5)
hw/spapr_hcall.c (+89/-21)
hw/spapr_iommu.c (+246/-0)
hw/spapr_llan.c (+58/-50)
hw/spapr_pci.c (+226/-173)
hw/spapr_pci.h (+6/-4)
hw/spapr_rtas.c (+17/-4)
hw/spapr_vio.c (+121/-329)
hw/spapr_vio.h (+46/-44)
hw/spapr_vscsi.c (+25/-23)
hw/spapr_vty.c (+9/-10)
hw/sparc/Makefile.objs (+8/-0)
hw/sparc64/Makefile.objs (+4/-0)
hw/spi.c (+16/-9)
hw/spitz.c (+14/-14)
hw/ssi.c (+18/-11)
hw/stellaris_enet.c (+4/-4)
hw/strongarm.c (+8/-8)
hw/strongarm.h (+1/-1)
hw/sun4m.c (+35/-23)
hw/sun4u.c (+104/-60)
hw/sysbus.c (+39/-6)
hw/sysbus.h (+3/-0)
hw/tosa.c (+9/-9)
hw/twl92230.c (+5/-4)
hw/usb-audio.c (+0/-714)
hw/usb-bt.c (+0/-557)
hw/usb-bus.c (+0/-584)
hw/usb-ccid.c (+0/-1365)
hw/usb-desc.c (+0/-601)
hw/usb-desc.h (+0/-117)
hw/usb-ehci.c (+0/-2379)
hw/usb-hid.c (+0/-638)
hw/usb-hub.c (+0/-549)
hw/usb-libhw.c (+0/-63)
hw/usb-msd.c (+0/-677)
hw/usb-musb.c (+0/-1562)
hw/usb-net.c (+0/-1423)
hw/usb-ohci.c (+0/-1896)
hw/usb-ohci.h (+0/-9)
hw/usb-serial.c (+0/-637)
hw/usb-uhci.c (+0/-1408)
hw/usb-uhci.h (+0/-10)
hw/usb-wacom.c (+0/-381)
hw/usb-xhci.c (+0/-2928)
hw/usb.c (+0/-592)
hw/usb.h (+22/-7)
hw/usb/Makefile.objs (+14/-0)
hw/usb/bus.c (+623/-0)
hw/usb/core.c (+703/-0)
hw/usb/desc.c (+642/-0)
hw/usb/desc.h (+181/-0)
hw/usb/dev-audio.c (+715/-0)
hw/usb/dev-bluetooth.c (+558/-0)
hw/usb/dev-hid.c (+638/-0)
hw/usb/dev-hub.c (+589/-0)
hw/usb/dev-network.c (+1427/-0)
hw/usb/dev-serial.c (+638/-0)
hw/usb/dev-smartcard-reader.c (+1373/-0)
hw/usb/dev-storage.c (+703/-0)
hw/usb/dev-uas.c (+779/-0)
hw/usb/dev-wacom.c (+382/-0)
hw/usb/hcd-ehci.c (+2630/-0)
hw/usb/hcd-musb.c (+1562/-0)
hw/usb/hcd-ohci.c (+1914/-0)
hw/usb/hcd-uhci.c (+1425/-0)
hw/usb/hcd-xhci.c (+2944/-0)
hw/usb/host-bsd.c (+647/-0)
hw/usb/host-linux.c (+2001/-0)
hw/usb/host-stub.c (+52/-0)
hw/usb/libhw.c (+64/-0)
hw/usb/redirect.c (+1501/-0)
hw/versatile_i2c.c (+105/-0)
hw/versatilepb.c (+30/-8)
hw/vexpress.c (+20/-13)
hw/vga-isa-mm.c (+4/-1)
hw/vga-isa.c (+7/-1)
hw/vga-pci.c (+7/-1)
hw/vga.c (+35/-7)
hw/vga_int.h (+7/-4)
hw/vhost.c (+9/-7)
hw/vhost_net.c (+13/-13)
hw/vhost_net.h (+1/-1)
hw/virtex_ml507.c (+20/-15)
hw/virtio-balloon.c (+12/-3)
hw/virtio-blk.c (+66/-55)
hw/virtio-blk.h (+9/-7)
hw/virtio-net.c (+18/-14)
hw/virtio-net.h (+1/-0)
hw/virtio-pci.c (+163/-84)
hw/virtio-pci.h (+8/-3)
hw/virtio-scsi.c (+140/-16)
hw/virtio-serial-bus.c (+84/-25)
hw/virtio.c (+67/-0)
hw/virtio.h (+7/-3)
hw/vmport.c (+6/-6)
hw/vmware_vga.c (+16/-6)
hw/vt82c686.c (+1/-1)
hw/watchdog.c (+2/-2)
hw/wdt_i6300esb.c (+1/-3)
hw/xen-host-pci-device.c (+396/-0)
hw/xen-host-pci-device.h (+55/-0)
hw/xen.h (+1/-0)
hw/xen_apic.c (+95/-0)
hw/xen_backend.c (+11/-12)
hw/xen_backend.h (+1/-0)
hw/xen_common.h (+24/-2)
hw/xen_console.c (+5/-3)
hw/xen_devconfig.c (+12/-11)
hw/xen_disk.c (+52/-26)
hw/xen_machine_pv.c (+4/-2)
hw/xen_nic.c (+6/-10)
hw/xen_platform.c (+9/-6)
hw/xen_pt.c (+849/-0)
hw/xen_pt.h (+301/-0)
hw/xen_pt_config_init.c (+1869/-0)
hw/xen_pt_msi.c (+620/-0)
hw/xenfb.c (+5/-8)
hw/xgmac.c (+4/-4)
hw/xics.c (+110/-49)
hw/xics.h (+7/-1)
hw/xilinx.h (+15/-15)
hw/xilinx_axidma.c (+3/-3)
hw/xilinx_axienet.c (+7/-8)
hw/xilinx_ethlite.c (+9/-8)
hw/xilinx_intc.c (+2/-2)
hw/xilinx_timer.c (+15/-11)
hw/xilinx_uartlite.c (+3/-2)
hw/xilinx_zynq.c (+157/-0)
hw/xio3130_downstream.c (+4/-7)
hw/xio3130_upstream.c (+4/-7)
hw/xtensa/Makefile.objs (+5/-0)
hw/xtensa_lx60.c (+17/-11)
hw/xtensa_pic.c (+8/-8)
hw/xtensa_sim.c (+15/-9)
hw/z2.c (+13/-13)
hw/zynq_slcr.c (+535/-0)
include/qemu/cpu.h (+82/-0)
include/qemu/object.h (+87/-8)
include/qemu/ratelimit.h (+48/-0)
input.c (+2/-2)
iohandler.c (+2/-2)
ioport-user.c (+0/-60)
ioport.c (+16/-1)
ioport.h (+1/-0)
iorange.h (+1/-0)
iov.c (+142/-51)
iov.h (+71/-6)
kvm-all.c (+360/-82)
kvm-stub.c (+70/-39)
kvm.h (+113/-51)
libcacard/Makefile (+11/-15)
libcacard/vcard_emul_nss.c (+26/-10)
libcacard/vscclient.c (+11/-11)
linux-aio.c (+3/-4)
linux-headers/asm-arm/kvm.h (+57/-16)
linux-headers/asm-arm/kvm_para.h (+1/-9)
linux-headers/asm-generic/kvm_para.h (+5/-0)
linux-headers/asm-powerpc/kvm.h (+1/-0)
linux-headers/asm-s390/kvm.h (+7/-0)
linux-headers/linux/kvm.h (+51/-0)
linux-user/Makefile.objs (+7/-0)
linux-user/alpha/syscall_nr.h (+1/-1)
linux-user/arm/nwfpe/Makefile.objs (+2/-0)
linux-user/arm/syscall_nr.h (+1/-1)
linux-user/cpu-uname.c (+1/-4)
linux-user/elfload.c (+89/-24)
linux-user/ioctls.h (+34/-0)
linux-user/m68k/syscall.h (+1/-1)
linux-user/main.c (+181/-58)
linux-user/mmap.c (+24/-12)
linux-user/openrisc/syscall.h (+24/-0)
linux-user/openrisc/syscall_nr.h (+506/-0)
linux-user/openrisc/target_signal.h (+26/-0)
linux-user/openrisc/termbits.h (+294/-0)
linux-user/qemu.h (+8/-7)
linux-user/signal.c (+354/-124)
linux-user/strace.c (+11/-1)
linux-user/strace.list (+3/-0)
linux-user/syscall.c (+349/-43)
linux-user/syscall_defs.h (+192/-109)
linux-user/syscall_types.h (+38/-2)
lm32-dis.c (+361/-0)
m68k-semi.c (+0/-408)
main-loop.c (+104/-71)
main-loop.h (+2/-5)
memory.c (+46/-30)
memory.h (+42/-5)
memory_mapping-stub.c (+33/-0)
memory_mapping.c (+246/-0)
memory_mapping.h (+64/-0)
migration-fd.c (+1/-1)
migration-tcp.c (+23/-58)
migration.c (+44/-58)
migration.h (+13/-10)
module.c (+0/-1)
monitor.c (+520/-416)
monitor.h (+5/-0)
nbd.c (+157/-124)
nbd.h (+3/-3)
net.c (+437/-861)
net.h (+52/-61)
net/Makefile.objs (+12/-0)
net/dump.c (+37/-16)
net/dump.h (+3/-3)
net/hub.c (+339/-0)
net/hub.h (+29/-0)
net/queue.c (+17/-21)
net/queue.h (+6/-19)
net/slirp.c (+108/-124)
net/slirp.h (+3/-4)
net/socket.c (+133/-147)
net/socket.h (+3/-3)
net/tap-aix.c (+1/-1)
net/tap-bsd.c (+1/-7)
net/tap-haiku.c (+1/-1)
net/tap-linux.c (+6/-3)
net/tap-solaris.c (+1/-1)
net/tap-win32.c (+21/-19)
net/tap.c (+99/-99)
net/tap.h (+14/-13)
net/vde.c (+17/-19)
net/vde.h (+3/-2)
os-posix.c (+9/-0)
os-win32.c (+7/-1)
osdep.c (+40/-0)
osdep.h (+18/-9)
oslib-posix.c (+6/-0)
oslib-win32.c (+3/-0)
pc-bios/README (+2/-2)
pc-bios/keymaps/fi (+0/-2)
pc-bios/mpc8544ds.dts (+0/-119)
pc-bios/optionrom/Makefile (+1/-1)
poison.h (+2/-1)
posix-aio-compat.c (+19/-34)
ppc-dis.c (+1/-1)
qapi-schema-guest.json (+236/-16)
qapi-schema-test.json (+11/-1)
qapi-schema.json (+636/-68)
qapi/Makefile.objs (+3/-0)
qapi/opts-visitor.c (+427/-0)
qapi/opts-visitor.h (+31/-0)
qapi/qapi-types-core.h (+1/-3)
qapi/qapi-visit-core.c (+151/-7)
qapi/qapi-visit-core.h (+19/-0)
qapi/qmp-core.h (+10/-1)
qapi/qmp-dispatch.c (+6/-2)
qapi/qmp-input-visitor.c (+98/-46)
qapi/qmp-input-visitor.h (+2/-0)
qapi/qmp-output-visitor.c (+5/-3)
qapi/qmp-registry.c (+20/-8)
qapi/string-output-visitor.c (+1/-1)
qemu-aio.h (+25/-15)
qemu-barrier.h (+31/-4)
qemu-bridge-helper.c (+21/-3)
qemu-char.c (+19/-12)
qemu-common.h (+71/-44)
qemu-config.c (+45/-10)
qemu-config.h (+7/-0)
qemu-coroutine-io.c (+37/-68)
qemu-coroutine-sleep.c (+2/-1)
qemu-doc.texi (+52/-139)
qemu-file.h (+1/-1)
qemu-ga.c (+339/-65)
qemu-img-cmds.hx (+2/-2)
qemu-img.c (+77/-29)
qemu-img.texi (+47/-1)
qemu-io.c (+45/-6)
qemu-log.c (+164/-0)
qemu-log.h (+112/-46)
qemu-nbd.c (+86/-36)
qemu-nbd.texi (+1/-1)
qemu-option-internal.h (+53/-0)
qemu-option.c (+135/-82)
qemu-option.h (+20/-3)
qemu-options.hx (+181/-90)
qemu-os-win32.h (+35/-0)
qemu-queue.h (+1/-1)
qemu-sockets.c (+57/-13)
qemu-tech.texi (+2/-3)
qemu-thread-posix.c (+1/-1)
qemu-thread-win32.c (+1/-1)
qemu-thread.h (+2/-1)
qemu-timer.c (+69/-119)
qemu-timer.h (+6/-9)
qemu-tool.c (+5/-4)
qemu-user.c (+37/-0)
qemu_socket.h (+6/-8)
qerror.c (+38/-1)
qerror.h (+28/-0)
qga/Makefile.objs (+5/-0)
qga/channel-posix.c (+17/-1)
qga/channel-win32.c (+4/-0)
qga/commands-posix.c (+603/-128)
qga/commands-win32.c (+167/-11)
qga/commands.c (+7/-1)
qga/guest-agent-core.h (+9/-1)
qjson.h (+1/-0)
qmp-commands.hx (+165/-57)
qmp.c (+2/-0)
qom/Makefile (+0/-1)
qom/Makefile.objs (+4/-0)
qom/container.c (+25/-0)
qom/cpu.c (+58/-0)
qom/object.c (+169/-71)
qtest.c (+444/-0)
qtest.h (+53/-0)
readline.c (+3/-0)
roms/Makefile (+27/-0)
roms/config.seabios (+1/-0)
roms/config.vga.cirrus (+3/-0)
roms/config.vga.isavga (+3/-0)
roms/config.vga.qxl (+6/-0)
roms/config.vga.stdvga (+3/-0)
roms/config.vga.vmware (+6/-0)
roms/configure-seabios.sh (+5/-0)
rules.mak (+46/-1)
savevm.c (+155/-60)
scripts/checkpatch.pl (+5/-0)
scripts/create_config (+9/-5)
scripts/gtester-cat (+26/-0)
scripts/kvm/kvm_flightrecorder (+126/-0)
scripts/kvm/kvm_stat (+25/-1)
scripts/kvm/vmxcap (+13/-0)
scripts/make-release (+24/-0)
scripts/qapi-commands.py (+19/-9)
scripts/qapi-types.py (+8/-2)
scripts/qapi-visit.py (+114/-27)
scripts/qapi.py (+47/-11)
scripts/qemu-binfmt-conf.sh (+1/-0)
scripts/qemu-gdb.py (+89/-0)
scripts/qtest (+5/-0)
scripts/signrom.py (+40/-0)
scripts/signrom.sh (+0/-45)
scripts/simpletrace.py (+80/-46)
scripts/texi2pod.pl (+9/-0)
scripts/tracetool (+0/-643)
scripts/tracetool.py (+138/-0)
scripts/tracetool/__init__.py (+274/-0)
scripts/tracetool/backend/__init__.py (+115/-0)
scripts/tracetool/backend/dtrace.py (+97/-0)
scripts/tracetool/backend/simple.py (+107/-0)
scripts/tracetool/backend/stderr.py (+56/-0)
scripts/tracetool/backend/ust.py (+90/-0)
scripts/tracetool/format/__init__.py (+103/-0)
scripts/tracetool/format/c.py (+20/-0)
scripts/tracetool/format/d.py (+20/-0)
scripts/tracetool/format/h.py (+45/-0)
scripts/tracetool/format/stap.py (+20/-0)
scripts/update-linux-headers.sh (+20/-1)
slirp/Makefile.objs (+3/-0)
slirp/cksum.c (+1/-1)
slirp/if.c (+53/-34)
slirp/ip.h (+8/-12)
slirp/ip_icmp.c (+7/-0)
slirp/ip_icmp.h (+1/-0)
slirp/ip_input.c (+7/-0)
slirp/libslirp.h (+1/-1)
slirp/main.h (+1/-0)
slirp/mbuf.c (+21/-0)
slirp/mbuf.h (+1/-0)
slirp/misc.c (+1/-45)
slirp/sbuf.c (+6/-0)
slirp/slirp.c (+14/-6)
slirp/slirp.h (+4/-14)
slirp/tcp.h (+25/-13)
slirp/tcp_output.c (+1/-0)
slirp/tcp_subr.c (+14/-4)
slirp/udp.c (+8/-0)
slirp/udp.h (+1/-0)
softmmu-semi.h (+6/-6)
softmmu_defs.h (+45/-17)
softmmu_header.h (+52/-23)
softmmu_template.h (+98/-68)
spice-qemu-char.c (+1/-1)
sysconfigs/target/cpus-x86_64.conf (+128/-0)
sysconfigs/target/target-x86_64.conf (+0/-100)
sysemu.h (+8/-7)
target-alpha/Makefile.objs (+3/-0)
target-alpha/STATUS (+1/-1)
target-alpha/cpu-qom.h (+71/-0)
target-alpha/cpu.c (+58/-0)
target-alpha/cpu.h (+31/-17)
target-alpha/fpu_helper.c (+822/-0)
target-alpha/helper.c (+61/-15)
target-alpha/helper.h (+70/-71)
target-alpha/int_helper.c (+319/-0)
target-alpha/machine.c (+26/-26)
target-alpha/mem_helper.c (+151/-0)
target-alpha/op_helper.c (+0/-1379)
target-alpha/sys_helper.c (+87/-0)
target-alpha/translate.c (+159/-127)
target-arm/Makefile.objs (+7/-0)
target-arm/arm-semi.c (+509/-0)
target-arm/cpu-qom.h (+113/-0)
target-arm/cpu.c (+850/-0)
target-arm/cpu.h (+273/-64)
target-arm/helper.c (+1677/-1516)
target-arm/helper.h (+4/-7)
target-arm/iwmmxt_helper.c (+33/-33)
target-arm/kvm.c (+150/-68)
target-arm/machine.c (+8/-4)
target-arm/neon_helper.c (+45/-45)
target-arm/op_helper.c (+46/-52)
target-arm/translate.c (+258/-407)
target-cris/Makefile.objs (+4/-0)
target-cris/cpu-qom.h (+70/-0)
target-cris/cpu.c (+90/-0)
target-cris/cpu.h (+22/-10)
target-cris/helper.c (+11/-11)
target-cris/mmu.c (+7/-7)
target-cris/mmu.h (+3/-3)
target-cris/op_helper.c (+10/-12)
target-cris/translate.c (+79/-99)
target-cris/translate_v10.c (+14/-13)
target-i386/Makefile.objs (+17/-0)
target-i386/arch_dump.c (+449/-0)
target-i386/arch_memory_mapping.c (+272/-0)
target-i386/cc_helper.c (+387/-0)
target-i386/cc_helper_template.h (+277/-0)
target-i386/cpu-qom.h (+79/-0)
target-i386/cpu.c (+1814/-0)
target-i386/cpu.h (+92/-28)
target-i386/cpuid.c (+0/-1369)
target-i386/excp_helper.c (+129/-0)
target-i386/fpu_helper.c (+1304/-0)
target-i386/helper.c (+41/-148)
target-i386/helper.h (+2/-2)
target-i386/helper_template.h (+0/-334)
target-i386/int_helper.c (+500/-0)
target-i386/ioport-user.c (+60/-0)
target-i386/kvm-stub.c (+18/-0)
target-i386/kvm.c (+73/-41)
target-i386/kvm_i386.h (+16/-0)
target-i386/machine.c (+90/-90)
target-i386/mem_helper.c (+161/-0)
target-i386/misc_helper.c (+603/-0)
target-i386/op_helper.c (+0/-5924)
target-i386/ops_sse.h (+587/-480)
target-i386/seg_helper.c (+2475/-0)
target-i386/shift_helper_template.h (+110/-0)
target-i386/smm_helper.c (+307/-0)
target-i386/svm_helper.c (+716/-0)
target-i386/translate.c (+204/-141)
target-lm32/Makefile.objs (+4/-0)
target-lm32/cpu-qom.h (+71/-0)
target-lm32/cpu.c (+81/-0)
target-lm32/cpu.h (+30/-20)
target-lm32/helper.c (+11/-26)
target-lm32/machine.c (+11/-11)
target-lm32/op_helper.c (+5/-7)
target-lm32/translate.c (+19/-19)
target-m68k/Makefile.objs (+5/-0)
target-m68k/cpu-qom.h (+70/-0)
target-m68k/cpu.c (+170/-0)
target-m68k/cpu.h (+11/-10)
target-m68k/helper.c (+92/-154)
target-m68k/m68k-semi.c (+408/-0)
target-m68k/op_helper.c (+13/-15)
target-m68k/translate.c (+8/-8)
target-microblaze/Makefile.objs (+4/-0)
target-microblaze/cpu-qom.h (+70/-0)
target-microblaze/cpu.c (+120/-0)
target-microblaze/cpu.h (+35/-20)
target-microblaze/helper.c (+8/-5)
target-microblaze/mmu.c (+5/-4)
target-microblaze/mmu.h (+3/-3)
target-microblaze/op_helper.c (+8/-9)
target-microblaze/translate.c (+112/-98)
target-mips/Makefile.objs (+4/-0)
target-mips/TODO (+2/-2)
target-mips/cpu-qom.h (+74/-0)
target-mips/cpu.c (+69/-0)
target-mips/cpu.h (+37/-32)
target-mips/helper.c (+14/-13)
target-mips/helper.h (+2/-2)
target-mips/machine.c (+2/-2)
target-mips/op_helper.c (+73/-80)
target-mips/translate.c (+190/-188)
target-openrisc/Makefile.objs (+4/-0)
target-openrisc/cpu.c (+220/-0)
target-openrisc/cpu.h (+458/-0)
target-openrisc/exception.c (+27/-0)
target-openrisc/exception.h (+28/-0)
target-openrisc/exception_helper.c (+29/-0)
target-openrisc/fpu_helper.c (+300/-0)
target-openrisc/helper.h (+70/-0)
target-openrisc/int_helper.c (+79/-0)
target-openrisc/interrupt.c (+74/-0)
target-openrisc/interrupt_helper.c (+57/-0)
target-openrisc/machine.c (+47/-0)
target-openrisc/mmu.c (+243/-0)
target-openrisc/mmu_helper.c (+63/-0)
target-openrisc/sys_helper.c (+287/-0)
target-openrisc/translate.c (+1835/-0)
target-ppc/Makefile.objs (+12/-0)
target-ppc/cpu-qom.h (+77/-0)
target-ppc/cpu.h (+105/-51)
target-ppc/excp_helper.c (+969/-0)
target-ppc/fpu_helper.c (+1740/-0)
target-ppc/helper.c (+11/-3183)
target-ppc/helper.h (+291/-290)
target-ppc/int_helper.c (+1564/-0)
target-ppc/kvm.c (+257/-27)
target-ppc/kvm_ppc.c (+1/-1)
target-ppc/kvm_ppc.h (+24/-14)
target-ppc/machine.c (+2/-10)
target-ppc/mem_helper.c (+295/-0)
target-ppc/misc_helper.c (+124/-0)
target-ppc/mmu_helper.c (+3326/-0)
target-ppc/mpic_helper.c (+35/-0)
target-ppc/op_helper.c (+0/-4570)
target-ppc/timebase_helper.c (+159/-0)
target-ppc/translate.c (+378/-248)
target-ppc/translate_init.c (+375/-121)
target-s390x/Makefile.objs (+5/-0)
target-s390x/cpu-qom.h (+71/-0)
target-s390x/cpu.c (+96/-0)
target-s390x/cpu.h (+31/-26)
target-s390x/helper.c (+31/-57)
target-s390x/helper.h (+152/-0)
target-s390x/helpers.h (+0/-152)
target-s390x/kvm.c (+90/-39)
target-s390x/op_helper.c (+39/-41)
target-s390x/translate.c (+31/-31)
target-sh4/Makefile.objs (+4/-0)
target-sh4/cpu-qom.h (+70/-0)
target-sh4/cpu.c (+90/-0)
target-sh4/cpu.h (+18/-8)
target-sh4/helper.c (+14/-14)
target-sh4/op_helper.c (+8/-10)
target-sh4/translate.c (+29/-52)
target-sparc/Makefile.objs (+8/-0)
target-sparc/cc_helper.c (+33/-33)
target-sparc/cpu-qom.h (+75/-0)
target-sparc/cpu.c (+896/-0)
target-sparc/cpu.h (+56/-36)
target-sparc/cpu_init.c (+0/-848)
target-sparc/fop_helper.c (+34/-34)
target-sparc/helper.c (+8/-8)
target-sparc/helper.h (+11/-11)
target-sparc/int32_helper.c (+3/-3)
target-sparc/int64_helper.c (+6/-6)
target-sparc/ldst_helper.c (+297/-232)
target-sparc/machine.c (+2/-2)
target-sparc/mmu_helper.c (+22/-25)
target-sparc/op_helper.c (+0/-74)
target-sparc/translate.c (+97/-70)
target-sparc/win_helper.c (+29/-29)
target-unicore32/Makefile.objs (+4/-0)
target-unicore32/cpu-qom.h (+59/-0)
target-unicore32/cpu.c (+104/-0)
target-unicore32/cpu.h (+19/-17)
target-unicore32/helper.c (+38/-87)
target-unicore32/helper.h (+2/-1)
target-unicore32/op_helper.c (+6/-5)
target-unicore32/translate.c (+32/-31)
target-xtensa/Makefile.objs (+6/-0)
target-xtensa/core-dc232b.c (+27/-0)
target-xtensa/core-dc233c.c (+55/-0)
target-xtensa/core-dc233c/core-isa.h (+474/-0)
target-xtensa/core-dc233c/gdb-config.c (+145/-0)
target-xtensa/core-fsf.c (+27/-0)
target-xtensa/cpu-qom.h (+80/-0)
target-xtensa/cpu.c (+88/-0)
target-xtensa/cpu.h (+47/-26)
target-xtensa/helper.c (+56/-68)
target-xtensa/helper.h (+39/-0)
target-xtensa/helpers.h (+0/-39)
target-xtensa/op_helper.c (+151/-142)
target-xtensa/translate.c (+66/-46)
target-xtensa/xtensa-semi.c (+223/-0)
targphys.h (+16/-0)
tcg/arm/tcg-target.c (+64/-11)
tcg/hppa/tcg-target.c (+140/-23)
tcg/i386/tcg-target.c (+253/-79)
tcg/ia64/tcg-target.c (+51/-5)
tcg/mips/tcg-target.c (+51/-7)
tcg/ppc/tcg-target.c (+90/-26)
tcg/ppc/tcg-target.h (+1/-1)
tcg/ppc64/tcg-target.c (+52/-15)
tcg/s390/tcg-target.c (+48/-4)
tcg/sparc/tcg-target.c (+126/-8)
tcg/tcg.c (+344/-65)
tcg/tcg.h (+5/-8)
tcg/tci/tcg-target.c (+9/-3)
tcg/tci/tcg-target.h (+1/-1)
tci.c (+29/-19)
test-coroutine.c (+0/-192)
test-qmp-commands.c (+0/-142)
test-qmp-input-visitor.c (+0/-271)
test-qmp-output-visitor.c (+0/-423)
test-string-input-visitor.c (+0/-195)
test-string-output-visitor.c (+0/-188)
tests/.gitignore (+13/-0)
tests/Makefile (+148/-44)
tests/check-block.sh (+21/-0)
tests/check-qdict.c (+378/-0)
tests/check-qfloat.c (+53/-0)
tests/check-qint.c (+87/-0)
tests/check-qjson.c (+728/-0)
tests/check-qlist.c (+127/-0)
tests/check-qstring.c (+107/-0)
tests/fdc-test.c (+381/-0)
tests/hd-geo-test.c (+428/-0)
tests/libqtest.c (+466/-0)
tests/libqtest.h (+352/-0)
tests/m48t59-test.c (+259/-0)
tests/qemu-iotests-quick.sh (+17/-0)
tests/qemu-iotests/002.out (+2/-2)
tests/qemu-iotests/005 (+1/-1)
tests/qemu-iotests/005.out (+1/-1)
tests/qemu-iotests/009 (+2/-2)
tests/qemu-iotests/010 (+3/-3)
tests/qemu-iotests/011 (+1/-1)
tests/qemu-iotests/012.out (+1/-1)
tests/qemu-iotests/013.out (+1/-1)
tests/qemu-iotests/014.out (+1/-1)
tests/qemu-iotests/015.out (+1/-1)
tests/qemu-iotests/016.out (+6/-6)
tests/qemu-iotests/017.out (+512/-512)
tests/qemu-iotests/018.out (+512/-512)
tests/qemu-iotests/019.out (+770/-770)
tests/qemu-iotests/020.out (+512/-512)
tests/qemu-iotests/022.out (+1/-1)
tests/qemu-iotests/023.out (+1448/-1448)
tests/qemu-iotests/024.out (+3/-3)
tests/qemu-iotests/026.out (+104/-104)
tests/qemu-iotests/027.out (+1/-1)
tests/qemu-iotests/028.out (+224/-224)
tests/qemu-iotests/029.out (+2/-2)
tests/qemu-iotests/030 (+132/-40)
tests/qemu-iotests/030.out (+2/-2)
tests/qemu-iotests/031 (+80/-0)
tests/qemu-iotests/031.out (+204/-0)
tests/qemu-iotests/032 (+69/-0)
tests/qemu-iotests/032.out (+78/-0)
tests/qemu-iotests/033 (+73/-0)
tests/qemu-iotests/033.out (+29/-0)
tests/qemu-iotests/034 (+113/-0)
tests/qemu-iotests/034.out (+81/-0)
tests/qemu-iotests/035 (+72/-0)
tests/qemu-iotests/035.out (+392/-0)
tests/qemu-iotests/036 (+68/-0)
tests/qemu-iotests/036.out (+52/-0)
tests/qemu-iotests/037 (+119/-0)
tests/qemu-iotests/037.out (+645/-0)
tests/qemu-iotests/038 (+133/-0)
tests/qemu-iotests/038.out (+909/-0)
tests/qemu-iotests/039 (+136/-0)
tests/qemu-iotests/039.out (+53/-0)
tests/qemu-iotests/check (+3/-3)
tests/qemu-iotests/common (+28/-0)
tests/qemu-iotests/common.config (+1/-1)
tests/qemu-iotests/common.rc (+56/-11)
tests/qemu-iotests/group (+21/-12)
tests/qemu-iotests/iotests.py (+12/-8)
tests/qemu-iotests/qcow2.py (+240/-0)
tests/qemu-iotests/qed.py (+235/-0)
tests/rtc-test.c (+280/-0)
tests/tcg/lm32/Makefile (+8/-5)
tests/tcg/openrisc/Makefile (+71/-0)
tests/tcg/openrisc/test_add.c (+43/-0)
tests/tcg/openrisc/test_addc.c (+38/-0)
tests/tcg/openrisc/test_addi.c (+33/-0)
tests/tcg/openrisc/test_addic.c (+33/-0)
tests/tcg/openrisc/test_and_or.c (+65/-0)
tests/tcg/openrisc/test_bf.c (+47/-0)
tests/tcg/openrisc/test_bnf.c (+51/-0)
tests/tcg/openrisc/test_div.c (+54/-0)
tests/tcg/openrisc/test_divu.c (+34/-0)
tests/tcg/openrisc/test_extx.c (+78/-0)
tests/tcg/openrisc/test_fx.c (+57/-0)
tests/tcg/openrisc/test_j.c (+26/-0)
tests/tcg/openrisc/test_jal.c (+26/-0)
tests/tcg/openrisc/test_lf_add.c (+39/-0)
tests/tcg/openrisc/test_lf_div.c (+37/-0)
tests/tcg/openrisc/test_lf_eqs.c (+88/-0)
tests/tcg/openrisc/test_lf_ges.c (+88/-0)
tests/tcg/openrisc/test_lf_gts.c (+86/-0)
tests/tcg/openrisc/test_lf_les.c (+88/-0)
tests/tcg/openrisc/test_lf_lts.c (+92/-0)
tests/tcg/openrisc/test_lf_mul.c (+22/-0)
tests/tcg/openrisc/test_lf_nes.c (+89/-0)
tests/tcg/openrisc/test_lf_rem.c (+32/-0)
tests/tcg/openrisc/test_lf_sub.c (+35/-0)
tests/tcg/openrisc/test_logic.c (+105/-0)
tests/tcg/openrisc/test_lx.c (+84/-0)
tests/tcg/openrisc/test_movhi.c (+31/-0)
tests/tcg/openrisc/test_mul.c (+61/-0)
tests/tcg/openrisc/test_muli.c (+48/-0)
tests/tcg/openrisc/test_mulu.c (+48/-0)
tests/tcg/openrisc/test_sfeq.c (+43/-0)
tests/tcg/openrisc/test_sfeqi.c (+39/-0)
tests/tcg/openrisc/test_sfges.c (+44/-0)
tests/tcg/openrisc/test_sfgesi.c (+40/-0)
tests/tcg/openrisc/test_sfgeu.c (+44/-0)
tests/tcg/openrisc/test_sfgeui.c (+41/-0)
tests/tcg/openrisc/test_sfgts.c (+45/-0)
tests/tcg/openrisc/test_sfgtsi.c (+41/-0)
tests/tcg/openrisc/test_sfgtu.c (+43/-0)
tests/tcg/openrisc/test_sfgtui.c (+42/-0)
tests/tcg/openrisc/test_sfles.c (+26/-0)
tests/tcg/openrisc/test_sflesi.c (+39/-0)
tests/tcg/openrisc/test_sfleu.c (+43/-0)
tests/tcg/openrisc/test_sfleui.c (+39/-0)
tests/tcg/openrisc/test_sflts.c (+43/-0)
tests/tcg/openrisc/test_sfltsi.c (+39/-0)
tests/tcg/openrisc/test_sfltu.c (+43/-0)
tests/tcg/openrisc/test_sfltui.c (+39/-0)
tests/tcg/openrisc/test_sfne.c (+43/-0)
tests/tcg/openrisc/test_sfnei.c (+39/-0)
tests/tcg/openrisc/test_sub.c (+35/-0)
tests/tcg/test-mmap.c (+1/-1)
tests/tcg/xtensa/Makefile (+3/-0)
tests/tcg/xtensa/macros.inc (+17/-0)
tests/tcg/xtensa/test_break.S (+34/-0)
tests/tcg/xtensa/test_loop.S (+86/-0)
tests/tcg/xtensa/test_mmu.S (+209/-16)
tests/test-coroutine.c (+219/-0)
tests/test-iov.c (+260/-0)
tests/test-qmp-commands.c (+181/-0)
tests/test-qmp-input-strict.c (+234/-0)
tests/test-qmp-input-visitor.c (+316/-0)
tests/test-qmp-output-visitor.c (+477/-0)
tests/test-string-input-visitor.c (+195/-0)
tests/test-string-output-visitor.c (+188/-0)
tests/test-visitor-serialization.c (+784/-0)
thunk.c (+28/-0)
thunk.h (+28/-0)
trace-events (+328/-16)
trace/control.c (+3/-0)
trace/simple.c (+176/-126)
trace/simple.h (+32/-8)
translate-all.c (+4/-4)
ui/Makefile.objs (+14/-0)
ui/cocoa.m (+3/-2)
ui/spice-core.c (+14/-8)
ui/spice-display.c (+20/-8)
ui/vnc-auth-sasl.c (+3/-1)
ui/vnc-auth-sasl.h (+2/-2)
ui/vnc-auth-vencrypt.c (+2/-1)
ui/vnc-enc-hextile-template.h (+1/-0)
ui/vnc-jobs-async.c (+0/-341)
ui/vnc-jobs-sync.c (+0/-73)
ui/vnc-jobs.c (+351/-0)
ui/vnc-jobs.h (+1/-16)
ui/vnc.c (+35/-23)
ui/vnc.h (+2/-17)
usb-bsd.c (+0/-647)
usb-linux.c (+0/-1904)
usb-redir.c (+0/-1474)
usb-stub.c (+0/-52)
user-exec.c (+19/-11)
vl.c (+129/-91)
vmstate.h (+12/-7)
xen-all.c (+179/-19)
xen-mapcache.c (+29/-8)
xen-mapcache.h (+7/-2)
xen-stub.c (+4/-0)
xtensa-semi.c (+0/-224)
To merge this branch: bzr merge lp:~fboudra/qemu-linaro/new-upstream-release-1.1.50-2012.08-0ubuntu1
Reviewer Review Type Date Requested Status
Serge Hallyn Approve on 2012-08-23
Ricardo Salveti Approve on 2012-08-21
Ubuntu branches 2012-08-21 Pending
Review via email: mp+120592@code.launchpad.net

Description of the change

  * New upstream release.
    - support emulated systems with more than 2G of memory. (LP: #1030588)
  * Drop powerpc-missing-include.patch - merged upstream.
  * Update debian/control:
    - drop perl build dependency.
    - add libfdt-dev build dependency.
  * Update debian/qemu-keymaps.install file.
  * Update debian/rules:
    - update QEMU_CPU for ARM architecture: armv4l -> armv7l.
    - update conf_audio_drv: default to PulseAudio since PA is the default on
      Ubuntu.
    - enable KVM on ARM architecture.
    - enable flat device tree support (--enable-fdt). (LP: #1030594)

To post a comment you must log in.
Ricardo Salveti (rsalveti) wrote :

Seems sane, only comment is that we could also move it to the 3.9.3 standard.

Just built with pbuilder and was able to use it with ARM user mode emulation with linaro-media-create, without any issues.

Would be nice to get someone from the server team to review it as well.

review: Approve
Serge Hallyn (serge-hallyn) wrote :

looks good to me, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.gitignore'
2--- .gitignore 2012-03-15 16:18:18 +0000
3+++ .gitignore 2012-08-21 15:04:54 +0000
4@@ -39,13 +39,16 @@
5 qemu-img-cmds.h
6 qemu-io
7 qemu-ga
8+qemu-bridge-helper
9 qemu-monitor.texi
10+vscclient
11 QMP/qmp-commands.txt
12 test-coroutine
13 test-qmp-input-visitor
14 test-qmp-output-visitor
15 test-string-input-visitor
16 test-string-output-visitor
17+test-visitor-serialization
18 fsdev/virtfs-proxy-helper.1
19 fsdev/virtfs-proxy-helper.pod
20 .gdbinit
21@@ -68,6 +71,10 @@
22 *.vr
23 *.d
24 *.o
25+*.lo
26+*.la
27+*.pc
28+.libs
29 *.swp
30 *.orig
31 .pc
32@@ -75,9 +82,14 @@
33 pc-bios/bios-pq/status
34 pc-bios/vgabios-pq/status
35 pc-bios/optionrom/linuxboot.bin
36+pc-bios/optionrom/linuxboot.raw
37+pc-bios/optionrom/linuxboot.img
38 pc-bios/optionrom/multiboot.bin
39 pc-bios/optionrom/multiboot.raw
40+pc-bios/optionrom/multiboot.img
41 pc-bios/optionrom/kvmvapic.bin
42+pc-bios/optionrom/kvmvapic.raw
43+pc-bios/optionrom/kvmvapic.img
44 .stgit-*
45 cscope.*
46 tags
47
48=== added file '.pc/.quilt_patches'
49--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
50+++ .pc/.quilt_patches 2012-08-21 15:04:54 +0000
51@@ -0,0 +1,1 @@
52+debian/patches
53
54=== added file '.pc/.quilt_series'
55--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
56+++ .pc/.quilt_series 2012-08-21 15:04:54 +0000
57@@ -0,0 +1,1 @@
58+series
59
60=== modified file '.pc/applied-patches'
61--- .pc/applied-patches 2012-04-22 13:53:58 +0000
62+++ .pc/applied-patches 2012-08-21 15:04:54 +0000
63@@ -1,2 +1,1 @@
64 define_AT_EMPTY_PATH.patch
65-powerpc-missing-include.patch
66
67=== removed directory '.pc/powerpc-missing-include.patch'
68=== removed file '.pc/powerpc-missing-include.patch/cache-utils.h'
69--- .pc/powerpc-missing-include.patch/cache-utils.h 2012-04-22 13:53:58 +0000
70+++ .pc/powerpc-missing-include.patch/cache-utils.h 1970-01-01 00:00:00 +0000
71@@ -1,41 +0,0 @@
72-#ifndef QEMU_CACHE_UTILS_H
73-#define QEMU_CACHE_UTILS_H
74-
75-#if defined(_ARCH_PPC)
76-struct qemu_cache_conf {
77- unsigned long dcache_bsize;
78- unsigned long icache_bsize;
79-};
80-
81-extern struct qemu_cache_conf qemu_cache_conf;
82-
83-void qemu_cache_utils_init(char **envp);
84-
85-/* mildly adjusted code from tcg-dyngen.c */
86-static inline void flush_icache_range(uintptr_t start, uintptr_t stop)
87-{
88- unsigned long p, start1, stop1;
89- unsigned long dsize = qemu_cache_conf.dcache_bsize;
90- unsigned long isize = qemu_cache_conf.icache_bsize;
91-
92- start1 = start & ~(dsize - 1);
93- stop1 = (stop + dsize - 1) & ~(dsize - 1);
94- for (p = start1; p < stop1; p += dsize) {
95- asm volatile ("dcbst 0,%0" : : "r"(p) : "memory");
96- }
97- asm volatile ("sync" : : : "memory");
98-
99- start &= start & ~(isize - 1);
100- stop1 = (stop + isize - 1) & ~(isize - 1);
101- for (p = start1; p < stop1; p += isize) {
102- asm volatile ("icbi 0,%0" : : "r"(p) : "memory");
103- }
104- asm volatile ("sync" : : : "memory");
105- asm volatile ("isync" : : : "memory");
106-}
107-
108-#else
109-#define qemu_cache_utils_init(envp) do { (void) (envp); } while (0)
110-#endif
111-
112-#endif /* QEMU_CACHE_UTILS_H */
113
114=== modified file 'CODING_STYLE'
115--- CODING_STYLE 2012-03-15 16:18:18 +0000
116+++ CODING_STYLE 2012-08-21 15:04:54 +0000
117@@ -1,4 +1,4 @@
118-Qemu Coding Style
119+QEMU Coding Style
120 =================
121
122 Please use the script checkpatch.pl in the scripts directory to check
123
124=== modified file 'Changelog'
125--- Changelog 2012-02-02 14:25:28 +0000
126+++ Changelog 2012-08-21 15:04:54 +0000
127@@ -447,7 +447,7 @@
128 - multi-target build
129 - fixed: no error code in hardware interrupts
130 - fixed: pop ss, mov ss, x and sti disable hardware irqs for the next insn
131- - correct single stepping thru string operations
132+ - correct single stepping through string operations
133 - preliminary SPARC target support (Thomas M. Ogrisegg)
134 - tun-fd option (Rusty Russell)
135 - automatic IDE geometry detection
136
137=== modified file 'Changelog.LINARO'
138--- Changelog.LINARO 2012-03-15 16:18:18 +0000
139+++ Changelog.LINARO 2012-08-21 15:04:54 +0000
140@@ -12,6 +12,37 @@
141 Bug numbers refer to Launchpad qemu-linaro bugs, eg:
142 https://bugs.launchpad.net/qemu-linaro/+bug/703094
143
144+version 2012.08:
145+ - Fixes #1004205: the -dtb option now accepts a filename
146+ with no directory as being in the current directory
147+ (in line with -kernel and -initrd).
148+
149+version 2012.07:
150+ - Fixes #1008338: QEMU built to use the 'Tiny Code
151+ Interpreter' rather than JITting to native code now
152+ works correctly (previously it would hang booting a
153+ Linux guest).
154+
155+version 2012.06:
156+ - No significant changes, rebased onto upstream v1.1.0.
157+
158+version 2012.05:
159+ - Fixes #978694: Beagle bootrom emulation now correctly handles
160+ FAT12/FAT16 images (thanks to Peter Chubb for the bug report
161+ and patch).
162+ - We now support running ARM BE8 userspace binaries (ie
163+ byte-invariant big-endian data and little-endian code).
164+
165+version 2012.04:
166+ - Fixes #928432: compiling spice support for i386 should
167+ no longer give compile warnings/errors.
168+ - Fixes #953544: 'SETEND' in Thumb mode should now UNDEF,
169+ in line with the behaviour for the ARM encoding.
170+ - Fixes #956799: add support for the ppoll syscall for
171+ ARM linux-user emulation.
172+ - Fixes #970252: add the OMAP36xx UART FIFO status registers
173+ (thanks to Jan Vesely for the bug report and patch).
174+
175 version 2012.03:
176 - Fixes #932856: the OMAP3 boot rom emulation now tries
177 sector 256 in raw mode as well as sector 0.
178
179=== modified file 'MAINTAINERS'
180--- MAINTAINERS 2012-03-15 16:18:18 +0000
181+++ MAINTAINERS 2012-08-21 15:04:54 +0000
182@@ -78,7 +78,7 @@
183
184 M68K
185 M: Paul Brook <paul@codesourcery.com>
186-S: Maintained
187+S: Odd Fixes
188 F: target-m68k/
189
190 MicroBlaze
191@@ -88,7 +88,7 @@
192
193 MIPS
194 M: Aurelien Jarno <aurelien@aurel32.net>
195-S: Maintained
196+S: Odd Fixes
197 F: target-mips/
198
199 PowerPC
200@@ -104,7 +104,7 @@
201
202 SH4
203 M: Aurelien Jarno <aurelien@aurel32.net>
204-S: Maintained
205+S: Odd Fixes
206 F: target-sh4/
207
208 SPARC
209@@ -112,6 +112,11 @@
210 S: Maintained
211 F: target-sparc/
212
213+UniCore32
214+M: Guan Xuetao <gxt@mprc.pku.edu.cn>
215+S: Maintained
216+F: target-unicore32/
217+
218 X86
219 M: qemu-devel@nongnu.org
220 S: Odd Fixes
221@@ -202,6 +207,12 @@
222 S: Orphan
223 F: hw/gumstix.c
224
225+i.MX31
226+M: Peter Chubb <peter.chubb@nicta.com.au>
227+S: Odd fixes
228+F: hw/imx*
229+F: hw/kzm.c
230+
231 Integrator CP
232 M: Paul Brook <paul@codesourcery.com>
233 M: Peter Maydell <peter.maydell@linaro.org>
234@@ -251,6 +262,13 @@
235 S: Maintained
236 F: hw/versatilepb.c
237
238+Xilinx Zynq
239+M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
240+S: Maintained
241+F: hw/xilinx_zynq.c
242+F: hw/zynq_slcr.c
243+F: hw/cadence_*
244+
245 CRIS Machines
246 -------------
247 Axis Dev88
248@@ -299,6 +317,11 @@
249 S: Maintained
250 F: hw/petalogix_s3adsp1800.c
251
252+petalogix_ml605
253+M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
254+S: Maintained
255+F: hw/petalogix_ml605_mmu.c
256+
257 MIPS Machines
258 -------------
259 Jazz
260@@ -387,7 +410,8 @@
261 PC
262 M: Anthony Liguori <aliguori@us.ibm.com>
263 S: Supported
264-F: hw/pc.[ch] hw/pc_piix.c
265+F: hw/pc.[ch]
266+F: hw/pc_piix.c
267
268 Xtensa Machines
269 ---------------
270@@ -424,7 +448,7 @@
271 S: Supported
272 F: hw/virtio-scsi.*
273 F: hw/scsi*
274-T: git://github.com/bonzini/qemu.git scsi-next
275+T: git git://github.com/bonzini/qemu.git scsi-next
276
277 LSI53C895A
278 M: Paul Brook <paul@codesourcery.com>
279@@ -449,9 +473,9 @@
280 virtio-9p
281 M: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
282 S: Supported
283-F: hw/9pfs/ fsdev/
284-T: https://github.com/kvaneesh/QEMU
285-
286+F: hw/9pfs/
287+F: fsdev/
288+T: git git://github.com/kvaneesh/QEMU.git
289
290 virtio-blk
291 M: Kevin Wolf <kwolf@redhat.com>
292@@ -464,6 +488,17 @@
293 F: hw/virtio-serial*
294 F: hw/virtio-console*
295
296+Xilinx EDK
297+M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
298+M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
299+S: Maintained
300+F: hw/xilinx_axi*
301+F: hw/xilinx_uartlite.c
302+F: hw/xilinx_intc.c
303+F: hw/xilinx_ethlite.c
304+F: hw/xilinx_timer.c
305+F: hw/xilinx.h
306+
307 Subsystems
308 ----------
309 Audio
310@@ -482,6 +517,12 @@
311 S: Maintained
312 F: qemu-char.c
313
314+Device Tree
315+M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
316+M: Alexander Graf <agraf@suse.de>
317+S: Maintained
318+F: device-tree.[ch]
319+
320 GDB stub
321 M: qemu-devel@nongnu.org
322 S: Odd Fixes
323@@ -519,9 +560,10 @@
324
325 Network device layer
326 M: Anthony Liguori <aliguori@us.ibm.com>
327-M: Mark McLoughlin <markmc@redhat.com>
328+M: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
329 S: Maintained
330 F: net/
331+T: git git://github.com/stefanha/qemu.git net
332
333 Network Block Device (NBD)
334 M: Paolo Bonzini <pbonzini@redhat.com>
335@@ -529,19 +571,22 @@
336 F: block/nbd.c
337 F: nbd.*
338 F: qemu-nbd.c
339-T: git://github.com/bonzini/qemu.git nbd-next
340+T: git git://github.com/bonzini/qemu.git nbd-next
341
342 SLIRP
343 M: Jan Kiszka <jan.kiszka@siemens.com>
344 S: Maintained
345 F: slirp/
346-T: git://git.kiszka.org/qemu.git queues/slirp
347+T: git git://git.kiszka.org/qemu.git queues/slirp
348
349 Tracing
350 M: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
351 S: Maintained
352 F: trace/
353-T: git://github.com/stefanha/qemu.git tracing
354+F: scripts/tracetool.py
355+F: scripts/tracetool/
356+F: docs/tracing.txt
357+T: git git://github.com/stefanha/qemu.git tracing
358
359 Checkpatch
360 M: Blue Swirl <blauwirbel@gmail.com>
361@@ -555,11 +600,6 @@
362 S: Maintained
363 F: bsd-user/
364
365-Darwin user
366-M: qemu-devel@nongnu.org
367-S: Orphan
368-F: darwin-user/
369-
370 Linux user
371 M: Riku Voipio <riku.voipio@iki.fi>
372 S: Maintained
373@@ -621,4 +661,26 @@
374 TCI target
375 M: Stefan Weil <sw@weilnetz.de>
376 S: Maintained
377-F: tcg/tci
378+F: tcg/tci/
379+
380+Stable branches
381+---------------
382+Stable 1.0
383+L: qemu-stable@nongnu.org
384+T: git git://git.qemu.org/qemu-stable-1.0.git
385+S: Orphan
386+
387+Stable 0.15
388+L: qemu-stable@nongnu.org
389+T: git git://git.qemu.org/qemu-stable-0.15.git
390+S: Orphan
391+
392+Stable 0.14
393+L: qemu-stable@nongnu.org
394+T: git git://git.qemu.org/qemu-stable-0.14.git
395+S: Orphan
396+
397+Stable 0.10
398+L: qemu-stable@nongnu.org
399+T: git git://git.qemu.org/qemu-stable-0.10.git
400+S: Orphan
401
402=== modified file 'Makefile'
403--- Makefile 2012-03-15 16:18:18 +0000
404+++ Makefile 2012-08-21 15:04:54 +0000
405@@ -3,16 +3,10 @@
406 # Always point to the root of the build tree (needs GNU make).
407 BUILD_DIR=$(CURDIR)
408
409-GENERATED_HEADERS = config-host.h trace.h qemu-options.def
410-ifeq ($(TRACE_BACKEND),dtrace)
411-GENERATED_HEADERS += trace-dtrace.h
412-endif
413-GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
414-GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
415-
416+# All following code might depend on configuration variables
417 ifneq ($(wildcard config-host.mak),)
418 # Put the all: rule here so that config-host.mak can contain dependencies.
419-all: build-all
420+all:
421 include config-host.mak
422 include $(SRC_PATH)/rules.mak
423 config-host.mak: $(SRC_PATH)/configure
424@@ -24,15 +18,22 @@
425 @exit 1
426 endif
427
428+GENERATED_HEADERS = config-host.h trace.h qemu-options.def
429+ifeq ($(TRACE_BACKEND),dtrace)
430+GENERATED_HEADERS += trace-dtrace.h
431+endif
432+GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
433+GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c trace.c
434+
435 # Don't try to regenerate Makefile or configure
436 # We don't generate any of them
437 Makefile: ;
438 configure: ;
439
440 .PHONY: all clean cscope distclean dvi html info install install-doc \
441- pdf recurse-all speed tar tarbin test build-all
442+ pdf recurse-all speed test dist
443
444-$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
445+$(call set-vpath, $(SRC_PATH))
446
447 LIBS+=-lz $(LIBS_TOOLS)
448
449@@ -81,7 +82,7 @@
450
451 -include config-all-devices.mak
452
453-build-all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
454+all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
455
456 config-host.h: config-host.h-timestamp
457 config-host.h-timestamp: config-host.mak
458@@ -90,19 +91,18 @@
459
460 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
461
462-subdir-%: $(GENERATED_HEADERS)
463+subdir-%:
464 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
465
466 ifneq ($(wildcard config-host.mak),)
467 include $(SRC_PATH)/Makefile.objs
468 endif
469
470-$(common-obj-y): $(GENERATED_HEADERS)
471 subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
472
473-$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
474+$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y) subdir-libdis
475
476-$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
477+$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser
478
479 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
480 romsubdir-%:
481@@ -120,7 +120,7 @@
482
483 ui/cocoa.o: ui/cocoa.m
484
485-ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
486+ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o hw/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
487
488 ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
489
490@@ -141,19 +141,23 @@
491 install-libcacard:
492 @echo "libtool is missing, please install and rerun configure"; exit 1
493 else
494-libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
495+libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
496 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
497
498 install-libcacard: libcacard.la
499 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
500 endif
501+
502+vscclient$(EXESUF): $(libcacard-y) $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o libcacard/vscclient.o
503+ $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
504+
505 ######################################################################
506
507 qemu-img.o: qemu-img-cmds.h
508-qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
509
510 tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
511- qemu-timer-common.o main-loop.o notify.o iohandler.o cutils.o async.o
512+ qemu-timer-common.o main-loop.o notify.o \
513+ iohandler.o cutils.o iov.o async.o
514 tools-obj-$(CONFIG_POSIX) += compatfd.o
515
516 qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y)
517@@ -161,7 +165,6 @@
518 qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
519
520 qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
521-qemu-bridge-helper.o: $(GENERATED_HEADERS)
522
523 fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
524 fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
525@@ -169,9 +172,8 @@
526 qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
527 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@")
528
529-$(qapi-obj-y): $(GENERATED_HEADERS)
530-qapi-dir := $(BUILD_DIR)/qapi-generated
531 qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
532+qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
533
534 gen-out-type = $(subst .,-,$(suffix $@))
535
536@@ -179,15 +181,15 @@
537 include $(SRC_PATH)/tests/Makefile
538 endif
539
540-$(qapi-dir)/qga-qapi-types.c $(qapi-dir)/qga-qapi-types.h :\
541+qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
542 $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
543- $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, " GEN $@")
544-$(qapi-dir)/qga-qapi-visit.c $(qapi-dir)/qga-qapi-visit.h :\
545+ $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@")
546+qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
547 $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
548- $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, " GEN $@")
549-$(qapi-dir)/qga-qmp-commands.h $(qapi-dir)/qga-qmp-marshal.c :\
550+ $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@")
551+qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
552 $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
553- $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, " GEN $@")
554+ $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@")
555
556 qapi-types.c qapi-types.h :\
557 $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
558@@ -199,12 +201,10 @@
559 $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
560 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, " GEN $@")
561
562-QGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
563-QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
564-$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
565-$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
566+QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
567+$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
568
569-qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(tools-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
570+qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(tools-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y)
571
572 QEMULIBS=libhw32 libhw64 libuser libdis libdis-user
573
574@@ -215,20 +215,30 @@
575 rm -f *.o *.d *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
576 rm -Rf .libs
577 rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d qapi/*.o qapi/*.d qga/*.o qga/*.d
578+ rm -f qom/*.o qom/*.d libuser/qom/*.o libuser/qom/*.d
579+ rm -f hw/usb/*.o hw/usb/*.d hw/*.o hw/*.d
580 rm -f qemu-img-cmds.h
581 rm -f trace/*.o trace/*.d
582- rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
583 rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
584+ @# May not be present in GENERATED_HEADERS
585 rm -f trace-dtrace.h trace-dtrace.h-timestamp
586- rm -f $(GENERATED_HEADERS)
587- rm -f $(GENERATED_SOURCES)
588- rm -rf $(qapi-dir)
589+ rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
590+ rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
591+ rm -rf qapi-generated
592+ rm -rf qga/qapi-generated
593 $(MAKE) -C tests/tcg clean
594 for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
595 if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
596 rm -f $$d/qemu-options.def; \
597 done
598
599+VERSION ?= $(shell cat VERSION)
600+
601+dist: qemu-$(VERSION).tar.bz2
602+
603+qemu-%.tar.bz2:
604+ $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
605+
606 distclean: clean
607 rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
608 rm -f config-all-devices.mak
609@@ -246,7 +256,8 @@
610
611 KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
612 ar de en-us fi fr-be hr it lv nl pl ru th \
613-common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
614+common de-ch es fo fr-ca hu ja mk nl-be pt sl tr \
615+bepo
616
617 ifdef INSTALL_BLOBS
618 BLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
619@@ -254,8 +265,8 @@
620 ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
621 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
622 pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
623+qemu-icon.bmp \
624 bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
625-mpc8544ds.dtb \
626 multiboot.bin linuxboot.bin kvmvapic.bin \
627 s390-zipl.rom \
628 spapr-rtas.bin slof.bin \
629@@ -265,8 +276,9 @@
630 endif
631
632 install-doc: $(DOCS)
633- $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
634- $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
635+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
636+ $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
637+ $(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
638 ifdef CONFIG_POSIX
639 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
640 $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
641@@ -277,11 +289,18 @@
642 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
643 $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
644 endif
645-install-sysconfig:
646- $(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
647- $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
648-
649-install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
650+
651+install-datadir:
652+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
653+
654+install-confdir:
655+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
656+
657+install-sysconfig: install-datadir install-confdir
658+ $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
659+ $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/cpus-x86_64.conf "$(DESTDIR)$(qemu_datadir)"
660+
661+install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir
662 $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
663 ifneq ($(TOOLS),)
664 $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
665@@ -291,15 +310,14 @@
666 $(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
667 endif
668 ifneq ($(BLOBS),)
669- $(INSTALL_DIR) "$(DESTDIR)$(datadir)"
670 set -e; for x in $(BLOBS); do \
671 [ -e "$(SRC_PATH)/pc-bios/$$x" ] || continue; \
672- $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
673+ $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
674 done
675 endif
676- $(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
677+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
678 set -e; for x in $(KEYMAPS); do \
679- $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
680+ $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
681 done
682 for d in $(TARGET_DIRS); do \
683 $(MAKE) -C $$d $@ || exit 1 ; \
684@@ -326,7 +344,7 @@
685 $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<," GEN $@")
686
687 %.html: %.texi
688- $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
689+ $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
690 " GEN $@")
691
692 %.info: %.texi
693@@ -350,25 +368,25 @@
694 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
695 $(call quiet-command, \
696 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
697- pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
698+ $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
699 " GEN $@")
700
701 qemu-img.1: qemu-img.texi qemu-img-cmds.texi
702 $(call quiet-command, \
703 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
704- pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
705+ $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
706 " GEN $@")
707
708 fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
709 $(call quiet-command, \
710 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
711- pod2man --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
712+ $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
713 " GEN $@")
714
715 qemu-nbd.8: qemu-nbd.texi
716 $(call quiet-command, \
717 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
718- pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
719+ $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
720 " GEN $@")
721
722 dvi: qemu-doc.dvi qemu-tech.dvi
723@@ -380,15 +398,10 @@
724 qemu-img.texi qemu-nbd.texi qemu-options.texi \
725 qemu-monitor.texi qemu-img-cmds.texi
726
727-VERSION ?= $(shell cat VERSION)
728-FILE = qemu-$(VERSION)
729-
730-# tar release (use 'make -k tar' on a checkouted tree)
731-tar:
732- rm -rf /tmp/$(FILE)
733- cp -r . /tmp/$(FILE)
734- cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
735- rm -rf /tmp/$(FILE)
736+# Add a dependency on the generated files, so that they are always
737+# rebuilt before other object files
738+Makefile: $(GENERATED_HEADERS)
739
740 # Include automatically generated dependency files
741--include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
742+# Dependencies in Makefile.objs files come from our recursive subdir rules
743+-include $(wildcard *.d tests/*.d)
744
745=== modified file 'Makefile.dis'
746--- Makefile.dis 2011-02-02 19:58:26 +0000
747+++ Makefile.dis 2012-08-21 15:04:54 +0000
748@@ -18,6 +18,3 @@
749
750 clean:
751 rm -f *.o *.d *.a *~
752-
753-# Include automatically generated dependency files
754--include $(wildcard *.d */*.d)
755
756=== modified file 'Makefile.hw'
757--- Makefile.hw 2012-03-15 16:18:18 +0000
758+++ Makefile.hw 2012-08-21 15:04:54 +0000
759@@ -7,7 +7,7 @@
760
761 .PHONY: all
762
763-$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
764+$(call set-vpath, $(SRC_PATH))
765
766 QEMU_CFLAGS+=-I..
767 QEMU_CFLAGS += -I$(SRC_PATH)/include
768@@ -19,7 +19,5 @@
769 @true
770
771 clean:
772- rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~
773-
774-# Include automatically generated dependency files
775--include $(wildcard *.d */*.d)
776+ rm -f $(addsuffix *.o, $(sort $(dir $(hw-obj-y))))
777+ rm -f $(addsuffix *.d, $(sort $(dir $(hw-obj-y))))
778
779=== modified file 'Makefile.objs'
780--- Makefile.objs 2012-03-15 16:18:18 +0000
781+++ Makefile.objs 2012-08-21 15:04:54 +0000
782@@ -1,9 +1,22 @@
783 #######################################################################
784+# Target-independent parts used in system and user emulation
785+universal-obj-y =
786+universal-obj-y += qemu-log.o
787+
788+#######################################################################
789 # QObject
790 qobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o
791 qobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o
792 qobject-obj-y += qerror.o error.o qemu-error.o
793
794+universal-obj-y += $(qobject-obj-y)
795+
796+#######################################################################
797+# QOM
798+qom-obj-y = qom/
799+
800+universal-obj-y += $(qom-obj-y)
801+
802 #######################################################################
803 # oslib-obj-y is code depending on the OS (win32 vs posix)
804 oslib-obj-y = osdep.o
805@@ -17,57 +30,29 @@
806 ifeq ($(CONFIG_UCONTEXT_COROUTINE),y)
807 coroutine-obj-$(CONFIG_POSIX) += coroutine-ucontext.o
808 else
809+ifeq ($(CONFIG_SIGALTSTACK_COROUTINE),y)
810+coroutine-obj-$(CONFIG_POSIX) += coroutine-sigaltstack.o
811+else
812 coroutine-obj-$(CONFIG_POSIX) += coroutine-gthread.o
813 endif
814+endif
815 coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o
816
817 #######################################################################
818 # block-obj-y is code used by both qemu system emulation and qemu-img
819
820-block-obj-y = cutils.o cache-utils.o qemu-option.o module.o async.o
821+block-obj-y = cutils.o iov.o cache-utils.o qemu-option.o module.o async.o
822 block-obj-y += nbd.o block.o aio.o aes.o qemu-config.o qemu-progress.o qemu-sockets.o
823 block-obj-y += $(coroutine-obj-y) $(qobject-obj-y) $(version-obj-y)
824 block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
825 block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
826-
827-block-nested-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
828-block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o
829-block-nested-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
830-block-nested-y += qed-check.o
831-block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o
832-block-nested-y += stream.o
833-block-nested-$(CONFIG_WIN32) += raw-win32.o
834-block-nested-$(CONFIG_POSIX) += raw-posix.o
835-block-nested-$(CONFIG_LIBISCSI) += iscsi.o
836-block-nested-$(CONFIG_CURL) += curl.o
837-block-nested-$(CONFIG_RBD) += rbd.o
838-
839-block-obj-y += $(addprefix block/, $(block-nested-y))
840-
841-net-obj-y = net.o
842-net-nested-y = queue.o checksum.o util.o
843-net-nested-y += socket.o
844-net-nested-y += dump.o
845-net-nested-$(CONFIG_POSIX) += tap.o
846-net-nested-$(CONFIG_LINUX) += tap-linux.o
847-net-nested-$(CONFIG_WIN32) += tap-win32.o
848-net-nested-$(CONFIG_BSD) += tap-bsd.o
849-net-nested-$(CONFIG_SOLARIS) += tap-solaris.o
850-net-nested-$(CONFIG_AIX) += tap-aix.o
851-net-nested-$(CONFIG_HAIKU) += tap-haiku.o
852-net-nested-$(CONFIG_SLIRP) += slirp.o
853-net-nested-$(CONFIG_VDE) += vde.o
854-net-obj-y += $(addprefix net/, $(net-nested-y))
855+block-obj-y += block/
856
857 ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
858 # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
859 # only pull in the actual virtio-9p device if we also enabled virtio.
860 CONFIG_REALLY_VIRTFS=y
861-fsdev-nested-y = qemu-fsdev.o virtio-9p-marshal.o
862-else
863-fsdev-nested-y = qemu-fsdev-dummy.o
864 endif
865-fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
866
867 ######################################################################
868 # Target independent part of system emulation. The long term path is to
869@@ -75,106 +60,40 @@
870 # single QEMU executable should support all CPUs and machines.
871
872 common-obj-y = $(block-obj-y) blockdev.o
873-common-obj-y += $(net-obj-y)
874-common-obj-y += $(qobject-obj-y)
875-common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX))
876+common-obj-y += net.o net/
877+common-obj-y += qom/
878 common-obj-y += readline.o console.o cursor.o
879 common-obj-y += $(oslib-obj-y)
880 common-obj-$(CONFIG_WIN32) += os-win32.o
881 common-obj-$(CONFIG_POSIX) += os-posix.o
882
883+common-obj-$(CONFIG_LINUX) += fsdev/
884+extra-obj-$(CONFIG_LINUX) += fsdev/
885+
886 common-obj-y += tcg-runtime.o host-utils.o main-loop.o
887-common-obj-y += irq.o input.o
888-common-obj-$(CONFIG_PTIMER) += ptimer.o
889-common-obj-$(CONFIG_MAX7310) += max7310.o
890-common-obj-$(CONFIG_WM8750) += wm8750.o
891-common-obj-$(CONFIG_TWL92230) += twl92230.o
892-common-obj-$(CONFIG_TSC2005) += tsc2005.o
893-common-obj-$(CONFIG_LM832X) += lm832x.o
894-common-obj-$(CONFIG_TMP105) += tmp105.o
895-common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
896-common-obj-$(CONFIG_SSD0303) += ssd0303.o
897-common-obj-$(CONFIG_SSD0323) += ssd0323.o
898-common-obj-$(CONFIG_ADS7846) += ads7846.o
899-common-obj-$(CONFIG_MAX111X) += max111x.o
900-common-obj-$(CONFIG_DS1338) += ds1338.o
901-common-obj-y += i2c.o spi.o smbus.o smbus_eeprom.o
902-common-obj-y += i2c-ddc.o
903-common-obj-y += eeprom93xx.o
904-common-obj-y += scsi-disk.o cdrom.o
905-common-obj-y += scsi-generic.o scsi-bus.o
906-common-obj-y += hid.o
907-common-obj-y += usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
908-common-obj-y += usb-serial.o usb-net.o usb-bus.o usb-desc.o usb-audio.o
909-common-obj-$(CONFIG_SSI) += ssi.o
910-common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
911-common-obj-$(CONFIG_SD) += sd.o
912-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
913-common-obj-y += bt-hci-csr.o
914+common-obj-y += input.o
915 common-obj-y += buffered_file.o migration.o migration-tcp.o
916 common-obj-y += qemu-char.o #aio.o
917-common-obj-y += msmouse.o ps2.o
918-common-obj-y += qdev.o qdev-properties.o qdev-monitor.o
919 common-obj-y += block-migration.o iohandler.o
920 common-obj-y += pflib.o
921 common-obj-y += bitmap.o bitops.o
922
923-common-obj-$(CONFIG_BRLAPI) += baum.o
924 common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
925 common-obj-$(CONFIG_WIN32) += version.o
926
927-common-obj-$(CONFIG_SPICE) += ui/spice-core.o ui/spice-input.o ui/spice-display.o spice-qemu-char.o
928-
929-include $(SRC_PATH)/qom/Makefile
930-common-obj-y += $(addprefix qom/, $(qom-y))
931-
932-audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
933-audio-obj-$(CONFIG_SDL) += sdlaudio.o
934-audio-obj-$(CONFIG_OSS) += ossaudio.o
935-audio-obj-$(CONFIG_SPICE) += spiceaudio.o
936-audio-obj-$(CONFIG_COREAUDIO) += coreaudio.o
937-audio-obj-$(CONFIG_ALSA) += alsaaudio.o
938-audio-obj-$(CONFIG_DSOUND) += dsoundaudio.o
939-audio-obj-$(CONFIG_FMOD) += fmodaudio.o
940-audio-obj-$(CONFIG_ESD) += esdaudio.o
941-audio-obj-$(CONFIG_PA) += paaudio.o
942-audio-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
943-audio-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
944-audio-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
945-audio-obj-y += wavcapture.o
946-common-obj-y += $(addprefix audio/, $(audio-obj-y))
947-
948-ui-obj-y += keymaps.o
949-ui-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
950-ui-obj-$(CONFIG_COCOA) += cocoa.o
951-ui-obj-$(CONFIG_CURSES) += curses.o
952-vnc-obj-y += vnc.o d3des.o
953-vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o
954-vnc-obj-y += vnc-enc-tight.o vnc-palette.o
955-vnc-obj-y += vnc-enc-zrle.o
956-vnc-obj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o
957-vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
958-ifdef CONFIG_VNC_THREAD
959-vnc-obj-y += vnc-jobs-async.o
960-else
961-vnc-obj-y += vnc-jobs-sync.o
962-endif
963-common-obj-y += $(addprefix ui/, $(ui-obj-y))
964-common-obj-$(CONFIG_VNC) += $(addprefix ui/, $(vnc-obj-y))
965+common-obj-$(CONFIG_SPICE) += spice-qemu-char.o
966+
967+common-obj-y += audio/
968+common-obj-y += hw/
969+common-obj-y += ui/
970+common-obj-y += bt-host.o bt-vhci.o
971
972 common-obj-y += iov.o acl.o
973 common-obj-$(CONFIG_POSIX) += compatfd.o
974 common-obj-y += notify.o event_notifier.o
975 common-obj-y += qemu-timer.o qemu-timer-common.o
976
977-slirp-obj-y = cksum.o if.o ip_icmp.o ip_input.o ip_output.o
978-slirp-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
979-slirp-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o arp_table.o
980-common-obj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y))
981-
982-# xen backend driver support
983-common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
984-common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
985+common-obj-$(CONFIG_SLIRP) += slirp/
986
987 ######################################################################
988 # libuser
989@@ -182,149 +101,16 @@
990 user-obj-y =
991 user-obj-y += envlist.o path.o
992 user-obj-y += tcg-runtime.o host-utils.o
993-user-obj-y += cutils.o cache-utils.o
994+user-obj-y += cutils.o iov.o cache-utils.o
995+user-obj-y += module.o
996+user-obj-y += qemu-user.o
997 user-obj-y += $(trace-obj-y)
998+user-obj-y += qom/
999
1000 ######################################################################
1001 # libhw
1002
1003-hw-obj-y =
1004-hw-obj-y += vl.o loader.o
1005-hw-obj-$(CONFIG_VIRTIO) += virtio-console.o
1006-hw-obj-y += usb-libhw.o
1007-hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
1008-hw-obj-y += fw_cfg.o
1009-hw-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
1010-hw-obj-$(CONFIG_PCI) += msix.o msi.o
1011-hw-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
1012-hw-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o
1013-hw-obj-y += watchdog.o
1014-hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
1015-hw-obj-$(CONFIG_ECC) += ecc.o
1016-hw-obj-$(CONFIG_NAND) += nand.o
1017-hw-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o
1018-hw-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o
1019-
1020-hw-obj-$(CONFIG_M48T59) += m48t59.o
1021-hw-obj-$(CONFIG_ESCC) += escc.o
1022-hw-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
1023-
1024-hw-obj-$(CONFIG_SERIAL) += serial.o
1025-hw-obj-$(CONFIG_PARALLEL) += parallel.o
1026-hw-obj-$(CONFIG_I8254) += i8254.o
1027-hw-obj-$(CONFIG_PCSPK) += pcspk.o
1028-hw-obj-$(CONFIG_PCKBD) += pckbd.o
1029-hw-obj-$(CONFIG_USB_UHCI) += usb-uhci.o
1030-hw-obj-$(CONFIG_USB_OHCI) += usb-ohci.o
1031-hw-obj-$(CONFIG_USB_EHCI) += usb-ehci.o
1032-hw-obj-$(CONFIG_USB_XHCI) += usb-xhci.o
1033-hw-obj-$(CONFIG_FDC) += fdc.o
1034-hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o
1035-hw-obj-$(CONFIG_APM) += pm_smbus.o apm.o
1036-hw-obj-$(CONFIG_DMA) += dma.o
1037-hw-obj-$(CONFIG_I82374) += i82374.o
1038-hw-obj-$(CONFIG_HPET) += hpet.o
1039-hw-obj-$(CONFIG_APPLESMC) += applesmc.o
1040-hw-obj-$(CONFIG_SMARTCARD) += usb-ccid.o ccid-card-passthru.o
1041-hw-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
1042-hw-obj-$(CONFIG_USB_REDIR) += usb-redir.o
1043-hw-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
1044-
1045-# PPC devices
1046-hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
1047-hw-obj-$(CONFIG_I82378) += i82378.o
1048-# Mac shared devices
1049-hw-obj-$(CONFIG_MACIO) += macio.o
1050-hw-obj-$(CONFIG_CUDA) += cuda.o
1051-hw-obj-$(CONFIG_ADB) += adb.o
1052-hw-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
1053-hw-obj-$(CONFIG_MAC_DBDMA) += mac_dbdma.o
1054-# OldWorld PowerMac
1055-hw-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o
1056-hw-obj-$(CONFIG_GRACKLE_PCI) += grackle_pci.o
1057-# NewWorld PowerMac
1058-hw-obj-$(CONFIG_UNIN_PCI) += unin_pci.o
1059-hw-obj-$(CONFIG_DEC_PCI) += dec_pci.o
1060-# PowerPC E500 boards
1061-hw-obj-$(CONFIG_PPCE500_PCI) += ppce500_pci.o
1062-
1063-# MIPS devices
1064-hw-obj-$(CONFIG_PIIX4) += piix4.o
1065-hw-obj-$(CONFIG_G364FB) += g364fb.o
1066-hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o
1067-
1068-# PCI watchdog devices
1069-hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o
1070-
1071-hw-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
1072-
1073-# PCI network cards
1074-hw-obj-$(CONFIG_NE2000_PCI) += ne2000.o
1075-hw-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o
1076-hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o
1077-hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o
1078-hw-obj-$(CONFIG_E1000_PCI) += e1000.o
1079-hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o
1080-
1081-hw-obj-$(CONFIG_SMC91C111) += smc91c111.o
1082-hw-obj-$(CONFIG_LAN9118) += lan9118.o
1083-hw-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o
1084-hw-obj-$(CONFIG_OPENCORES_ETH) += opencores_eth.o
1085-
1086-# IDE
1087-hw-obj-$(CONFIG_IDE_CORE) += ide/core.o ide/atapi.o
1088-hw-obj-$(CONFIG_IDE_QDEV) += ide/qdev.o
1089-hw-obj-$(CONFIG_IDE_PCI) += ide/pci.o
1090-hw-obj-$(CONFIG_IDE_ISA) += ide/isa.o
1091-hw-obj-$(CONFIG_IDE_PIIX) += ide/piix.o
1092-hw-obj-$(CONFIG_IDE_CMD646) += ide/cmd646.o
1093-hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o
1094-hw-obj-$(CONFIG_IDE_VIA) += ide/via.o
1095-hw-obj-$(CONFIG_AHCI) += ide/ahci.o
1096-hw-obj-$(CONFIG_AHCI) += ide/ich.o
1097-
1098-# SCSI layer
1099-hw-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o
1100-hw-obj-$(CONFIG_ESP) += esp.o
1101-
1102-hw-obj-y += dma-helpers.o sysbus.o isa-bus.o
1103-hw-obj-y += qdev-addr.o
1104-
1105-# VGA
1106-hw-obj-$(CONFIG_VGA_PCI) += vga-pci.o
1107-hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
1108-hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
1109-hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
1110-hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
1111-hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
1112-
1113-hw-obj-$(CONFIG_RC4030) += rc4030.o
1114-hw-obj-$(CONFIG_DP8393X) += dp8393x.o
1115-hw-obj-$(CONFIG_DS1225Y) += ds1225y.o
1116-hw-obj-$(CONFIG_MIPSNET) += mipsnet.o
1117-
1118-# Sound
1119-sound-obj-y =
1120-sound-obj-$(CONFIG_SB16) += sb16.o
1121-sound-obj-$(CONFIG_ES1370) += es1370.o
1122-sound-obj-$(CONFIG_AC97) += ac97.o
1123-sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
1124-sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
1125-sound-obj-$(CONFIG_CS4231A) += cs4231a.o
1126-sound-obj-$(CONFIG_HDA) += intel-hda.o hda-audio.o
1127-
1128-adlib.o fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
1129-hw-obj-$(CONFIG_SOUND) += $(sound-obj-y)
1130-
1131-9pfs-nested-$(CONFIG_VIRTFS) = virtio-9p.o
1132-9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-local.o virtio-9p-xattr.o
1133-9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-xattr-user.o virtio-9p-posix-acl.o
1134-9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-coth.o cofs.o codir.o cofile.o
1135-9pfs-nested-$(CONFIG_VIRTFS) += coxattr.o virtio-9p-synth.o
1136-9pfs-nested-$(CONFIG_OPEN_BY_HANDLE) += virtio-9p-handle.o
1137-9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-proxy.o
1138-
1139-hw-obj-$(CONFIG_REALLY_VIRTFS) += $(addprefix 9pfs/, $(9pfs-nested-y))
1140+hw-obj-y = vl.o dma-helpers.o qtest.o hw/
1141
1142 ######################################################################
1143 # libdis
1144@@ -344,22 +130,28 @@
1145 libdis-$(CONFIG_S390_DIS) += s390-dis.o
1146 libdis-$(CONFIG_SH4_DIS) += sh4-dis.o
1147 libdis-$(CONFIG_SPARC_DIS) += sparc-dis.o
1148+libdis-$(CONFIG_LM32_DIS) += lm32-dis.o
1149
1150 ######################################################################
1151 # trace
1152
1153 ifeq ($(TRACE_BACKEND),dtrace)
1154-trace.h: trace.h-timestamp trace-dtrace.h
1155-else
1156-trace.h: trace.h-timestamp
1157+TRACE_H_EXTRA_DEPS=trace-dtrace.h
1158 endif
1159+trace.h: trace.h-timestamp $(TRACE_H_EXTRA_DEPS)
1160 trace.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
1161- $(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -h < $< > $@," GEN trace.h")
1162+ $(call quiet-command,$(TRACETOOL) \
1163+ --format=h \
1164+ --backend=$(TRACE_BACKEND) \
1165+ < $< > $@," GEN trace.h")
1166 @cmp -s $@ trace.h || cp $@ trace.h
1167
1168 trace.c: trace.c-timestamp
1169 trace.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
1170- $(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -c < $< > $@," GEN trace.c")
1171+ $(call quiet-command,$(TRACETOOL) \
1172+ --format=c \
1173+ --backend=$(TRACE_BACKEND) \
1174+ < $< > $@," GEN trace.c")
1175 @cmp -s $@ trace.c || cp $@ trace.c
1176
1177 trace.o: trace.c $(GENERATED_HEADERS)
1178@@ -372,11 +164,14 @@
1179 # rule file. So we use '.dtrace' instead
1180 trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
1181 trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
1182- $(call quiet-command,sh $(SRC_PATH)/scripts/tracetool --$(TRACE_BACKEND) -d < $< > $@," GEN trace-dtrace.dtrace")
1183+ $(call quiet-command,$(TRACETOOL) \
1184+ --format=d \
1185+ --backend=$(TRACE_BACKEND) \
1186+ < $< > $@," GEN trace-dtrace.dtrace")
1187 @cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace
1188
1189 trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
1190- $(call quiet-command,dtrace -o $@ -G -s $<, " GEN trace-dtrace.o")
1191+ $(call quiet-command,dtrace -o $@ -G -s $<, " GEN trace-dtrace.o")
1192
1193 ifeq ($(LIBTOOL),)
1194 trace-dtrace.lo: trace-dtrace.dtrace
1195@@ -393,43 +188,39 @@
1196 trace-obj-y = trace.o
1197 endif
1198
1199-trace-nested-$(CONFIG_TRACE_DEFAULT) += default.o
1200-
1201-trace-nested-$(CONFIG_TRACE_SIMPLE) += simple.o
1202+trace-obj-$(CONFIG_TRACE_DEFAULT) += trace/default.o
1203+trace-obj-$(CONFIG_TRACE_SIMPLE) += trace/simple.o
1204 trace-obj-$(CONFIG_TRACE_SIMPLE) += qemu-timer-common.o
1205-
1206-trace-nested-$(CONFIG_TRACE_STDERR) += stderr.o
1207-
1208-trace-nested-y += control.o
1209-
1210-trace-obj-y += $(addprefix trace/, $(trace-nested-y))
1211+trace-obj-$(CONFIG_TRACE_STDERR) += trace/stderr.o
1212+trace-obj-y += trace/control.o
1213
1214 $(trace-obj-y): $(GENERATED_HEADERS)
1215
1216 ######################################################################
1217 # smartcard
1218
1219-libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o card_7816.o
1220+libcacard-y += libcacard/cac.o libcacard/event.o
1221+libcacard-y += libcacard/vcard.o libcacard/vreader.o
1222+libcacard-y += libcacard/vcard_emul_nss.o
1223+libcacard-y += libcacard/vcard_emul_type.o
1224+libcacard-y += libcacard/card_7816.o
1225+
1226+common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
1227
1228 ######################################################################
1229 # qapi
1230
1231-qapi-nested-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o
1232-qapi-nested-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o
1233-qapi-nested-y += string-input-visitor.o string-output-visitor.o
1234-qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y))
1235+qapi-obj-y = qapi/
1236
1237-common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o $(qapi-obj-y)
1238+common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o
1239 common-obj-y += qmp.o hmp.o
1240
1241+universal-obj-y += $(qapi-obj-y)
1242+
1243 ######################################################################
1244 # guest agent
1245
1246-qga-nested-y = commands.o guest-agent-command-state.o
1247-qga-nested-$(CONFIG_POSIX) += commands-posix.o channel-posix.o
1248-qga-nested-$(CONFIG_WIN32) += commands-win32.o channel-win32.o service-win32.o
1249-qga-obj-y = $(addprefix qga/, $(qga-nested-y))
1250-qga-obj-y += qemu-ga.o module.o
1251+qga-obj-y = qga/ qemu-ga.o module.o
1252 qga-obj-$(CONFIG_WIN32) += oslib-win32.o
1253 qga-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-sockets.o qemu-option.o
1254
1255@@ -439,3 +230,13 @@
1256
1257 QEMU_CFLAGS+=$(GLIB_CFLAGS)
1258
1259+nested-vars += \
1260+ hw-obj-y \
1261+ qga-obj-y \
1262+ block-obj-y \
1263+ qom-obj-y \
1264+ qapi-obj-y \
1265+ user-obj-y \
1266+ common-obj-y \
1267+ extra-obj-y
1268+dummy := $(call unnest-vars)
1269
1270=== modified file 'Makefile.target'
1271--- Makefile.target 2012-03-15 16:18:18 +0000
1272+++ Makefile.target 2012-08-21 15:04:54 +0000
1273@@ -1,10 +1,5 @@
1274 # -*- Mode: makefile -*-
1275
1276-GENERATED_HEADERS = config-target.h
1277-CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
1278-CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
1279-CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
1280-
1281 include ../config-host.mak
1282 include config-devices.mak
1283 include config-target.mak
1284@@ -13,14 +8,11 @@
1285 include $(HWDIR)/config.mak
1286 endif
1287
1288-TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
1289-$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw)
1290+$(call set-vpath, $(SRC_PATH))
1291 ifdef CONFIG_LINUX
1292 QEMU_CFLAGS += -I../linux-headers
1293 endif
1294-QEMU_CFLAGS += -I.. -I$(TARGET_PATH) -DNEED_CPU_H
1295-
1296-include $(SRC_PATH)/Makefile.objs
1297+QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
1298
1299 QEMU_CFLAGS+=-I$(SRC_PATH)/include
1300
1301@@ -58,13 +50,14 @@
1302 TARGET_TYPE=system
1303 endif
1304
1305-$(QEMU_PROG).stp:
1306- $(call quiet-command,sh $(SRC_PATH)/scripts/tracetool \
1307- --$(TRACE_BACKEND) \
1308- --binary $(bindir)/$(QEMU_PROG) \
1309- --target-arch $(TARGET_ARCH) \
1310- --target-type $(TARGET_TYPE) \
1311- --stap < $(SRC_PATH)/trace-events > $(QEMU_PROG).stp," GEN $(QEMU_PROG).stp")
1312+$(QEMU_PROG).stp: $(SRC_PATH)/trace-events
1313+ $(call quiet-command,$(TRACETOOL) \
1314+ --format=stap \
1315+ --backend=$(TRACE_BACKEND) \
1316+ --binary=$(bindir)/$(QEMU_PROG) \
1317+ --target-arch=$(TARGET_ARCH) \
1318+ --target-type=$(TARGET_TYPE) \
1319+ < $< > $@," GEN $(QEMU_PROG).stp")
1320 else
1321 stap:
1322 endif
1323@@ -76,359 +69,117 @@
1324
1325 #########################################################
1326 # cpu emulator library
1327-libobj-y = exec.o translate-all.o cpu-exec.o translate.o
1328-libobj-y += tcg/tcg.o tcg/optimize.o
1329-libobj-$(CONFIG_TCG_INTERPRETER) += tci.o
1330-libobj-y += fpu/softfloat.o
1331-libobj-y += op_helper.o helper.o
1332-ifeq ($(TARGET_BASE_ARCH), i386)
1333-libobj-y += cpuid.o
1334-endif
1335-libobj-$(TARGET_SPARC64) += vis_helper.o
1336-libobj-$(CONFIG_NEED_MMU) += mmu.o
1337-libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
1338-ifeq ($(TARGET_BASE_ARCH), sparc)
1339-libobj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
1340-libobj-y += cpu_init.o
1341-endif
1342-libobj-$(TARGET_SPARC) += int32_helper.o
1343-libobj-$(TARGET_SPARC64) += int64_helper.o
1344-
1345-libobj-y += disas.o
1346-libobj-$(CONFIG_TCI_DIS) += tci-dis.o
1347+obj-y = exec.o translate-all.o cpu-exec.o
1348+obj-y += tcg/tcg.o tcg/optimize.o
1349+obj-$(CONFIG_TCG_INTERPRETER) += tci.o
1350+obj-y += fpu/softfloat.o
1351+obj-y += disas.o
1352+obj-$(CONFIG_TCI_DIS) += tci-dis.o
1353+obj-y += target-$(TARGET_BASE_ARCH)/
1354+obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
1355
1356 tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
1357
1358-$(libobj-y): $(GENERATED_HEADERS)
1359-
1360-# HELPER_CFLAGS is used for all the code compiled with static register
1361+# HELPER_CFLAGS is used for all the legacy code compiled with static register
1362 # variables
1363-op_helper.o ldst_helper.o user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
1364+user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
1365
1366 # Note: this is a workaround. The real fix is to avoid compiling
1367 # cpu_signal_handler() in user-exec.c.
1368-signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
1369+%/signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
1370
1371 #########################################################
1372 # Linux user emulator target
1373
1374 ifdef CONFIG_LINUX_USER
1375
1376-$(call set-vpath, $(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR))
1377-
1378 QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
1379-obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \
1380- elfload.o linuxload.o uaccess.o gdbstub.o cpu-uname.o \
1381- user-exec.o $(oslib-obj-y)
1382-
1383-obj-$(TARGET_HAS_BFLT) += flatload.o
1384-
1385-obj-$(TARGET_I386) += vm86.o
1386-
1387-obj-i386-y += ioport-user.o
1388-
1389-nwfpe-obj-y = fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
1390-nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
1391-obj-arm-y += $(addprefix nwfpe/, $(nwfpe-obj-y))
1392-obj-arm-y += arm-semi.o
1393-
1394-obj-m68k-y += m68k-sim.o m68k-semi.o
1395-
1396-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
1397-
1398-obj-y += $(addprefix ../libuser/, $(user-obj-y))
1399-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
1400-obj-y += $(libobj-y)
1401+
1402+obj-y += linux-user/
1403+obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
1404
1405 endif #CONFIG_LINUX_USER
1406
1407 #########################################################
1408-# Darwin user emulator target
1409-
1410-ifdef CONFIG_DARWIN_USER
1411-
1412-$(call set-vpath, $(SRC_PATH)/darwin-user)
1413-
1414-QEMU_CFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
1415-
1416-# Leave some space for the regular program loading zone
1417-LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
1418-
1419-LIBS+=-lmx
1420-
1421-obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
1422- gdbstub.o user-exec.o
1423-
1424-obj-i386-y += ioport-user.o
1425-
1426-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
1427-
1428-obj-y += $(addprefix ../libuser/, $(user-obj-y))
1429-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
1430-obj-y += $(libobj-y)
1431-
1432-endif #CONFIG_DARWIN_USER
1433-
1434-#########################################################
1435 # BSD user emulator target
1436
1437 ifdef CONFIG_BSD_USER
1438
1439-$(call set-vpath, $(SRC_PATH)/bsd-user)
1440-
1441 QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
1442
1443-obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \
1444- gdbstub.o uaccess.o user-exec.o
1445-
1446-obj-i386-y += ioport-user.o
1447-
1448-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
1449-
1450-obj-y += $(addprefix ../libuser/, $(user-obj-y))
1451-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
1452-obj-y += $(libobj-y)
1453+obj-y += bsd-user/
1454+obj-y += gdbstub.o user-exec.o $(oslib-obj-y)
1455
1456 endif #CONFIG_BSD_USER
1457
1458 #########################################################
1459 # System emulator target
1460 ifdef CONFIG_SOFTMMU
1461+CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
1462+CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
1463+CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
1464+CONFIG_NO_GET_MEMORY_MAPPING = $(if $(subst n,,$(CONFIG_HAVE_GET_MEMORY_MAPPING)),n,y)
1465+CONFIG_NO_CORE_DUMP = $(if $(subst n,,$(CONFIG_HAVE_CORE_DUMP)),n,y)
1466
1467-obj-y = arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o ioport.o
1468-# virtio has to be here due to weird dependency between PCI and virtio-net.
1469-# need to fix this properly
1470-obj-$(CONFIG_NO_PCI) += pci-stub.o
1471-obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o
1472-obj-$(CONFIG_VIRTIO_SCSI) += virtio-scsi.o
1473-obj-y += vhost_net.o
1474-obj-$(CONFIG_VHOST_NET) += vhost.o
1475-obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
1476-obj-$(CONFIG_KVM) += kvm.o kvm-all.o
1477+obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o
1478+obj-y += hw/
1479+obj-$(CONFIG_KVM) += kvm-all.o
1480 obj-$(CONFIG_NO_KVM) += kvm-stub.o
1481-obj-$(CONFIG_VGA) += vga.o
1482-obj-y += memory.o savevm.o
1483+obj-y += memory.o savevm.o cputlb.o
1484+obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o
1485+obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o
1486+obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
1487+obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o
1488 LIBS+=-lz
1489
1490-obj-i386-$(CONFIG_KVM) += hyperv.o
1491-
1492 QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
1493 QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
1494 QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
1495 QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
1496
1497 # xen support
1498-obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o xen-mapcache.o
1499+obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
1500 obj-$(CONFIG_NO_XEN) += xen-stub.o
1501
1502-obj-i386-$(CONFIG_XEN) += xen_platform.o
1503-
1504-# Inter-VM PCI shared memory
1505-CONFIG_IVSHMEM =
1506-ifeq ($(CONFIG_KVM), y)
1507- ifeq ($(CONFIG_PCI), y)
1508- CONFIG_IVSHMEM = y
1509- endif
1510-endif
1511-obj-$(CONFIG_IVSHMEM) += ivshmem.o
1512-
1513-# Generic hotplugging
1514-obj-y += device-hotplug.o
1515-
1516 # Hardware support
1517-obj-i386-y += mc146818rtc.o pc.o
1518-obj-i386-y += apic_common.o apic.o kvmvapic.o
1519-obj-i386-y += sga.o ioapic_common.o ioapic.o piix_pci.o
1520-obj-i386-y += vmport.o
1521-obj-i386-y += pci-hotplug.o smbios.o wdt_ib700.o
1522-obj-i386-y += debugcon.o multiboot.o
1523-obj-i386-y += pc_piix.o
1524-obj-i386-y += pc_sysfw.o
1525-obj-i386-$(CONFIG_KVM) += kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o
1526-obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
1527-
1528-# shared objects
1529-obj-ppc-y = ppc.o ppc_booke.o
1530-# PREP target
1531-obj-ppc-y += mc146818rtc.o
1532-obj-ppc-y += ppc_prep.o
1533-# OldWorld PowerMac
1534-obj-ppc-y += ppc_oldworld.o
1535-# NewWorld PowerMac
1536-obj-ppc-y += ppc_newworld.o
1537-# IBM pSeries (sPAPR)
1538-obj-ppc-$(CONFIG_PSERIES) += spapr.o spapr_hcall.o spapr_rtas.o spapr_vio.o
1539-obj-ppc-$(CONFIG_PSERIES) += xics.o spapr_vty.o spapr_llan.o spapr_vscsi.o
1540-obj-ppc-$(CONFIG_PSERIES) += spapr_pci.o device-hotplug.o pci-hotplug.o
1541-# PowerPC 4xx boards
1542-obj-ppc-y += ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
1543-obj-ppc-y += ppc440_bamboo.o
1544-# PowerPC E500 boards
1545-obj-ppc-y += ppce500_mpc8544ds.o mpc8544_guts.o ppce500_spin.o
1546-# PowerPC 440 Xilinx ML507 reference board.
1547-obj-ppc-y += virtex_ml507.o
1548-obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
1549-obj-ppc-$(CONFIG_FDT) += device_tree.o
1550-# PowerPC OpenPIC
1551-obj-ppc-y += openpic.o
1552-
1553-# Xilinx PPC peripherals
1554-obj-ppc-y += xilinx_intc.o
1555-obj-ppc-y += xilinx_timer.o
1556-obj-ppc-y += xilinx_uartlite.o
1557-obj-ppc-y += xilinx_ethlite.o
1558-
1559-# LM32 boards
1560-obj-lm32-y += lm32_boards.o
1561-obj-lm32-y += milkymist.o
1562-
1563-# LM32 peripherals
1564-obj-lm32-y += lm32_pic.o
1565-obj-lm32-y += lm32_juart.o
1566-obj-lm32-y += lm32_timer.o
1567-obj-lm32-y += lm32_uart.o
1568-obj-lm32-y += lm32_sys.o
1569-obj-lm32-y += milkymist-ac97.o
1570-obj-lm32-y += milkymist-hpdmc.o
1571-obj-lm32-y += milkymist-memcard.o
1572-obj-lm32-y += milkymist-minimac2.o
1573-obj-lm32-y += milkymist-pfpu.o
1574-obj-lm32-y += milkymist-softusb.o
1575-obj-lm32-y += milkymist-sysctl.o
1576-obj-lm32-$(CONFIG_OPENGL) += milkymist-tmu2.o
1577-obj-lm32-y += milkymist-uart.o
1578-obj-lm32-y += milkymist-vgafb.o
1579-obj-lm32-y += framebuffer.o
1580-
1581-obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
1582-obj-mips-y += mips_addr.o mips_timer.o mips_int.o
1583-obj-mips-y += gt64xxx.o mc146818rtc.o
1584-obj-mips-$(CONFIG_FULONG) += bonito.o vt82c686.o mips_fulong2e.o
1585-
1586-obj-microblaze-y = petalogix_s3adsp1800_mmu.o
1587-obj-microblaze-y += petalogix_ml605_mmu.o
1588-
1589-obj-microblaze-y += microblaze_pic_cpu.o
1590-obj-microblaze-y += xilinx_intc.o
1591-obj-microblaze-y += xilinx_timer.o
1592-obj-microblaze-y += xilinx_uartlite.o
1593-obj-microblaze-y += xilinx_ethlite.o
1594-obj-microblaze-y += xilinx_axidma.o
1595-obj-microblaze-y += xilinx_axienet.o
1596-
1597-obj-microblaze-$(CONFIG_FDT) += device_tree.o
1598-
1599-# Boards
1600-obj-cris-y = cris_pic_cpu.o
1601-obj-cris-y += cris-boot.o
1602-obj-cris-y += axis_dev88.o
1603-
1604-# IO blocks
1605-obj-cris-y += etraxfs_dma.o
1606-obj-cris-y += etraxfs_pic.o
1607-obj-cris-y += etraxfs_eth.o
1608-obj-cris-y += etraxfs_timer.o
1609-obj-cris-y += etraxfs_ser.o
1610-
1611 ifeq ($(TARGET_ARCH), sparc64)
1612-obj-sparc-y = sun4u.o apb_pci.o
1613-obj-sparc-y += mc146818rtc.o
1614+obj-y += hw/sparc64/
1615 else
1616-obj-sparc-y = sun4m.o lance.o tcx.o sun4m_iommu.o slavio_intctl.o
1617-obj-sparc-y += slavio_timer.o slavio_misc.o sparc32_dma.o
1618-obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o leon3.o
1619-
1620-# GRLIB
1621-obj-sparc-y += grlib_gptimer.o grlib_irqmp.o grlib_apbuart.o
1622+obj-y += hw/$(TARGET_BASE_ARCH)/
1623 endif
1624
1625-obj-arm-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o
1626-obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
1627-obj-arm-y += versatile_pci.o
1628-obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
1629-obj-arm-y += exynos4210_gic.o exynos4210_combiner.o exynos4210.o
1630-obj-arm-y += exynos4_boards.o exynos4210_uart.o exynos4210_pwm.o
1631-obj-arm-y += exynos4210_pmu.o exynos4210_mct.o exynos4210_fimd.o
1632-obj-arm-y += arm_l2x0.o
1633-obj-arm-y += arm_mptimer.o a15mpcore.o
1634-obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
1635-obj-arm-y += highbank.o
1636-obj-arm-y += pl061.o
1637-obj-arm-y += xgmac.o
1638-obj-arm-y += arm-semi.o
1639-obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
1640-obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
1641-obj-arm-y += gumstix.o
1642-obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
1643-obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \
1644- omap_gpio.o omap_intc.o omap_uart.o
1645-obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
1646- omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
1647-obj-arm-y += omap3.o omap_usb.o omap3_boot.o omap3_mmc.o dsi.o
1648-obj-arm-y += twl4030.o beagle.o overo.o
1649-obj-arm-y += omap_sx1.o palm.o tsc210x.o
1650-obj-arm-y += nseries.o blizzard.o onenand.o cbus.o tusb6010.o usb-musb.o
1651-obj-arm-y += mst_fpga.o mainstone.o
1652-obj-arm-y += z2.o
1653-obj-arm-y += musicpal.o bitbang_i2c.o marvell_88w8618_audio.o
1654-obj-arm-y += framebuffer.o
1655-obj-arm-y += vexpress.o
1656-obj-arm-y += strongarm.o
1657-obj-arm-y += collie.o
1658-obj-arm-y += pl041.o lm4549.o
1659-obj-arm-$(CONFIG_FDT) += device_tree.o
1660-
1661-obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
1662-obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o
1663-obj-sh4-y += ide/mmio.o
1664-
1665-obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
1666-obj-m68k-y += m68k-semi.o dummy_m68k.o
1667-
1668-obj-s390x-y = s390-virtio-bus.o s390-virtio.o
1669-
1670-obj-alpha-y = mc146818rtc.o
1671-obj-alpha-y += alpha_pci.o alpha_dp264.o alpha_typhoon.o
1672-
1673-obj-xtensa-y += xtensa_pic.o
1674-obj-xtensa-y += xtensa_sim.o
1675-obj-xtensa-y += xtensa_lx60.o
1676-obj-xtensa-y += xtensa-semi.o
1677-obj-xtensa-y += core-dc232b.o
1678-obj-xtensa-y += core-fsf.o
1679-
1680 main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
1681
1682-monitor.o: hmp-commands.h qmp-commands-old.h
1683-
1684-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
1685-
1686-obj-y += $(addprefix ../, $(common-obj-y))
1687-obj-y += $(addprefix ../libdis/, $(libdis-y))
1688-obj-y += $(libobj-y)
1689-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
1690-obj-y += $(addprefix ../, $(trace-obj-y))
1691+GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
1692
1693 endif # CONFIG_SOFTMMU
1694
1695-ifndef CONFIG_LINUX_USER
1696-ifndef CONFIG_BSD_USER
1697-# libcacard needs qemu-thread support, and besides is only needed by devices
1698-# so not requires with linux-user / bsd-user targets
1699-obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
1700-endif # CONFIG_BSD_USER
1701-endif # CONFIG_LINUX_USER
1702-
1703-obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
1704+nested-vars += obj-y
1705+
1706+# This resolves all nested paths, so it must come last
1707+include $(SRC_PATH)/Makefile.objs
1708+
1709+all-obj-y = $(obj-y)
1710+all-obj-y += $(addprefix ../, $(universal-obj-y))
1711+
1712+ifdef CONFIG_SOFTMMU
1713+all-obj-y += $(addprefix ../, $(common-obj-y))
1714+all-obj-y += $(addprefix ../libdis/, $(libdis-y))
1715+all-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
1716+all-obj-y += $(addprefix ../, $(trace-obj-y))
1717+else
1718+all-obj-y += $(addprefix ../libuser/, $(user-obj-y))
1719+all-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
1720+endif #CONFIG_LINUX_USER
1721
1722 ifdef QEMU_PROGW
1723 # The linker builds a windows executable. Make also a console executable.
1724-$(QEMU_PROGW): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
1725+$(QEMU_PROGW): $(all-obj-y)
1726 $(call LINK,$^)
1727 $(QEMU_PROG): $(QEMU_PROGW)
1728 $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
1729 else
1730-$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
1731+$(QEMU_PROG): $(all-obj-y)
1732 $(call LINK,$^)
1733 endif
1734
1735@@ -442,8 +193,8 @@
1736 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
1737
1738 clean:
1739- rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
1740- rm -f *.d */*.d tcg/*.o ide/*.o 9pfs/*.o kvm/*.o
1741+ rm -f *.a *~ $(PROGS)
1742+ rm -f $(shell find . -name '*.[od]')
1743 rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
1744 ifdef CONFIG_TRACE_SYSTEMTAP
1745 rm -f *.stp
1746@@ -457,9 +208,9 @@
1747 endif
1748 endif
1749 ifdef CONFIG_TRACE_SYSTEMTAP
1750- $(INSTALL_DIR) "$(DESTDIR)$(datadir)/../systemtap/tapset"
1751- $(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(datadir)/../systemtap/tapset"
1752+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
1753+ $(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
1754 endif
1755
1756-# Include automatically generated dependency files
1757--include $(wildcard *.d */*.d)
1758+GENERATED_HEADERS += config-target.h
1759+Makefile: $(GENERATED_HEADERS)
1760
1761=== modified file 'Makefile.user'
1762--- Makefile.user 2011-12-06 09:35:22 +0000
1763+++ Makefile.user 2012-08-21 15:04:54 +0000
1764@@ -9,6 +9,8 @@
1765 $(call set-vpath, $(SRC_PATH))
1766
1767 QEMU_CFLAGS+=-I..
1768+QEMU_CFLAGS += -I$(SRC_PATH)/include
1769+QEMU_CFLAGS += -DCONFIG_USER_ONLY
1770
1771 include $(SRC_PATH)/Makefile.objs
1772
1773@@ -20,6 +22,3 @@
1774 for d in . trace; do \
1775 rm -f $$d/*.o $$d/*.d $$d/*.a $$d/*~; \
1776 done
1777-
1778-# Include automatically generated dependency files
1779--include $(wildcard *.d */*.d)
1780
1781=== modified file 'QMP/qmp-events.txt'
1782--- QMP/qmp-events.txt 2012-03-15 16:18:18 +0000
1783+++ QMP/qmp-events.txt 2012-08-21 15:04:54 +0000
1784@@ -335,3 +335,21 @@
1785 "len": 10737418240, "offset": 134217728,
1786 "speed": 0 },
1787 "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
1788+
1789+
1790+BALLOON_CHANGE
1791+----------
1792+
1793+Emitted when the guest changes the actual BALLOON level. This
1794+value is equivalent to the 'actual' field return by the
1795+'query-balloon' command
1796+
1797+Data:
1798+
1799+- "actual": actual level of the guest memory balloon in bytes (json-number)
1800+
1801+Example:
1802+
1803+{ "event": "BALLOON_CHANGE",
1804+ "data": { "actual": 944766976 },
1805+ "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1806
1807=== modified file 'QMP/qmp-spec.txt'
1808--- QMP/qmp-spec.txt 2011-02-02 19:58:26 +0000
1809+++ QMP/qmp-spec.txt 2012-08-21 15:04:54 +0000
1810@@ -209,13 +209,27 @@
1811 capabilities array (section '2.2 Server Greeting'). Thus, Clients can check
1812 that array and enable the capabilities they support.
1813
1814-Additionally, Clients must not assume any particular:
1815-
1816-- Size of json-objects or length of json-arrays
1817+The QMP Server performs a type check on the arguments to a command. It
1818+generates an error if a value does not have the expected type for its
1819+key, or if it does not understand a key that the Client included. The
1820+strictness of the Server catches wrong assumptions of Clients about
1821+the Server's schema. Clients can assume that, when such validation
1822+errors occur, they will be reported before the command generated any
1823+side effect.
1824+
1825+However, Clients must not assume any particular:
1826+
1827+- Length of json-arrays
1828+- Size of json-objects; in particular, future versions of QEMU may add
1829+ new keys and Clients should be able to ignore them.
1830 - Order of json-object members or json-array elements
1831 - Amount of errors generated by a command, that is, new errors can be added
1832 to any existing command in newer versions of the Server
1833
1834+Of course, the Server does guarantee to send valid JSON. But apart from
1835+this, a Client should be "conservative in what they send, and liberal in
1836+what they accept".
1837+
1838 6. Downstream extension of QMP
1839 ------------------------------
1840
1841
1842=== added file 'QMP/qom-fuse'
1843--- QMP/qom-fuse 1970-01-01 00:00:00 +0000
1844+++ QMP/qom-fuse 2012-08-21 15:04:54 +0000
1845@@ -0,0 +1,138 @@
1846+#!/usr/bin/python
1847+##
1848+# QEMU Object Model test tools
1849+#
1850+# Copyright IBM, Corp. 2012
1851+#
1852+# Authors:
1853+# Anthony Liguori <aliguori@us.ibm.com>
1854+#
1855+# This work is licensed under the terms of the GNU GPL, version 2 or later. See
1856+# the COPYING file in the top-level directory.
1857+##
1858+
1859+import fuse, stat
1860+from fuse import Fuse
1861+import os, posix
1862+from errno import *
1863+from qmp import QEMUMonitorProtocol
1864+
1865+fuse.fuse_python_api = (0, 2)
1866+
1867+class QOMFS(Fuse):
1868+ def __init__(self, qmp, *args, **kwds):
1869+ Fuse.__init__(self, *args, **kwds)
1870+ self.qmp = qmp
1871+ self.qmp.connect()
1872+ self.ino_map = {}
1873+ self.ino_count = 1
1874+
1875+ def get_ino(self, path):
1876+ if self.ino_map.has_key(path):
1877+ return self.ino_map[path]
1878+ self.ino_map[path] = self.ino_count
1879+ self.ino_count += 1
1880+ return self.ino_map[path]
1881+
1882+ def is_object(self, path):
1883+ try:
1884+ items = self.qmp.command('qom-list', path=path)
1885+ return True
1886+ except:
1887+ return False
1888+
1889+ def is_property(self, path):
1890+ try:
1891+ path, prop = path.rsplit('/', 1)
1892+ for item in self.qmp.command('qom-list', path=path):
1893+ if item['name'] == prop:
1894+ return True
1895+ return False
1896+ except:
1897+ return False
1898+
1899+ def is_link(self, path):
1900+ try:
1901+ path, prop = path.rsplit('/', 1)
1902+ for item in self.qmp.command('qom-list', path=path):
1903+ if item['name'] == prop:
1904+ if item['type'].startswith('link<'):
1905+ return True
1906+ return False
1907+ return False
1908+ except:
1909+ return False
1910+
1911+ def read(self, path, length, offset):
1912+ if not self.is_property(path):
1913+ return -ENOENT
1914+
1915+ path, prop = path.rsplit('/', 1)
1916+ try:
1917+ data = str(self.qmp.command('qom-get', path=path, property=prop))
1918+ data += '\n' # make values shell friendly
1919+ except:
1920+ return -EPERM
1921+
1922+ if offset > len(data):
1923+ return ''
1924+
1925+ return str(data[offset:][:length])
1926+
1927+ def readlink(self, path):
1928+ if not self.is_link(path):
1929+ return False
1930+ path, prop = path.rsplit('/', 1)
1931+ prefix = '/'.join(['..'] * (len(path.split('/')) - 1))
1932+ return prefix + str(self.qmp.command('qom-get', path=path,
1933+ property=prop))
1934+
1935+ def getattr(self, path):
1936+ if self.is_link(path):
1937+ value = posix.stat_result((0755 | stat.S_IFLNK,
1938+ self.get_ino(path),
1939+ 0,
1940+ 2,
1941+ 1000,
1942+ 1000,
1943+ 4096,
1944+ 0,
1945+ 0,
1946+ 0))
1947+ elif self.is_object(path):
1948+ value = posix.stat_result((0755 | stat.S_IFDIR,
1949+ self.get_ino(path),
1950+ 0,
1951+ 2,
1952+ 1000,
1953+ 1000,
1954+ 4096,
1955+ 0,
1956+ 0,
1957+ 0))
1958+ elif self.is_property(path):
1959+ value = posix.stat_result((0644 | stat.S_IFREG,
1960+ self.get_ino(path),
1961+ 0,
1962+ 1,
1963+ 1000,
1964+ 1000,
1965+ 4096,
1966+ 0,
1967+ 0,
1968+ 0))
1969+ else:
1970+ value = -ENOENT
1971+ return value
1972+
1973+ def readdir(self, path, offset):
1974+ yield fuse.Direntry('.')
1975+ yield fuse.Direntry('..')
1976+ for item in self.qmp.command('qom-list', path=path):
1977+ yield fuse.Direntry(str(item['name']))
1978+
1979+if __name__ == '__main__':
1980+ import sys, os
1981+
1982+ fs = QOMFS(QEMUMonitorProtocol(os.environ['QMP_SOCKET']))
1983+ fs.main(sys.argv)
1984
1985=== modified file 'VERSION'
1986--- VERSION 2012-02-02 14:25:28 +0000
1987+++ VERSION 2012-08-21 15:04:54 +0000
1988@@ -1,1 +1,1 @@
1989-1.0.50
1990+1.1.50
1991
1992=== modified file 'VERSION.LINARO'
1993--- VERSION.LINARO 2012-03-15 16:18:18 +0000
1994+++ VERSION.LINARO 2012-08-21 15:04:54 +0000
1995@@ -1,1 +1,1 @@
1996-qemu-linaro 2012.03
1997+qemu-linaro 2012.08
1998
1999=== modified file 'aio.c'
2000--- aio.c 2012-02-20 17:32:06 +0000
2001+++ aio.c 2012-08-21 15:04:54 +0000
2002@@ -35,7 +35,6 @@
2003 IOHandler *io_read;
2004 IOHandler *io_write;
2005 AioFlushHandler *io_flush;
2006- AioProcessQueue *io_process_queue;
2007 int deleted;
2008 void *opaque;
2009 QLIST_ENTRY(AioHandler) node;
2010@@ -58,7 +57,6 @@
2011 IOHandler *io_read,
2012 IOHandler *io_write,
2013 AioFlushHandler *io_flush,
2014- AioProcessQueue *io_process_queue,
2015 void *opaque)
2016 {
2017 AioHandler *node;
2018@@ -91,7 +89,6 @@
2019 node->io_read = io_read;
2020 node->io_write = io_write;
2021 node->io_flush = io_flush;
2022- node->io_process_queue = io_process_queue;
2023 node->opaque = opaque;
2024 }
2025
2026@@ -102,131 +99,96 @@
2027
2028 void qemu_aio_flush(void)
2029 {
2030- AioHandler *node;
2031- int ret;
2032-
2033- do {
2034- ret = 0;
2035-
2036- /*
2037- * If there are pending emulated aio start them now so flush
2038- * will be able to return 1.
2039- */
2040- qemu_aio_wait();
2041-
2042- QLIST_FOREACH(node, &aio_handlers, node) {
2043- if (node->io_flush) {
2044- ret |= node->io_flush(node->opaque);
2045- }
2046- }
2047- } while (qemu_bh_poll() || ret > 0);
2048-}
2049-
2050-int qemu_aio_process_queue(void)
2051-{
2052- AioHandler *node;
2053- int ret = 0;
2054-
2055- walking_handlers = 1;
2056-
2057- QLIST_FOREACH(node, &aio_handlers, node) {
2058- if (node->io_process_queue) {
2059- if (node->io_process_queue(node->opaque)) {
2060- ret = 1;
2061- }
2062- }
2063- }
2064-
2065- walking_handlers = 0;
2066-
2067- return ret;
2068-}
2069-
2070-void qemu_aio_wait(void)
2071-{
2072- int ret;
2073-
2074- if (qemu_bh_poll())
2075- return;
2076+ while (qemu_aio_wait());
2077+}
2078+
2079+bool qemu_aio_wait(void)
2080+{
2081+ AioHandler *node;
2082+ fd_set rdfds, wrfds;
2083+ int max_fd = -1;
2084+ int ret;
2085+ bool busy;
2086
2087 /*
2088 * If there are callbacks left that have been queued, we need to call then.
2089- * Return afterwards to avoid waiting needlessly in select().
2090+ * Do not call select in this case, because it is possible that the caller
2091+ * does not need a complete flush (as is the case for qemu_aio_wait loops).
2092 */
2093- if (qemu_aio_process_queue())
2094- return;
2095-
2096- do {
2097- AioHandler *node;
2098- fd_set rdfds, wrfds;
2099- int max_fd = -1;
2100-
2101+ if (qemu_bh_poll()) {
2102+ return true;
2103+ }
2104+
2105+ walking_handlers = 1;
2106+
2107+ FD_ZERO(&rdfds);
2108+ FD_ZERO(&wrfds);
2109+
2110+ /* fill fd sets */
2111+ busy = false;
2112+ QLIST_FOREACH(node, &aio_handlers, node) {
2113+ /* If there aren't pending AIO operations, don't invoke callbacks.
2114+ * Otherwise, if there are no AIO requests, qemu_aio_wait() would
2115+ * wait indefinitely.
2116+ */
2117+ if (node->io_flush) {
2118+ if (node->io_flush(node->opaque) == 0) {
2119+ continue;
2120+ }
2121+ busy = true;
2122+ }
2123+ if (!node->deleted && node->io_read) {
2124+ FD_SET(node->fd, &rdfds);
2125+ max_fd = MAX(max_fd, node->fd + 1);
2126+ }
2127+ if (!node->deleted && node->io_write) {
2128+ FD_SET(node->fd, &wrfds);
2129+ max_fd = MAX(max_fd, node->fd + 1);
2130+ }
2131+ }
2132+
2133+ walking_handlers = 0;
2134+
2135+ /* No AIO operations? Get us out of here */
2136+ if (!busy) {
2137+ return false;
2138+ }
2139+
2140+ /* wait until next event */
2141+ ret = select(max_fd, &rdfds, &wrfds, NULL, NULL);
2142+
2143+ /* if we have any readable fds, dispatch event */
2144+ if (ret > 0) {
2145 walking_handlers = 1;
2146
2147- FD_ZERO(&rdfds);
2148- FD_ZERO(&wrfds);
2149-
2150- /* fill fd sets */
2151- QLIST_FOREACH(node, &aio_handlers, node) {
2152- /* If there aren't pending AIO operations, don't invoke callbacks.
2153- * Otherwise, if there are no AIO requests, qemu_aio_wait() would
2154- * wait indefinitely.
2155- */
2156- if (node->io_flush && node->io_flush(node->opaque) == 0)
2157- continue;
2158-
2159- if (!node->deleted && node->io_read) {
2160- FD_SET(node->fd, &rdfds);
2161- max_fd = MAX(max_fd, node->fd + 1);
2162- }
2163- if (!node->deleted && node->io_write) {
2164- FD_SET(node->fd, &wrfds);
2165- max_fd = MAX(max_fd, node->fd + 1);
2166+ /* we have to walk very carefully in case
2167+ * qemu_aio_set_fd_handler is called while we're walking */
2168+ node = QLIST_FIRST(&aio_handlers);
2169+ while (node) {
2170+ AioHandler *tmp;
2171+
2172+ if (!node->deleted &&
2173+ FD_ISSET(node->fd, &rdfds) &&
2174+ node->io_read) {
2175+ node->io_read(node->opaque);
2176+ }
2177+ if (!node->deleted &&
2178+ FD_ISSET(node->fd, &wrfds) &&
2179+ node->io_write) {
2180+ node->io_write(node->opaque);
2181+ }
2182+
2183+ tmp = node;
2184+ node = QLIST_NEXT(node, node);
2185+
2186+ if (tmp->deleted) {
2187+ QLIST_REMOVE(tmp, node);
2188+ g_free(tmp);
2189 }
2190 }
2191
2192 walking_handlers = 0;
2193-
2194- /* No AIO operations? Get us out of here */
2195- if (max_fd == -1)
2196- break;
2197-
2198- /* wait until next event */
2199- ret = select(max_fd, &rdfds, &wrfds, NULL, NULL);
2200- if (ret == -1 && errno == EINTR)
2201- continue;
2202-
2203- /* if we have any readable fds, dispatch event */
2204- if (ret > 0) {
2205- walking_handlers = 1;
2206-
2207- /* we have to walk very carefully in case
2208- * qemu_aio_set_fd_handler is called while we're walking */
2209- node = QLIST_FIRST(&aio_handlers);
2210- while (node) {
2211- AioHandler *tmp;
2212-
2213- if (!node->deleted &&
2214- FD_ISSET(node->fd, &rdfds) &&
2215- node->io_read) {
2216- node->io_read(node->opaque);
2217- }
2218- if (!node->deleted &&
2219- FD_ISSET(node->fd, &wrfds) &&
2220- node->io_write) {
2221- node->io_write(node->opaque);
2222- }
2223-
2224- tmp = node;
2225- node = QLIST_NEXT(node, node);
2226-
2227- if (tmp->deleted) {
2228- QLIST_REMOVE(tmp, node);
2229- g_free(tmp);
2230- }
2231- }
2232-
2233- walking_handlers = 0;
2234- }
2235- } while (ret == 0);
2236+ }
2237+
2238+ return true;
2239 }
2240
2241=== modified file 'arch_init.c'
2242--- arch_init.c 2012-03-15 16:18:18 +0000
2243+++ arch_init.c 2012-08-21 15:04:54 +0000
2244@@ -44,6 +44,14 @@
2245 #include "exec-memory.h"
2246 #include "hw/pcspk.h"
2247
2248+#ifdef DEBUG_ARCH_INIT
2249+#define DPRINTF(fmt, ...) \
2250+ do { fprintf(stdout, "arch_init: " fmt, ## __VA_ARGS__); } while (0)
2251+#else
2252+#define DPRINTF(fmt, ...) \
2253+ do { } while (0)
2254+#endif
2255+
2256 #ifdef TARGET_SPARC
2257 int graphic_width = 1024;
2258 int graphic_height = 768;
2259@@ -54,7 +62,6 @@
2260 int graphic_depth = 15;
2261 #endif
2262
2263-const char arch_config_name[] = CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf";
2264
2265 #if defined(TARGET_ALPHA)
2266 #define QEMU_ARCH QEMU_ARCH_ALPHA
2267@@ -72,6 +79,8 @@
2268 #define QEMU_ARCH QEMU_ARCH_MICROBLAZE
2269 #elif defined(TARGET_MIPS)
2270 #define QEMU_ARCH QEMU_ARCH_MIPS
2271+#elif defined(TARGET_OPENRISC)
2272+#define QEMU_ARCH QEMU_ARCH_OPENRISC
2273 #elif defined(TARGET_PPC)
2274 #define QEMU_ARCH QEMU_ARCH_PPC
2275 #elif defined(TARGET_S390X)
2276@@ -101,6 +110,10 @@
2277 #define VECTYPE vector unsigned char
2278 #define SPLAT(p) vec_splat(vec_ld(0, p), 0)
2279 #define ALL_EQ(v1, v2) vec_all_eq(v1, v2)
2280+/* altivec.h may redefine the bool macro as vector type.
2281+ * Reset it to POSIX semantics. */
2282+#undef bool
2283+#define bool _Bool
2284 #elif defined __SSE2__
2285 #include <emmintrin.h>
2286 #define VECTYPE __m128i
2287@@ -112,6 +125,37 @@
2288 #define ALL_EQ(v1, v2) ((v1) == (v2))
2289 #endif
2290
2291+
2292+static struct defconfig_file {
2293+ const char *filename;
2294+ /* Indicates it is an user config file (disabled by -no-user-config) */
2295+ bool userconfig;
2296+} default_config_files[] = {
2297+ { CONFIG_QEMU_DATADIR "/cpus-" TARGET_ARCH ".conf", false },
2298+ { CONFIG_QEMU_CONFDIR "/qemu.conf", true },
2299+ { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", true },
2300+ { NULL }, /* end of list */
2301+};
2302+
2303+
2304+int qemu_read_default_config_files(bool userconfig)
2305+{
2306+ int ret;
2307+ struct defconfig_file *f;
2308+
2309+ for (f = default_config_files; f->filename; f++) {
2310+ if (!userconfig && f->userconfig) {
2311+ continue;
2312+ }
2313+ ret = qemu_read_config_file(f->filename);
2314+ if (ret < 0 && ret != -ENOENT) {
2315+ return ret;
2316+ }
2317+ }
2318+
2319+ return 0;
2320+}
2321+
2322 static int is_dup_page(uint8_t *page)
2323 {
2324 VECTYPE *p = (VECTYPE *)page;
2325@@ -127,14 +171,34 @@
2326 return 1;
2327 }
2328
2329+static void save_block_hdr(QEMUFile *f, RAMBlock *block, ram_addr_t offset,
2330+ int cont, int flag)
2331+{
2332+ qemu_put_be64(f, offset | cont | flag);
2333+ if (!cont) {
2334+ qemu_put_byte(f, strlen(block->idstr));
2335+ qemu_put_buffer(f, (uint8_t *)block->idstr,
2336+ strlen(block->idstr));
2337+ }
2338+
2339+}
2340+
2341 static RAMBlock *last_block;
2342 static ram_addr_t last_offset;
2343
2344+/*
2345+ * ram_save_block: Writes a page of memory to the stream f
2346+ *
2347+ * Returns: 0: if the page hasn't changed
2348+ * -1: if there are no more dirty pages
2349+ * n: the amount of bytes written in other case
2350+ */
2351+
2352 static int ram_save_block(QEMUFile *f)
2353 {
2354 RAMBlock *block = last_block;
2355 ram_addr_t offset = last_offset;
2356- int bytes_sent = 0;
2357+ int bytes_sent = -1;
2358 MemoryRegion *mr;
2359
2360 if (!block)
2361@@ -153,21 +217,11 @@
2362 p = memory_region_get_ram_ptr(mr) + offset;
2363
2364 if (is_dup_page(p)) {
2365- qemu_put_be64(f, offset | cont | RAM_SAVE_FLAG_COMPRESS);
2366- if (!cont) {
2367- qemu_put_byte(f, strlen(block->idstr));
2368- qemu_put_buffer(f, (uint8_t *)block->idstr,
2369- strlen(block->idstr));
2370- }
2371+ save_block_hdr(f, block, offset, cont, RAM_SAVE_FLAG_COMPRESS);
2372 qemu_put_byte(f, *p);
2373 bytes_sent = 1;
2374 } else {
2375- qemu_put_be64(f, offset | cont | RAM_SAVE_FLAG_PAGE);
2376- if (!cont) {
2377- qemu_put_byte(f, strlen(block->idstr));
2378- qemu_put_buffer(f, (uint8_t *)block->idstr,
2379- strlen(block->idstr));
2380- }
2381+ save_block_hdr(f, block, offset, cont, RAM_SAVE_FLAG_PAGE);
2382 qemu_put_buffer(f, p, TARGET_PAGE_SIZE);
2383 bytes_sent = TARGET_PAGE_SIZE;
2384 }
2385@@ -194,20 +248,7 @@
2386
2387 static ram_addr_t ram_save_remaining(void)
2388 {
2389- RAMBlock *block;
2390- ram_addr_t count = 0;
2391-
2392- QLIST_FOREACH(block, &ram_list.blocks, next) {
2393- ram_addr_t addr;
2394- for (addr = 0; addr < block->length; addr += TARGET_PAGE_SIZE) {
2395- if (memory_region_get_dirty(block->mr, addr, TARGET_PAGE_SIZE,
2396- DIRTY_MEMORY_MIGRATION)) {
2397- count++;
2398- }
2399- }
2400- }
2401-
2402- return count;
2403+ return ram_list.dirty_pages;
2404 }
2405
2406 uint64_t ram_bytes_remaining(void)
2407@@ -260,60 +301,88 @@
2408 g_free(blocks);
2409 }
2410
2411-int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
2412+static void migration_end(void)
2413+{
2414+ memory_global_dirty_log_stop();
2415+}
2416+
2417+static void ram_migration_cancel(void *opaque)
2418+{
2419+ migration_end();
2420+}
2421+
2422+#define MAX_WAIT 50 /* ms, half buffered_file limit */
2423+
2424+static int ram_save_setup(QEMUFile *f, void *opaque)
2425 {
2426 ram_addr_t addr;
2427+ RAMBlock *block;
2428+
2429+ bytes_transferred = 0;
2430+ last_block = NULL;
2431+ last_offset = 0;
2432+ sort_ram_list();
2433+
2434+ /* Make sure all dirty bits are set */
2435+ QLIST_FOREACH(block, &ram_list.blocks, next) {
2436+ for (addr = 0; addr < block->length; addr += TARGET_PAGE_SIZE) {
2437+ if (!memory_region_get_dirty(block->mr, addr, TARGET_PAGE_SIZE,
2438+ DIRTY_MEMORY_MIGRATION)) {
2439+ memory_region_set_dirty(block->mr, addr, TARGET_PAGE_SIZE);
2440+ }
2441+ }
2442+ }
2443+
2444+ memory_global_dirty_log_start();
2445+
2446+ qemu_put_be64(f, ram_bytes_total() | RAM_SAVE_FLAG_MEM_SIZE);
2447+
2448+ QLIST_FOREACH(block, &ram_list.blocks, next) {
2449+ qemu_put_byte(f, strlen(block->idstr));
2450+ qemu_put_buffer(f, (uint8_t *)block->idstr, strlen(block->idstr));
2451+ qemu_put_be64(f, block->length);
2452+ }
2453+
2454+ qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
2455+
2456+ return 0;
2457+}
2458+
2459+static int ram_save_iterate(QEMUFile *f, void *opaque)
2460+{
2461 uint64_t bytes_transferred_last;
2462 double bwidth = 0;
2463- uint64_t expected_time = 0;
2464 int ret;
2465-
2466- if (stage < 0) {
2467- memory_global_dirty_log_stop();
2468- return 0;
2469- }
2470-
2471- memory_global_sync_dirty_bitmap(get_system_memory());
2472-
2473- if (stage == 1) {
2474- RAMBlock *block;
2475- bytes_transferred = 0;
2476- last_block = NULL;
2477- last_offset = 0;
2478- sort_ram_list();
2479-
2480- /* Make sure all dirty bits are set */
2481- QLIST_FOREACH(block, &ram_list.blocks, next) {
2482- for (addr = 0; addr < block->length; addr += TARGET_PAGE_SIZE) {
2483- if (!memory_region_get_dirty(block->mr, addr, TARGET_PAGE_SIZE,
2484- DIRTY_MEMORY_MIGRATION)) {
2485- memory_region_set_dirty(block->mr, addr, TARGET_PAGE_SIZE);
2486- }
2487- }
2488- }
2489-
2490- memory_global_dirty_log_start();
2491-
2492- qemu_put_be64(f, ram_bytes_total() | RAM_SAVE_FLAG_MEM_SIZE);
2493-
2494- QLIST_FOREACH(block, &ram_list.blocks, next) {
2495- qemu_put_byte(f, strlen(block->idstr));
2496- qemu_put_buffer(f, (uint8_t *)block->idstr, strlen(block->idstr));
2497- qemu_put_be64(f, block->length);
2498- }
2499- }
2500+ int i;
2501+ uint64_t expected_time;
2502
2503 bytes_transferred_last = bytes_transferred;
2504 bwidth = qemu_get_clock_ns(rt_clock);
2505
2506+ i = 0;
2507 while ((ret = qemu_file_rate_limit(f)) == 0) {
2508 int bytes_sent;
2509
2510 bytes_sent = ram_save_block(f);
2511+ /* no more blocks to sent */
2512+ if (bytes_sent < 0) {
2513+ break;
2514+ }
2515 bytes_transferred += bytes_sent;
2516- if (bytes_sent == 0) { /* no more blocks */
2517- break;
2518+ /* we want to check in the 1st loop, just in case it was the 1st time
2519+ and we had to sync the dirty bitmap.
2520+ qemu_get_clock_ns() is a bit expensive, so we only check each some
2521+ iterations
2522+ */
2523+ if ((i & 63) == 0) {
2524+ uint64_t t1 = (qemu_get_clock_ns(rt_clock) - bwidth) / 1000000;
2525+ if (t1 > MAX_WAIT) {
2526+ DPRINTF("big wait: " PRIu64 " milliseconds, %d iterations\n",
2527+ t1, i);
2528+ break;
2529+ }
2530 }
2531+ i++;
2532 }
2533
2534 if (ret < 0) {
2535@@ -329,22 +398,44 @@
2536 bwidth = 0.000001;
2537 }
2538
2539+ qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
2540+
2541+ expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
2542+
2543+ DPRINTF("ram_save_live: expected(" PRIu64 ") <= max(" PRIu64 ")?\n",
2544+ expected_time, migrate_max_downtime());
2545+
2546+ if (expected_time <= migrate_max_downtime()) {
2547+ memory_global_sync_dirty_bitmap(get_system_memory());
2548+ expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
2549+
2550+ return expected_time <= migrate_max_downtime();
2551+ }
2552+ return 0;
2553+}
2554+
2555+static int ram_save_complete(QEMUFile *f, void *opaque)
2556+{
2557+ memory_global_sync_dirty_bitmap(get_system_memory());
2558+
2559 /* try transferring iterative blocks of memory */
2560- if (stage == 3) {
2561+
2562+ /* flush all remaining blocks regardless of rate limiting */
2563+ while (true) {
2564 int bytes_sent;
2565
2566- /* flush all remaining blocks regardless of rate limiting */
2567- while ((bytes_sent = ram_save_block(f)) != 0) {
2568- bytes_transferred += bytes_sent;
2569+ bytes_sent = ram_save_block(f);
2570+ /* no more blocks to sent */
2571+ if (bytes_sent < 0) {
2572+ break;
2573 }
2574- memory_global_dirty_log_stop();
2575+ bytes_transferred += bytes_sent;
2576 }
2577+ memory_global_dirty_log_stop();
2578
2579 qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
2580
2581- expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
2582-
2583- return (stage == 2) && (expected_time <= migrate_max_downtime());
2584+ return 0;
2585 }
2586
2587 static inline void *host_from_stream_offset(QEMUFile *f,
2588@@ -377,11 +468,14 @@
2589 return NULL;
2590 }
2591
2592-int ram_load(QEMUFile *f, void *opaque, int version_id)
2593+static int ram_load(QEMUFile *f, void *opaque, int version_id)
2594 {
2595 ram_addr_t addr;
2596- int flags;
2597+ int flags, ret = 0;
2598 int error;
2599+ static uint64_t seq_iter;
2600+
2601+ seq_iter++;
2602
2603 if (version_id < 4 || version_id > 4) {
2604 return -EINVAL;
2605@@ -411,8 +505,10 @@
2606
2607 QLIST_FOREACH(block, &ram_list.blocks, next) {
2608 if (!strncmp(id, block->idstr, sizeof(id))) {
2609- if (block->length != length)
2610- return -EINVAL;
2611+ if (block->length != length) {
2612+ ret = -EINVAL;
2613+ goto done;
2614+ }
2615 break;
2616 }
2617 }
2618@@ -420,7 +516,8 @@
2619 if (!block) {
2620 fprintf(stderr, "Unknown ramblock \"%s\", cannot "
2621 "accept migration\n", id);
2622- return -EINVAL;
2623+ ret = -EINVAL;
2624+ goto done;
2625 }
2626
2627 total_ram_bytes -= length;
2628@@ -449,18 +546,33 @@
2629 void *host;
2630
2631 host = host_from_stream_offset(f, addr, flags);
2632+ if (!host) {
2633+ return -EINVAL;
2634+ }
2635
2636 qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
2637 }
2638 error = qemu_file_get_error(f);
2639 if (error) {
2640- return error;
2641+ ret = error;
2642+ goto done;
2643 }
2644 } while (!(flags & RAM_SAVE_FLAG_EOS));
2645
2646- return 0;
2647+done:
2648+ DPRINTF("Completed load of VM with exit code %d seq iteration " PRIu64 "\n",
2649+ ret, seq_iter);
2650+ return ret;
2651 }
2652
2653+SaveVMHandlers savevm_ram_handlers = {
2654+ .save_live_setup = ram_save_setup,
2655+ .save_live_iterate = ram_save_iterate,
2656+ .save_live_complete = ram_save_complete,
2657+ .load_state = ram_load,
2658+ .cancel = ram_migration_cancel,
2659+};
2660+
2661 #ifdef HAS_AUDIO
2662 struct soundhw {
2663 const char *name;
2664@@ -475,7 +587,7 @@
2665
2666 static struct soundhw soundhw[] = {
2667 #ifdef HAS_AUDIO_CHOICE
2668-#if defined(TARGET_I386) || defined(TARGET_MIPS)
2669+#ifdef CONFIG_PCSPK
2670 {
2671 "pcspk",
2672 "PC speaker",
2673@@ -568,7 +680,7 @@
2674 {
2675 struct soundhw *c;
2676
2677- if (*optarg == '?') {
2678+ if (is_help_option(optarg)) {
2679 show_valid_cards:
2680
2681 printf("Valid sound card names (comma separated):\n");
2682@@ -576,7 +688,7 @@
2683 printf ("%-11s %s\n", c->name, c->descr);
2684 }
2685 printf("\n-soundhw all will enable all of the above\n");
2686- exit(*optarg != '?');
2687+ exit(!is_help_option(optarg));
2688 }
2689 else {
2690 size_t l;
2691
2692=== modified file 'arch_init.h'
2693--- arch_init.h 2012-02-02 14:25:28 +0000
2694+++ arch_init.h 2012-08-21 15:04:54 +0000
2695@@ -1,8 +1,6 @@
2696 #ifndef QEMU_ARCH_INIT_H
2697 #define QEMU_ARCH_INIT_H
2698
2699-extern const char arch_config_name[];
2700-
2701 enum {
2702 QEMU_ARCH_ALL = -1,
2703 QEMU_ARCH_ALPHA = 1,
2704@@ -18,6 +16,7 @@
2705 QEMU_ARCH_SH4 = 1024,
2706 QEMU_ARCH_SPARC = 2048,
2707 QEMU_ARCH_XTENSA = 4096,
2708+ QEMU_ARCH_OPENRISC = 8192,
2709 };
2710
2711 extern const uint32_t arch_type;
2712
2713=== removed file 'arm-semi.c'
2714--- arm-semi.c 2011-09-26 15:07:14 +0000
2715+++ arm-semi.c 1970-01-01 00:00:00 +0000
2716@@ -1,509 +0,0 @@
2717-/*
2718- * Arm "Angel" semihosting syscalls
2719- *
2720- * Copyright (c) 2005, 2007 CodeSourcery.
2721- * Written by Paul Brook.
2722- *
2723- * This program is free software; you can redistribute it and/or modify
2724- * it under the terms of the GNU General Public License as published by
2725- * the Free Software Foundation; either version 2 of the License, or
2726- * (at your option) any later version.
2727- *
2728- * This program is distributed in the hope that it will be useful,
2729- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2730- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2731- * GNU General Public License for more details.
2732- *
2733- * You should have received a copy of the GNU General Public License
2734- * along with this program; if not, see <http://www.gnu.org/licenses/>.
2735- */
2736-
2737-#include <sys/types.h>
2738-#include <sys/stat.h>
2739-#include <fcntl.h>
2740-#include <unistd.h>
2741-#include <stdlib.h>
2742-#include <stdio.h>
2743-#include <time.h>
2744-
2745-#include "cpu.h"
2746-#ifdef CONFIG_USER_ONLY
2747-#include "qemu.h"
2748-
2749-#define ARM_ANGEL_HEAP_SIZE (128 * 1024 * 1024)
2750-#else
2751-#include "qemu-common.h"
2752-#include "gdbstub.h"
2753-#include "hw/arm-misc.h"
2754-#endif
2755-
2756-#define SYS_OPEN 0x01
2757-#define SYS_CLOSE 0x02
2758-#define SYS_WRITEC 0x03
2759-#define SYS_WRITE0 0x04
2760-#define SYS_WRITE 0x05
2761-#define SYS_READ 0x06
2762-#define SYS_READC 0x07
2763-#define SYS_ISTTY 0x09
2764-#define SYS_SEEK 0x0a
2765-#define SYS_FLEN 0x0c
2766-#define SYS_TMPNAM 0x0d
2767-#define SYS_REMOVE 0x0e
2768-#define SYS_RENAME 0x0f
2769-#define SYS_CLOCK 0x10
2770-#define SYS_TIME 0x11
2771-#define SYS_SYSTEM 0x12
2772-#define SYS_ERRNO 0x13
2773-#define SYS_GET_CMDLINE 0x15
2774-#define SYS_HEAPINFO 0x16
2775-#define SYS_EXIT 0x18
2776-
2777-#ifndef O_BINARY
2778-#define O_BINARY 0
2779-#endif
2780-
2781-#define GDB_O_RDONLY 0x000
2782-#define GDB_O_WRONLY 0x001
2783-#define GDB_O_RDWR 0x002
2784-#define GDB_O_APPEND 0x008
2785-#define GDB_O_CREAT 0x200
2786-#define GDB_O_TRUNC 0x400
2787-#define GDB_O_BINARY 0
2788-
2789-static int gdb_open_modeflags[12] = {
2790- GDB_O_RDONLY,
2791- GDB_O_RDONLY | GDB_O_BINARY,
2792- GDB_O_RDWR,
2793- GDB_O_RDWR | GDB_O_BINARY,
2794- GDB_O_WRONLY | GDB_O_CREAT | GDB_O_TRUNC,
2795- GDB_O_WRONLY | GDB_O_CREAT | GDB_O_TRUNC | GDB_O_BINARY,
2796- GDB_O_RDWR | GDB_O_CREAT | GDB_O_TRUNC,
2797- GDB_O_RDWR | GDB_O_CREAT | GDB_O_TRUNC | GDB_O_BINARY,
2798- GDB_O_WRONLY | GDB_O_CREAT | GDB_O_APPEND,
2799- GDB_O_WRONLY | GDB_O_CREAT | GDB_O_APPEND | GDB_O_BINARY,
2800- GDB_O_RDWR | GDB_O_CREAT | GDB_O_APPEND,
2801- GDB_O_RDWR | GDB_O_CREAT | GDB_O_APPEND | GDB_O_BINARY
2802-};
2803-
2804-static int open_modeflags[12] = {
2805- O_RDONLY,
2806- O_RDONLY | O_BINARY,
2807- O_RDWR,
2808- O_RDWR | O_BINARY,
2809- O_WRONLY | O_CREAT | O_TRUNC,
2810- O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,
2811- O_RDWR | O_CREAT | O_TRUNC,
2812- O_RDWR | O_CREAT | O_TRUNC | O_BINARY,
2813- O_WRONLY | O_CREAT | O_APPEND,
2814- O_WRONLY | O_CREAT | O_APPEND | O_BINARY,
2815- O_RDWR | O_CREAT | O_APPEND,
2816- O_RDWR | O_CREAT | O_APPEND | O_BINARY
2817-};
2818-
2819-#ifdef CONFIG_USER_ONLY
2820-static inline uint32_t set_swi_errno(TaskState *ts, uint32_t code)
2821-{
2822- if (code == (uint32_t)-1)
2823- ts->swi_errno = errno;
2824- return code;
2825-}
2826-#else
2827-static inline uint32_t set_swi_errno(CPUState *env, uint32_t code)
2828-{
2829- return code;
2830-}
2831-
2832-#include "softmmu-semi.h"
2833-#endif
2834-
2835-static target_ulong arm_semi_syscall_len;
2836-
2837-#if !defined(CONFIG_USER_ONLY)
2838-static target_ulong syscall_err;
2839-#endif
2840-
2841-static void arm_semi_cb(CPUState *env, target_ulong ret, target_ulong err)
2842-{
2843-#ifdef CONFIG_USER_ONLY
2844- TaskState *ts = env->opaque;
2845-#endif
2846-
2847- if (ret == (target_ulong)-1) {
2848-#ifdef CONFIG_USER_ONLY
2849- ts->swi_errno = err;
2850-#else
2851- syscall_err = err;
2852-#endif
2853- env->regs[0] = ret;
2854- } else {
2855- /* Fixup syscalls that use nonstardard return conventions. */
2856- switch (env->regs[0]) {
2857- case SYS_WRITE:
2858- case SYS_READ:
2859- env->regs[0] = arm_semi_syscall_len - ret;
2860- break;
2861- case SYS_SEEK:
2862- env->regs[0] = 0;
2863- break;
2864- default:
2865- env->regs[0] = ret;
2866- break;
2867- }
2868- }
2869-}
2870-
2871-static void arm_semi_flen_cb(CPUState *env, target_ulong ret, target_ulong err)
2872-{
2873- /* The size is always stored in big-endian order, extract
2874- the value. We assume the size always fit in 32 bits. */
2875- uint32_t size;
2876- cpu_memory_rw_debug(env, env->regs[13]-64+32, (uint8_t *)&size, 4, 0);
2877- env->regs[0] = be32_to_cpu(size);
2878-#ifdef CONFIG_USER_ONLY
2879- ((TaskState *)env->opaque)->swi_errno = err;
2880-#else
2881- syscall_err = err;
2882-#endif
2883-}
2884-
2885-#define ARG(n) \
2886-({ \
2887- target_ulong __arg; \
2888- /* FIXME - handle get_user() failure */ \
2889- get_user_ual(__arg, args + (n) * 4); \
2890- __arg; \
2891-})
2892-#define SET_ARG(n, val) put_user_ual(val, args + (n) * 4)
2893-uint32_t do_arm_semihosting(CPUState *env)
2894-{
2895- target_ulong args;
2896- char * s;
2897- int nr;
2898- uint32_t ret;
2899- uint32_t len;
2900-#ifdef CONFIG_USER_ONLY
2901- TaskState *ts = env->opaque;
2902-#else
2903- CPUState *ts = env;
2904-#endif
2905-
2906- nr = env->regs[0];
2907- args = env->regs[1];
2908- switch (nr) {
2909- case SYS_OPEN:
2910- if (!(s = lock_user_string(ARG(0))))
2911- /* FIXME - should this error code be -TARGET_EFAULT ? */
2912- return (uint32_t)-1;
2913- if (ARG(1) >= 12)
2914- return (uint32_t)-1;
2915- if (strcmp(s, ":tt") == 0) {
2916- if (ARG(1) < 4)
2917- return STDIN_FILENO;
2918- else
2919- return STDOUT_FILENO;
2920- }
2921- if (use_gdb_syscalls()) {
2922- gdb_do_syscall(arm_semi_cb, "open,%s,%x,1a4", ARG(0),
2923- (int)ARG(2)+1, gdb_open_modeflags[ARG(1)]);
2924- return env->regs[0];
2925- } else {
2926- ret = set_swi_errno(ts, open(s, open_modeflags[ARG(1)], 0644));
2927- }
2928- unlock_user(s, ARG(0), 0);
2929- return ret;
2930- case SYS_CLOSE:
2931- if (use_gdb_syscalls()) {
2932- gdb_do_syscall(arm_semi_cb, "close,%x", ARG(0));
2933- return env->regs[0];
2934- } else {
2935- return set_swi_errno(ts, close(ARG(0)));
2936- }
2937- case SYS_WRITEC:
2938- {
2939- char c;
2940-
2941- if (get_user_u8(c, args))
2942- /* FIXME - should this error code be -TARGET_EFAULT ? */
2943- return (uint32_t)-1;
2944- /* Write to debug console. stderr is near enough. */
2945- if (use_gdb_syscalls()) {
2946- gdb_do_syscall(arm_semi_cb, "write,2,%x,1", args);
2947- return env->regs[0];
2948- } else {
2949- return write(STDERR_FILENO, &c, 1);
2950- }
2951- }
2952- case SYS_WRITE0:
2953- if (!(s = lock_user_string(args)))
2954- /* FIXME - should this error code be -TARGET_EFAULT ? */
2955- return (uint32_t)-1;
2956- len = strlen(s);
2957- if (use_gdb_syscalls()) {
2958- gdb_do_syscall(arm_semi_cb, "write,2,%x,%x\n", args, len);
2959- ret = env->regs[0];
2960- } else {
2961- ret = write(STDERR_FILENO, s, len);
2962- }
2963- unlock_user(s, args, 0);
2964- return ret;
2965- case SYS_WRITE:
2966- len = ARG(2);
2967- if (use_gdb_syscalls()) {
2968- arm_semi_syscall_len = len;
2969- gdb_do_syscall(arm_semi_cb, "write,%x,%x,%x", ARG(0), ARG(1), len);
2970- return env->regs[0];
2971- } else {
2972- if (!(s = lock_user(VERIFY_READ, ARG(1), len, 1)))
2973- /* FIXME - should this error code be -TARGET_EFAULT ? */
2974- return (uint32_t)-1;
2975- ret = set_swi_errno(ts, write(ARG(0), s, len));
2976- unlock_user(s, ARG(1), 0);
2977- if (ret == (uint32_t)-1)
2978- return -1;
2979- return len - ret;
2980- }
2981- case SYS_READ:
2982- len = ARG(2);
2983- if (use_gdb_syscalls()) {
2984- arm_semi_syscall_len = len;
2985- gdb_do_syscall(arm_semi_cb, "read,%x,%x,%x", ARG(0), ARG(1), len);
2986- return env->regs[0];
2987- } else {
2988- if (!(s = lock_user(VERIFY_WRITE, ARG(1), len, 0)))
2989- /* FIXME - should this error code be -TARGET_EFAULT ? */
2990- return (uint32_t)-1;
2991- do
2992- ret = set_swi_errno(ts, read(ARG(0), s, len));
2993- while (ret == -1 && errno == EINTR);
2994- unlock_user(s, ARG(1), len);
2995- if (ret == (uint32_t)-1)
2996- return -1;
2997- return len - ret;
2998- }
2999- case SYS_READC:
3000- /* XXX: Read from debug cosole. Not implemented. */
3001- return 0;
3002- case SYS_ISTTY:
3003- if (use_gdb_syscalls()) {
3004- gdb_do_syscall(arm_semi_cb, "isatty,%x", ARG(0));
3005- return env->regs[0];
3006- } else {
3007- return isatty(ARG(0));
3008- }
3009- case SYS_SEEK:
3010- if (use_gdb_syscalls()) {
3011- gdb_do_syscall(arm_semi_cb, "lseek,%x,%x,0", ARG(0), ARG(1));
3012- return env->regs[0];
3013- } else {
3014- ret = set_swi_errno(ts, lseek(ARG(0), ARG(1), SEEK_SET));
3015- if (ret == (uint32_t)-1)
3016- return -1;
3017- return 0;
3018- }
3019- case SYS_FLEN:
3020- if (use_gdb_syscalls()) {
3021- gdb_do_syscall(arm_semi_flen_cb, "fstat,%x,%x",
3022- ARG(0), env->regs[13]-64);
3023- return env->regs[0];
3024- } else {
3025- struct stat buf;
3026- ret = set_swi_errno(ts, fstat(ARG(0), &buf));
3027- if (ret == (uint32_t)-1)
3028- return -1;
3029- return buf.st_size;
3030- }
3031- case SYS_TMPNAM:
3032- /* XXX: Not implemented. */
3033- return -1;
3034- case SYS_REMOVE:
3035- if (use_gdb_syscalls()) {
3036- gdb_do_syscall(arm_semi_cb, "unlink,%s", ARG(0), (int)ARG(1)+1);
3037- ret = env->regs[0];
3038- } else {
3039- if (!(s = lock_user_string(ARG(0))))
3040- /* FIXME - should this error code be -TARGET_EFAULT ? */
3041- return (uint32_t)-1;
3042- ret = set_swi_errno(ts, remove(s));
3043- unlock_user(s, ARG(0), 0);
3044- }
3045- return ret;
3046- case SYS_RENAME:
3047- if (use_gdb_syscalls()) {
3048- gdb_do_syscall(arm_semi_cb, "rename,%s,%s",
3049- ARG(0), (int)ARG(1)+1, ARG(2), (int)ARG(3)+1);
3050- return env->regs[0];
3051- } else {
3052- char *s2;
3053- s = lock_user_string(ARG(0));
3054- s2 = lock_user_string(ARG(2));
3055- if (!s || !s2)
3056- /* FIXME - should this error code be -TARGET_EFAULT ? */
3057- ret = (uint32_t)-1;
3058- else
3059- ret = set_swi_errno(ts, rename(s, s2));
3060- if (s2)
3061- unlock_user(s2, ARG(2), 0);
3062- if (s)
3063- unlock_user(s, ARG(0), 0);
3064- return ret;
3065- }
3066- case SYS_CLOCK:
3067- return clock() / (CLOCKS_PER_SEC / 100);
3068- case SYS_TIME:
3069- return set_swi_errno(ts, time(NULL));
3070- case SYS_SYSTEM:
3071- if (use_gdb_syscalls()) {
3072- gdb_do_syscall(arm_semi_cb, "system,%s", ARG(0), (int)ARG(1)+1);
3073- return env->regs[0];
3074- } else {
3075- if (!(s = lock_user_string(ARG(0))))
3076- /* FIXME - should this error code be -TARGET_EFAULT ? */
3077- return (uint32_t)-1;
3078- ret = set_swi_errno(ts, system(s));
3079- unlock_user(s, ARG(0), 0);
3080- return ret;
3081- }
3082- case SYS_ERRNO:
3083-#ifdef CONFIG_USER_ONLY
3084- return ts->swi_errno;
3085-#else
3086- return syscall_err;
3087-#endif
3088- case SYS_GET_CMDLINE:
3089- {
3090- /* Build a command-line from the original argv.
3091- *
3092- * The inputs are:
3093- * * ARG(0), pointer to a buffer of at least the size
3094- * specified in ARG(1).
3095- * * ARG(1), size of the buffer pointed to by ARG(0) in
3096- * bytes.
3097- *
3098- * The outputs are:
3099- * * ARG(0), pointer to null-terminated string of the
3100- * command line.
3101- * * ARG(1), length of the string pointed to by ARG(0).
3102- */
3103-
3104- char *output_buffer;
3105- size_t input_size = ARG(1);
3106- size_t output_size;
3107- int status = 0;
3108-
3109- /* Compute the size of the output string. */
3110-#if !defined(CONFIG_USER_ONLY)
3111- output_size = strlen(ts->boot_info->kernel_filename)
3112- + 1 /* Separating space. */
3113- + strlen(ts->boot_info->kernel_cmdline)
3114- + 1; /* Terminating null byte. */
3115-#else
3116- unsigned int i;
3117-
3118- output_size = ts->info->arg_end - ts->info->arg_start;
3119- if (!output_size) {
3120- /* We special-case the "empty command line" case (argc==0).
3121- Just provide the terminating 0. */
3122- output_size = 1;
3123- }
3124-#endif
3125-
3126- if (output_size > input_size) {
3127- /* Not enough space to store command-line arguments. */
3128- return -1;
3129- }
3130-
3131- /* Adjust the command-line length. */
3132- SET_ARG(1, output_size - 1);
3133-
3134- /* Lock the buffer on the ARM side. */
3135- output_buffer = lock_user(VERIFY_WRITE, ARG(0), output_size, 0);
3136- if (!output_buffer) {
3137- return -1;
3138- }
3139-
3140- /* Copy the command-line arguments. */
3141-#if !defined(CONFIG_USER_ONLY)
3142- pstrcpy(output_buffer, output_size, ts->boot_info->kernel_filename);
3143- pstrcat(output_buffer, output_size, " ");
3144- pstrcat(output_buffer, output_size, ts->boot_info->kernel_cmdline);
3145-#else
3146- if (output_size == 1) {
3147- /* Empty command-line. */
3148- output_buffer[0] = '\0';
3149- goto out;
3150- }
3151-
3152- if (copy_from_user(output_buffer, ts->info->arg_start,
3153- output_size)) {
3154- status = -1;
3155- goto out;
3156- }
3157-
3158- /* Separate arguments by white spaces. */
3159- for (i = 0; i < output_size - 1; i++) {
3160- if (output_buffer[i] == 0) {
3161- output_buffer[i] = ' ';
3162- }
3163- }
3164- out:
3165-#endif
3166- /* Unlock the buffer on the ARM side. */
3167- unlock_user(output_buffer, ARG(0), output_size);
3168-
3169- return status;
3170- }
3171- case SYS_HEAPINFO:
3172- {
3173- uint32_t *ptr;
3174- uint32_t limit;
3175-
3176-#ifdef CONFIG_USER_ONLY
3177- /* Some C libraries assume the heap immediately follows .bss, so
3178- allocate it using sbrk. */
3179- if (!ts->heap_limit) {
3180- abi_ulong ret;
3181-
3182- ts->heap_base = do_brk(0);
3183- limit = ts->heap_base + ARM_ANGEL_HEAP_SIZE;
3184- /* Try a big heap, and reduce the size if that fails. */
3185- for (;;) {
3186- ret = do_brk(limit);
3187- if (ret >= limit) {
3188- break;
3189- }
3190- limit = (ts->heap_base >> 1) + (limit >> 1);
3191- }
3192- ts->heap_limit = limit;
3193- }
3194-
3195- if (!(ptr = lock_user(VERIFY_WRITE, ARG(0), 16, 0)))
3196- /* FIXME - should this error code be -TARGET_EFAULT ? */
3197- return (uint32_t)-1;
3198- ptr[0] = tswap32(ts->heap_base);
3199- ptr[1] = tswap32(ts->heap_limit);
3200- ptr[2] = tswap32(ts->stack_base);
3201- ptr[3] = tswap32(0); /* Stack limit. */
3202- unlock_user(ptr, ARG(0), 16);
3203-#else
3204- limit = ram_size;
3205- if (!(ptr = lock_user(VERIFY_WRITE, ARG(0), 16, 0)))
3206- /* FIXME - should this error code be -TARGET_EFAULT ? */
3207- return (uint32_t)-1;
3208- /* TODO: Make this use the limit of the loaded application. */
3209- ptr[0] = tswap32(limit / 2);
3210- ptr[1] = tswap32(limit);
3211- ptr[2] = tswap32(limit); /* Stack base */
3212- ptr[3] = tswap32(0); /* Stack limit. */
3213- unlock_user(ptr, ARG(0), 16);
3214-#endif
3215- return 0;
3216- }
3217- case SYS_EXIT:
3218- gdb_exit(env, 0);
3219- exit(0);
3220- default:
3221- fprintf(stderr, "qemu: Unsupported SemiHosting SWI 0x%02x\n", nr);
3222- cpu_dump_state(env, stderr, fprintf, 0);
3223- abort();
3224- }
3225-}
3226
3227=== modified file 'async.c'
3228--- async.c 2011-12-06 09:35:22 +0000
3229+++ async.c 2012-08-21 15:04:54 +0000
3230@@ -35,10 +35,10 @@
3231 struct QEMUBH {
3232 QEMUBHFunc *cb;
3233 void *opaque;
3234- int scheduled;
3235- int idle;
3236- int deleted;
3237 QEMUBH *next;
3238+ bool scheduled;
3239+ bool idle;
3240+ bool deleted;
3241 };
3242
3243 QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
3244@@ -120,7 +120,7 @@
3245 bh->deleted = 1;
3246 }
3247
3248-void qemu_bh_update_timeout(int *timeout)
3249+void qemu_bh_update_timeout(uint32_t *timeout)
3250 {
3251 QEMUBH *bh;
3252
3253
3254=== added file 'audio/Makefile.objs'
3255--- audio/Makefile.objs 1970-01-01 00:00:00 +0000
3256+++ audio/Makefile.objs 2012-08-21 15:04:54 +0000
3257@@ -0,0 +1,14 @@
3258+common-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
3259+common-obj-$(CONFIG_SDL) += sdlaudio.o
3260+common-obj-$(CONFIG_OSS) += ossaudio.o
3261+common-obj-$(CONFIG_SPICE) += spiceaudio.o
3262+common-obj-$(CONFIG_COREAUDIO) += coreaudio.o
3263+common-obj-$(CONFIG_ALSA) += alsaaudio.o
3264+common-obj-$(CONFIG_DSOUND) += dsoundaudio.o
3265+common-obj-$(CONFIG_FMOD) += fmodaudio.o
3266+common-obj-$(CONFIG_ESD) += esdaudio.o
3267+common-obj-$(CONFIG_PA) += paaudio.o
3268+common-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
3269+common-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
3270+common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
3271+common-obj-y += wavcapture.o
3272
3273=== modified file 'audio/audio.c'
3274--- audio/audio.c 2012-03-15 16:18:18 +0000
3275+++ audio/audio.c 2012-08-21 15:04:54 +0000
3276@@ -818,6 +818,7 @@
3277 sw->active = hw->enabled;
3278 sw->conv = noop_conv;
3279 sw->ratio = ((int64_t) hw_cap->info.freq << 32) / sw->info.freq;
3280+ sw->vol = nominal_volume;
3281 sw->rate = st_rate_start (sw->info.freq, hw_cap->info.freq);
3282 if (!sw->rate) {
3283 dolog ("Could not start rate conversion for `%s'\n", SW_NAME (sw));
3284@@ -957,7 +958,9 @@
3285 total += isamp;
3286 }
3287
3288- mixeng_volume (sw->buf, ret, &sw->vol);
3289+ if (!(hw->ctl_caps & VOICE_VOLUME_CAP)) {
3290+ mixeng_volume (sw->buf, ret, &sw->vol);
3291+ }
3292
3293 sw->clip (buf, sw->buf, ret);
3294 sw->total_hw_samples_acquired += total;
3295@@ -1041,7 +1044,10 @@
3296 swlim = audio_MIN (swlim, samples);
3297 if (swlim) {
3298 sw->conv (sw->buf, buf, swlim);
3299- mixeng_volume (sw->buf, swlim, &sw->vol);
3300+
3301+ if (!(sw->hw->ctl_caps & VOICE_VOLUME_CAP)) {
3302+ mixeng_volume (sw->buf, swlim, &sw->vol);
3303+ }
3304 }
3305
3306 while (swlim) {
3307@@ -1770,10 +1776,12 @@
3308 HWVoiceOut *hwo = NULL;
3309 HWVoiceIn *hwi = NULL;
3310
3311- while ((hwo = audio_pcm_hw_find_any_enabled_out (hwo))) {
3312+ while ((hwo = audio_pcm_hw_find_any_out (hwo))) {
3313 SWVoiceCap *sc;
3314
3315- hwo->pcm_ops->ctl_out (hwo, VOICE_DISABLE);
3316+ if (hwo->enabled) {
3317+ hwo->pcm_ops->ctl_out (hwo, VOICE_DISABLE);
3318+ }
3319 hwo->pcm_ops->fini_out (hwo);
3320
3321 for (sc = hwo->cap_head.lh_first; sc; sc = sc->entries.le_next) {
3322@@ -1786,8 +1794,10 @@
3323 }
3324 }
3325
3326- while ((hwi = audio_pcm_hw_find_any_enabled_in (hwi))) {
3327- hwi->pcm_ops->ctl_in (hwi, VOICE_DISABLE);
3328+ while ((hwi = audio_pcm_hw_find_any_in (hwi))) {
3329+ if (hwi->enabled) {
3330+ hwi->pcm_ops->ctl_in (hwi, VOICE_DISABLE);
3331+ }
3332 hwi->pcm_ops->fini_in (hwi);
3333 }
3334
3335@@ -2053,17 +2063,29 @@
3336 void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t rvol)
3337 {
3338 if (sw) {
3339+ HWVoiceOut *hw = sw->hw;
3340+
3341 sw->vol.mute = mute;
3342 sw->vol.l = nominal_volume.l * lvol / 255;
3343 sw->vol.r = nominal_volume.r * rvol / 255;
3344+
3345+ if (hw->pcm_ops->ctl_out) {
3346+ hw->pcm_ops->ctl_out (hw, VOICE_VOLUME, sw);
3347+ }
3348 }
3349 }
3350
3351 void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol)
3352 {
3353 if (sw) {
3354+ HWVoiceIn *hw = sw->hw;
3355+
3356 sw->vol.mute = mute;
3357 sw->vol.l = nominal_volume.l * lvol / 255;
3358 sw->vol.r = nominal_volume.r * rvol / 255;
3359+
3360+ if (hw->pcm_ops->ctl_in) {
3361+ hw->pcm_ops->ctl_in (hw, VOICE_VOLUME, sw);
3362+ }
3363 }
3364 }
3365
3366=== modified file 'audio/audio_int.h'
3367--- audio/audio_int.h 2011-02-02 19:58:26 +0000
3368+++ audio/audio_int.h 2012-08-21 15:04:54 +0000
3369@@ -82,6 +82,7 @@
3370 int samples;
3371 QLIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
3372 QLIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
3373+ int ctl_caps;
3374 struct audio_pcm_ops *pcm_ops;
3375 QLIST_ENTRY (HWVoiceOut) entries;
3376 } HWVoiceOut;
3377@@ -101,6 +102,7 @@
3378
3379 int samples;
3380 QLIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
3381+ int ctl_caps;
3382 struct audio_pcm_ops *pcm_ops;
3383 QLIST_ENTRY (HWVoiceIn) entries;
3384 } HWVoiceIn;
3385@@ -150,6 +152,7 @@
3386 int max_voices_in;
3387 int voice_size_out;
3388 int voice_size_in;
3389+ int ctl_caps;
3390 };
3391
3392 struct audio_pcm_ops {
3393@@ -231,6 +234,9 @@
3394
3395 #define VOICE_ENABLE 1
3396 #define VOICE_DISABLE 2
3397+#define VOICE_VOLUME 3
3398+
3399+#define VOICE_VOLUME_CAP (1 << VOICE_VOLUME)
3400
3401 static inline int audio_ring_dist (int dst, int src, int len)
3402 {
3403
3404=== modified file 'audio/audio_template.h'
3405--- audio/audio_template.h 2011-10-28 17:37:30 +0000
3406+++ audio/audio_template.h 2012-08-21 15:04:54 +0000
3407@@ -263,6 +263,8 @@
3408 }
3409
3410 hw->pcm_ops = drv->pcm_ops;
3411+ hw->ctl_caps = drv->ctl_caps;
3412+
3413 QLIST_INIT (&hw->sw_head);
3414 #ifdef DAC
3415 QLIST_INIT (&hw->cap_head);
3416
3417=== modified file 'audio/mixeng.c'
3418--- audio/mixeng.c 2011-10-28 17:37:30 +0000
3419+++ audio/mixeng.c 2012-08-21 15:04:54 +0000
3420@@ -33,7 +33,8 @@
3421 #define ENDIAN_CONVERT(v) (v)
3422
3423 /* Signed 8 bit */
3424-#define IN_T int8_t
3425+#define BSIZE 8
3426+#define ITYPE int
3427 #define IN_MIN SCHAR_MIN
3428 #define IN_MAX SCHAR_MAX
3429 #define SIGNED
3430@@ -42,25 +43,29 @@
3431 #undef SIGNED
3432 #undef IN_MAX
3433 #undef IN_MIN
3434-#undef IN_T
3435+#undef BSIZE
3436+#undef ITYPE
3437 #undef SHIFT
3438
3439 /* Unsigned 8 bit */
3440-#define IN_T uint8_t
3441+#define BSIZE 8
3442+#define ITYPE uint
3443 #define IN_MIN 0
3444 #define IN_MAX UCHAR_MAX
3445 #define SHIFT 8
3446 #include "mixeng_template.h"
3447 #undef IN_MAX
3448 #undef IN_MIN
3449-#undef IN_T
3450+#undef BSIZE
3451+#undef ITYPE
3452 #undef SHIFT
3453
3454 #undef ENDIAN_CONVERT
3455 #undef ENDIAN_CONVERSION
3456
3457 /* Signed 16 bit */
3458-#define IN_T int16_t
3459+#define BSIZE 16
3460+#define ITYPE int
3461 #define IN_MIN SHRT_MIN
3462 #define IN_MAX SHRT_MAX
3463 #define SIGNED
3464@@ -78,11 +83,13 @@
3465 #undef SIGNED
3466 #undef IN_MAX
3467 #undef IN_MIN
3468-#undef IN_T
3469+#undef BSIZE
3470+#undef ITYPE
3471 #undef SHIFT
3472
3473 /* Unsigned 16 bit */
3474-#define IN_T uint16_t
3475+#define BSIZE 16
3476+#define ITYPE uint
3477 #define IN_MIN 0
3478 #define IN_MAX USHRT_MAX
3479 #define SHIFT 16
3480@@ -98,11 +105,13 @@
3481 #undef ENDIAN_CONVERSION
3482 #undef IN_MAX
3483 #undef IN_MIN
3484-#undef IN_T
3485+#undef BSIZE
3486+#undef ITYPE
3487 #undef SHIFT
3488
3489 /* Signed 32 bit */
3490-#define IN_T int32_t
3491+#define BSIZE 32
3492+#define ITYPE int
3493 #define IN_MIN INT32_MIN
3494 #define IN_MAX INT32_MAX
3495 #define SIGNED
3496@@ -120,11 +129,13 @@
3497 #undef SIGNED
3498 #undef IN_MAX
3499 #undef IN_MIN
3500-#undef IN_T
3501+#undef BSIZE
3502+#undef ITYPE
3503 #undef SHIFT
3504
3505 /* Unsigned 32 bit */
3506-#define IN_T uint32_t
3507+#define BSIZE 32
3508+#define ITYPE uint
3509 #define IN_MIN 0
3510 #define IN_MAX UINT32_MAX
3511 #define SHIFT 32
3512@@ -140,7 +151,8 @@
3513 #undef ENDIAN_CONVERSION
3514 #undef IN_MAX
3515 #undef IN_MIN
3516-#undef IN_T
3517+#undef BSIZE
3518+#undef ITYPE
3519 #undef SHIFT
3520
3521 t_sample *mixeng_conv[2][2][2][3] = {
3522
3523=== modified file 'audio/mixeng_template.h'
3524--- audio/mixeng_template.h 2011-06-16 09:04:43 +0000
3525+++ audio/mixeng_template.h 2012-08-21 15:04:54 +0000
3526@@ -31,7 +31,8 @@
3527 #define HALF (IN_MAX >> 1)
3528 #endif
3529
3530-#define ET glue (ENDIAN_CONVERSION, glue (_, IN_T))
3531+#define ET glue (ENDIAN_CONVERSION, glue (glue (glue (_, ITYPE), BSIZE), _t))
3532+#define IN_T glue (glue (ITYPE, BSIZE), _t)
3533
3534 #ifdef FLOAT_MIXENG
3535 static mixeng_real inline glue (conv_, ET) (IN_T v)
3536@@ -150,3 +151,4 @@
3537
3538 #undef ET
3539 #undef HALF
3540+#undef IN_T
3541
3542=== modified file 'audio/paaudio.c'
3543--- audio/paaudio.c 2011-10-28 17:37:30 +0000
3544+++ audio/paaudio.c 2012-08-21 15:04:54 +0000
3545@@ -2,8 +2,7 @@
3546 #include "qemu-common.h"
3547 #include "audio.h"
3548
3549-#include <pulse/simple.h>
3550-#include <pulse/error.h>
3551+#include <pulse/pulseaudio.h>
3552
3553 #define AUDIO_CAP "pulseaudio"
3554 #include "audio_int.h"
3555@@ -15,7 +14,7 @@
3556 int live;
3557 int decr;
3558 int rpos;
3559- pa_simple *s;
3560+ pa_stream *stream;
3561 void *pcm_buf;
3562 struct audio_pt pt;
3563 } PAVoiceOut;
3564@@ -26,17 +25,23 @@
3565 int dead;
3566 int incr;
3567 int wpos;
3568- pa_simple *s;
3569+ pa_stream *stream;
3570 void *pcm_buf;
3571 struct audio_pt pt;
3572+ const void *read_data;
3573+ size_t read_index, read_length;
3574 } PAVoiceIn;
3575
3576-static struct {
3577+typedef struct {
3578 int samples;
3579 char *server;
3580 char *sink;
3581 char *source;
3582-} conf = {
3583+ pa_threaded_mainloop *mainloop;
3584+ pa_context *context;
3585+} paaudio;
3586+
3587+static paaudio glob_paaudio = {
3588 .samples = 4096,
3589 };
3590
3591@@ -51,6 +56,146 @@
3592 AUD_log (AUDIO_CAP, "Reason: %s\n", pa_strerror (err));
3593 }
3594
3595+#ifndef PA_CONTEXT_IS_GOOD
3596+static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x)
3597+{
3598+ return
3599+ x == PA_CONTEXT_CONNECTING ||
3600+ x == PA_CONTEXT_AUTHORIZING ||
3601+ x == PA_CONTEXT_SETTING_NAME ||
3602+ x == PA_CONTEXT_READY;
3603+}
3604+#endif
3605+
3606+#ifndef PA_STREAM_IS_GOOD
3607+static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x)
3608+{
3609+ return
3610+ x == PA_STREAM_CREATING ||
3611+ x == PA_STREAM_READY;
3612+}
3613+#endif
3614+
3615+#define CHECK_SUCCESS_GOTO(c, rerror, expression, label) \
3616+ do { \
3617+ if (!(expression)) { \
3618+ if (rerror) { \
3619+ *(rerror) = pa_context_errno ((c)->context); \
3620+ } \
3621+ goto label; \
3622+ } \
3623+ } while (0);
3624+
3625+#define CHECK_DEAD_GOTO(c, stream, rerror, label) \
3626+ do { \
3627+ if (!(c)->context || !PA_CONTEXT_IS_GOOD (pa_context_get_state((c)->context)) || \
3628+ !(stream) || !PA_STREAM_IS_GOOD (pa_stream_get_state ((stream)))) { \
3629+ if (((c)->context && pa_context_get_state ((c)->context) == PA_CONTEXT_FAILED) || \
3630+ ((stream) && pa_stream_get_state ((stream)) == PA_STREAM_FAILED)) { \
3631+ if (rerror) { \
3632+ *(rerror) = pa_context_errno ((c)->context); \
3633+ } \
3634+ } else { \
3635+ if (rerror) { \
3636+ *(rerror) = PA_ERR_BADSTATE; \
3637+ } \
3638+ } \
3639+ goto label; \
3640+ } \
3641+ } while (0);
3642+
3643+static int qpa_simple_read (PAVoiceIn *p, void *data, size_t length, int *rerror)
3644+{
3645+ paaudio *g = &glob_paaudio;
3646+
3647+ pa_threaded_mainloop_lock (g->mainloop);
3648+
3649+ CHECK_DEAD_GOTO (g, p->stream, rerror, unlock_and_fail);
3650+
3651+ while (length > 0) {
3652+ size_t l;
3653+
3654+ while (!p->read_data) {
3655+ int r;
3656+
3657+ r = pa_stream_peek (p->stream, &p->read_data, &p->read_length);
3658+ CHECK_SUCCESS_GOTO (g, rerror, r == 0, unlock_and_fail);
3659+
3660+ if (!p->read_data) {
3661+ pa_threaded_mainloop_wait (g->mainloop);
3662+ CHECK_DEAD_GOTO (g, p->stream, rerror, unlock_and_fail);
3663+ } else {
3664+ p->read_index = 0;
3665+ }
3666+ }
3667+
3668+ l = p->read_length < length ? p->read_length : length;
3669+ memcpy (data, (const uint8_t *) p->read_data+p->read_index, l);
3670+
3671+ data = (uint8_t *) data + l;
3672+ length -= l;
3673+
3674+ p->read_index += l;
3675+ p->read_length -= l;
3676+
3677+ if (!p->read_length) {
3678+ int r;
3679+
3680+ r = pa_stream_drop (p->stream);
3681+ p->read_data = NULL;
3682+ p->read_length = 0;
3683+ p->read_index = 0;
3684+
3685+ CHECK_SUCCESS_GOTO (g, rerror, r == 0, unlock_and_fail);
3686+ }
3687+ }
3688+
3689+ pa_threaded_mainloop_unlock (g->mainloop);
3690+ return 0;
3691+
3692+unlock_and_fail:
3693+ pa_threaded_mainloop_unlock (g->mainloop);
3694+ return -1;
3695+}
3696+
3697+static int qpa_simple_write (PAVoiceOut *p, const void *data, size_t length, int *rerror)
3698+{
3699+ paaudio *g = &glob_paaudio;
3700+
3701+ pa_threaded_mainloop_lock (g->mainloop);
3702+
3703+ CHECK_DEAD_GOTO (g, p->stream, rerror, unlock_and_fail);
3704+
3705+ while (length > 0) {
3706+ size_t l;
3707+ int r;
3708+
3709+ while (!(l = pa_stream_writable_size (p->stream))) {
3710+ pa_threaded_mainloop_wait (g->mainloop);
3711+ CHECK_DEAD_GOTO (g, p->stream, rerror, unlock_and_fail);
3712+ }
3713+
3714+ CHECK_SUCCESS_GOTO (g, rerror, l != (size_t) -1, unlock_and_fail);
3715+
3716+ if (l > length) {
3717+ l = length;
3718+ }
3719+
3720+ r = pa_stream_write (p->stream, data, l, NULL, 0LL, PA_SEEK_RELATIVE);
3721+ CHECK_SUCCESS_GOTO (g, rerror, r >= 0, unlock_and_fail);
3722+
3723+ data = (const uint8_t *) data + l;
3724+ length -= l;
3725+ }
3726+
3727+ pa_threaded_mainloop_unlock (g->mainloop);
3728+ return 0;
3729+
3730+unlock_and_fail:
3731+ pa_threaded_mainloop_unlock (g->mainloop);
3732+ return -1;
3733+}
3734+
3735 static void *qpa_thread_out (void *arg)
3736 {
3737 PAVoiceOut *pa = arg;
3738@@ -77,7 +222,7 @@
3739 }
3740 }
3741
3742- decr = to_mix = audio_MIN (pa->live, conf.samples >> 2);
3743+ decr = to_mix = audio_MIN (pa->live, glob_paaudio.samples >> 2);
3744 rpos = pa->rpos;
3745
3746 if (audio_pt_unlock (&pa->pt, AUDIO_FUNC)) {
3747@@ -91,8 +236,8 @@
3748
3749 hw->clip (pa->pcm_buf, src, chunk);
3750
3751- if (pa_simple_write (pa->s, pa->pcm_buf,
3752- chunk << hw->info.shift, &error) < 0) {
3753+ if (qpa_simple_write (pa, pa->pcm_buf,
3754+ chunk << hw->info.shift, &error) < 0) {
3755 qpa_logerr (error, "pa_simple_write failed\n");
3756 return NULL;
3757 }
3758@@ -169,7 +314,7 @@
3759 }
3760 }
3761
3762- incr = to_grab = audio_MIN (pa->dead, conf.samples >> 2);
3763+ incr = to_grab = audio_MIN (pa->dead, glob_paaudio.samples >> 2);
3764 wpos = pa->wpos;
3765
3766 if (audio_pt_unlock (&pa->pt, AUDIO_FUNC)) {
3767@@ -181,8 +326,8 @@
3768 int chunk = audio_MIN (to_grab, hw->samples - wpos);
3769 void *buf = advance (pa->pcm_buf, wpos);
3770
3771- if (pa_simple_read (pa->s, buf,
3772- chunk << hw->info.shift, &error) < 0) {
3773+ if (qpa_simple_read (pa, buf,
3774+ chunk << hw->info.shift, &error) < 0) {
3775 qpa_logerr (error, "pa_simple_read failed\n");
3776 return NULL;
3777 }
3778@@ -283,6 +428,112 @@
3779 }
3780 }
3781
3782+static void context_state_cb (pa_context *c, void *userdata)
3783+{
3784+ paaudio *g = &glob_paaudio;
3785+
3786+ switch (pa_context_get_state(c)) {
3787+ case PA_CONTEXT_READY:
3788+ case PA_CONTEXT_TERMINATED:
3789+ case PA_CONTEXT_FAILED:
3790+ pa_threaded_mainloop_signal (g->mainloop, 0);
3791+ break;
3792+
3793+ case PA_CONTEXT_UNCONNECTED:
3794+ case PA_CONTEXT_CONNECTING:
3795+ case PA_CONTEXT_AUTHORIZING:
3796+ case PA_CONTEXT_SETTING_NAME:
3797+ break;
3798+ }
3799+}
3800+
3801+static void stream_state_cb (pa_stream *s, void * userdata)
3802+{
3803+ paaudio *g = &glob_paaudio;
3804+
3805+ switch (pa_stream_get_state (s)) {
3806+
3807+ case PA_STREAM_READY:
3808+ case PA_STREAM_FAILED:
3809+ case PA_STREAM_TERMINATED:
3810+ pa_threaded_mainloop_signal (g->mainloop, 0);
3811+ break;
3812+
3813+ case PA_STREAM_UNCONNECTED:
3814+ case PA_STREAM_CREATING:
3815+ break;
3816+ }
3817+}
3818+
3819+static void stream_request_cb (pa_stream *s, size_t length, void *userdata)
3820+{
3821+ paaudio *g = &glob_paaudio;
3822+
3823+ pa_threaded_mainloop_signal (g->mainloop, 0);
3824+}
3825+
3826+static pa_stream *qpa_simple_new (
3827+ const char *server,
3828+ const char *name,
3829+ pa_stream_direction_t dir,
3830+ const char *dev,
3831+ const char *stream_name,
3832+ const pa_sample_spec *ss,
3833+ const pa_channel_map *map,
3834+ const pa_buffer_attr *attr,
3835+ int *rerror)
3836+{
3837+ paaudio *g = &glob_paaudio;
3838+ int r;
3839+ pa_stream *stream;
3840+
3841+ pa_threaded_mainloop_lock (g->mainloop);
3842+
3843+ stream = pa_stream_new (g->context, name, ss, map);
3844+ if (!stream) {
3845+ goto fail;
3846+ }
3847+
3848+ pa_stream_set_state_callback (stream, stream_state_cb, g);
3849+ pa_stream_set_read_callback (stream, stream_request_cb, g);
3850+ pa_stream_set_write_callback (stream, stream_request_cb, g);
3851+
3852+ if (dir == PA_STREAM_PLAYBACK) {
3853+ r = pa_stream_connect_playback (stream, dev, attr,
3854+ PA_STREAM_INTERPOLATE_TIMING
3855+#ifdef PA_STREAM_ADJUST_LATENCY
3856+ |PA_STREAM_ADJUST_LATENCY
3857+#endif
3858+ |PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL);
3859+ } else {
3860+ r = pa_stream_connect_record (stream, dev, attr,
3861+ PA_STREAM_INTERPOLATE_TIMING
3862+#ifdef PA_STREAM_ADJUST_LATENCY
3863+ |PA_STREAM_ADJUST_LATENCY
3864+#endif
3865+ |PA_STREAM_AUTO_TIMING_UPDATE);
3866+ }
3867+
3868+ if (r < 0) {
3869+ goto fail;
3870+ }
3871+
3872+ pa_threaded_mainloop_unlock (g->mainloop);
3873+
3874+ return stream;
3875+
3876+fail:
3877+ pa_threaded_mainloop_unlock (g->mainloop);
3878+
3879+ if (stream) {
3880+ pa_stream_unref (stream);
3881+ }
3882+
3883+ *rerror = pa_context_errno (g->context);
3884+
3885+ return NULL;
3886+}
3887+
3888 static int qpa_init_out (HWVoiceOut *hw, struct audsettings *as)
3889 {
3890 int error;
3891@@ -306,24 +557,24 @@
3892
3893 obt_as.fmt = pa_to_audfmt (ss.format, &obt_as.endianness);
3894
3895- pa->s = pa_simple_new (
3896- conf.server,
3897+ pa->stream = qpa_simple_new (
3898+ glob_paaudio.server,
3899 "qemu",
3900 PA_STREAM_PLAYBACK,
3901- conf.sink,
3902+ glob_paaudio.sink,
3903 "pcm.playback",
3904 &ss,
3905 NULL, /* channel map */
3906 &ba, /* buffering attributes */
3907 &error
3908 );
3909- if (!pa->s) {
3910+ if (!pa->stream) {
3911 qpa_logerr (error, "pa_simple_new for playback failed\n");
3912 goto fail1;
3913 }
3914
3915 audio_pcm_init_info (&hw->info, &obt_as);
3916- hw->samples = conf.samples;
3917+ hw->samples = glob_paaudio.samples;
3918 pa->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift);
3919 pa->rpos = hw->rpos;
3920 if (!pa->pcm_buf) {
3921@@ -342,8 +593,10 @@
3922 g_free (pa->pcm_buf);
3923 pa->pcm_buf = NULL;
3924 fail2:
3925- pa_simple_free (pa->s);
3926- pa->s = NULL;
3927+ if (pa->stream) {
3928+ pa_stream_unref (pa->stream);
3929+ pa->stream = NULL;
3930+ }
3931 fail1:
3932 return -1;
3933 }
3934@@ -361,24 +614,24 @@
3935
3936 obt_as.fmt = pa_to_audfmt (ss.format, &obt_as.endianness);
3937
3938- pa->s = pa_simple_new (
3939- conf.server,
3940+ pa->stream = qpa_simple_new (
3941+ glob_paaudio.server,
3942 "qemu",
3943 PA_STREAM_RECORD,
3944- conf.source,
3945+ glob_paaudio.source,
3946 "pcm.capture",
3947 &ss,
3948 NULL, /* channel map */
3949 NULL, /* buffering attributes */
3950 &error
3951 );
3952- if (!pa->s) {
3953+ if (!pa->stream) {
3954 qpa_logerr (error, "pa_simple_new for capture failed\n");
3955 goto fail1;
3956 }
3957
3958 audio_pcm_init_info (&hw->info, &obt_as);
3959- hw->samples = conf.samples;
3960+ hw->samples = glob_paaudio.samples;
3961 pa->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift);
3962 pa->wpos = hw->wpos;
3963 if (!pa->pcm_buf) {
3964@@ -397,8 +650,10 @@
3965 g_free (pa->pcm_buf);
3966 pa->pcm_buf = NULL;
3967 fail2:
3968- pa_simple_free (pa->s);
3969- pa->s = NULL;
3970+ if (pa->stream) {
3971+ pa_stream_unref (pa->stream);
3972+ pa->stream = NULL;
3973+ }
3974 fail1:
3975 return -1;
3976 }
3977@@ -413,9 +668,9 @@
3978 audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC);
3979 audio_pt_join (&pa->pt, &ret, AUDIO_FUNC);
3980
3981- if (pa->s) {
3982- pa_simple_free (pa->s);
3983- pa->s = NULL;
3984+ if (pa->stream) {
3985+ pa_stream_unref (pa->stream);
3986+ pa->stream = NULL;
3987 }
3988
3989 audio_pt_fini (&pa->pt, AUDIO_FUNC);
3990@@ -433,9 +688,9 @@
3991 audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC);
3992 audio_pt_join (&pa->pt, &ret, AUDIO_FUNC);
3993
3994- if (pa->s) {
3995- pa_simple_free (pa->s);
3996- pa->s = NULL;
3997+ if (pa->stream) {
3998+ pa_stream_unref (pa->stream);
3999+ pa->stream = NULL;
4000 }
4001
4002 audio_pt_fini (&pa->pt, AUDIO_FUNC);
4003@@ -445,52 +700,213 @@
4004
4005 static int qpa_ctl_out (HWVoiceOut *hw, int cmd, ...)
4006 {
4007- (void) hw;
4008- (void) cmd;
4009+ PAVoiceOut *pa = (PAVoiceOut *) hw;
4010+ pa_operation *op;
4011+ pa_cvolume v;
4012+ paaudio *g = &glob_paaudio;
4013+
4014+#ifdef PA_CHECK_VERSION /* macro is present in 0.9.16+ */
4015+ pa_cvolume_init (&v); /* function is present in 0.9.13+ */
4016+#endif
4017+
4018+ switch (cmd) {
4019+ case VOICE_VOLUME:
4020+ {
4021+ SWVoiceOut *sw;
4022+ va_list ap;
4023+
4024+ va_start (ap, cmd);
4025+ sw = va_arg (ap, SWVoiceOut *);
4026+ va_end (ap);
4027+
4028+ v.channels = 2;
4029+ v.values[0] = ((PA_VOLUME_NORM - PA_VOLUME_MUTED) * sw->vol.l) / UINT32_MAX;
4030+ v.values[1] = ((PA_VOLUME_NORM - PA_VOLUME_MUTED) * sw->vol.r) / UINT32_MAX;
4031+
4032+ pa_threaded_mainloop_lock (g->mainloop);
4033+
4034+ op = pa_context_set_sink_input_volume (g->context,
4035+ pa_stream_get_index (pa->stream),
4036+ &v, NULL, NULL);
4037+ if (!op)
4038+ qpa_logerr (pa_context_errno (g->context),
4039+ "set_sink_input_volume() failed\n");
4040+ else
4041+ pa_operation_unref (op);
4042+
4043+ op = pa_context_set_sink_input_mute (g->context,
4044+ pa_stream_get_index (pa->stream),
4045+ sw->vol.mute, NULL, NULL);
4046+ if (!op) {
4047+ qpa_logerr (pa_context_errno (g->context),
4048+ "set_sink_input_mute() failed\n");
4049+ } else {
4050+ pa_operation_unref (op);
4051+ }
4052+
4053+ pa_threaded_mainloop_unlock (g->mainloop);
4054+ }
4055+ }
4056 return 0;
4057 }
4058
4059 static int qpa_ctl_in (HWVoiceIn *hw, int cmd, ...)
4060 {
4061- (void) hw;
4062- (void) cmd;
4063+ PAVoiceIn *pa = (PAVoiceIn *) hw;
4064+ pa_operation *op;
4065+ pa_cvolume v;
4066+ paaudio *g = &glob_paaudio;
4067+
4068+#ifdef PA_CHECK_VERSION
4069+ pa_cvolume_init (&v);
4070+#endif
4071+
4072+ switch (cmd) {
4073+ case VOICE_VOLUME:
4074+ {
4075+ SWVoiceIn *sw;
4076+ va_list ap;
4077+
4078+ va_start (ap, cmd);
4079+ sw = va_arg (ap, SWVoiceIn *);
4080+ va_end (ap);
4081+
4082+ v.channels = 2;
4083+ v.values[0] = ((PA_VOLUME_NORM - PA_VOLUME_MUTED) * sw->vol.l) / UINT32_MAX;
4084+ v.values[1] = ((PA_VOLUME_NORM - PA_VOLUME_MUTED) * sw->vol.r) / UINT32_MAX;
4085+
4086+ pa_threaded_mainloop_lock (g->mainloop);
4087+
4088+ /* FIXME: use the upcoming "set_source_output_{volume,mute}" */
4089+ op = pa_context_set_source_volume_by_index (g->context,
4090+ pa_stream_get_device_index (pa->stream),
4091+ &v, NULL, NULL);
4092+ if (!op) {
4093+ qpa_logerr (pa_context_errno (g->context),
4094+ "set_source_volume() failed\n");
4095+ } else {
4096+ pa_operation_unref(op);
4097+ }
4098+
4099+ op = pa_context_set_source_mute_by_index (g->context,
4100+ pa_stream_get_index (pa->stream),
4101+ sw->vol.mute, NULL, NULL);
4102+ if (!op) {
4103+ qpa_logerr (pa_context_errno (g->context),
4104+ "set_source_mute() failed\n");
4105+ } else {
4106+ pa_operation_unref (op);
4107+ }
4108+
4109+ pa_threaded_mainloop_unlock (g->mainloop);
4110+ }
4111+ }
4112 return 0;
4113 }
4114
4115 /* common */
4116 static void *qpa_audio_init (void)
4117 {
4118- return &conf;
4119+ paaudio *g = &glob_paaudio;
4120+
4121+ g->mainloop = pa_threaded_mainloop_new ();
4122+ if (!g->mainloop) {
4123+ goto fail;
4124+ }
4125+
4126+ g->context = pa_context_new (pa_threaded_mainloop_get_api (g->mainloop), glob_paaudio.server);
4127+ if (!g->context) {
4128+ goto fail;
4129+ }
4130+
4131+ pa_context_set_state_callback (g->context, context_state_cb, g);
4132+
4133+ if (pa_context_connect (g->context, glob_paaudio.server, 0, NULL) < 0) {
4134+ qpa_logerr (pa_context_errno (g->context),
4135+ "pa_context_connect() failed\n");
4136+ goto fail;
4137+ }
4138+
4139+ pa_threaded_mainloop_lock (g->mainloop);
4140+
4141+ if (pa_threaded_mainloop_start (g->mainloop) < 0) {
4142+ goto unlock_and_fail;
4143+ }
4144+
4145+ for (;;) {
4146+ pa_context_state_t state;
4147+
4148+ state = pa_context_get_state (g->context);
4149+
4150+ if (state == PA_CONTEXT_READY) {
4151+ break;
4152+ }
4153+
4154+ if (!PA_CONTEXT_IS_GOOD (state)) {
4155+ qpa_logerr (pa_context_errno (g->context),
4156+ "Wrong context state\n");
4157+ goto unlock_and_fail;
4158+ }
4159+
4160+ /* Wait until the context is ready */
4161+ pa_threaded_mainloop_wait (g->mainloop);
4162+ }
4163+
4164+ pa_threaded_mainloop_unlock (g->mainloop);
4165+
4166+ return &glob_paaudio;
4167+
4168+unlock_and_fail:
4169+ pa_threaded_mainloop_unlock (g->mainloop);
4170+fail:
4171+ AUD_log (AUDIO_CAP, "Failed to initialize PA context");
4172+ return NULL;
4173 }
4174
4175 static void qpa_audio_fini (void *opaque)
4176 {
4177- (void) opaque;
4178+ paaudio *g = opaque;
4179+
4180+ if (g->mainloop) {
4181+ pa_threaded_mainloop_stop (g->mainloop);
4182+ }
4183+
4184+ if (g->context) {
4185+ pa_context_disconnect (g->context);
4186+ pa_context_unref (g->context);
4187+ g->context = NULL;
4188+ }
4189+
4190+ if (g->mainloop) {
4191+ pa_threaded_mainloop_free (g->mainloop);
4192+ }
4193+
4194+ g->mainloop = NULL;
4195 }
4196
4197 struct audio_option qpa_options[] = {
4198 {
4199 .name = "SAMPLES",
4200 .tag = AUD_OPT_INT,
4201- .valp = &conf.samples,
4202+ .valp = &glob_paaudio.samples,
4203 .descr = "buffer size in samples"
4204 },
4205 {
4206 .name = "SERVER",
4207 .tag = AUD_OPT_STR,
4208- .valp = &conf.server,
4209+ .valp = &glob_paaudio.server,
4210 .descr = "server address"
4211 },
4212 {
4213 .name = "SINK",
4214 .tag = AUD_OPT_STR,
4215- .valp = &conf.sink,
4216+ .valp = &glob_paaudio.sink,
4217 .descr = "sink device name"
4218 },
4219 {
4220 .name = "SOURCE",
4221 .tag = AUD_OPT_STR,
4222- .valp = &conf.source,
4223+ .valp = &glob_paaudio.source,
4224 .descr = "source device name"
4225 },
4226 { /* End of list */ }
4227@@ -521,5 +937,6 @@
4228 .max_voices_out = INT_MAX,
4229 .max_voices_in = INT_MAX,
4230 .voice_size_out = sizeof (PAVoiceOut),
4231- .voice_size_in = sizeof (PAVoiceIn)
4232+ .voice_size_in = sizeof (PAVoiceIn),
4233+ .ctl_caps = VOICE_VOLUME_CAP
4234 };
4235
4236=== modified file 'audio/spiceaudio.c'
4237--- audio/spiceaudio.c 2011-05-04 09:19:47 +0000
4238+++ audio/spiceaudio.c 2012-08-21 15:04:54 +0000
4239@@ -202,7 +202,26 @@
4240 }
4241 spice_server_playback_stop (&out->sin);
4242 break;
4243+ case VOICE_VOLUME:
4244+ {
4245+#if ((SPICE_INTERFACE_PLAYBACK_MAJOR >= 1) && (SPICE_INTERFACE_PLAYBACK_MINOR >= 2))
4246+ SWVoiceOut *sw;
4247+ va_list ap;
4248+ uint16_t vol[2];
4249+
4250+ va_start (ap, cmd);
4251+ sw = va_arg (ap, SWVoiceOut *);
4252+ va_end (ap);
4253+
4254+ vol[0] = sw->vol.l / ((1ULL << 16) + 1);
4255+ vol[1] = sw->vol.r / ((1ULL << 16) + 1);
4256+ spice_server_playback_set_volume (&out->sin, 2, vol);
4257+ spice_server_playback_set_mute (&out->sin, sw->vol.mute);
4258+#endif
4259+ break;
4260+ }
4261 }
4262+
4263 return 0;
4264 }
4265
4266@@ -304,7 +323,26 @@
4267 in->active = 0;
4268 spice_server_record_stop (&in->sin);
4269 break;
4270+ case VOICE_VOLUME:
4271+ {
4272+#if ((SPICE_INTERFACE_RECORD_MAJOR >= 2) && (SPICE_INTERFACE_RECORD_MINOR >= 2))
4273+ SWVoiceIn *sw;
4274+ va_list ap;
4275+ uint16_t vol[2];
4276+
4277+ va_start (ap, cmd);
4278+ sw = va_arg (ap, SWVoiceIn *);
4279+ va_end (ap);
4280+
4281+ vol[0] = sw->vol.l / ((1ULL << 16) + 1);
4282+ vol[1] = sw->vol.r / ((1ULL << 16) + 1);
4283+ spice_server_record_set_volume (&in->sin, 2, vol);
4284+ spice_server_record_set_mute (&in->sin, sw->vol.mute);
4285+#endif
4286+ break;
4287+ }
4288 }
4289+
4290 return 0;
4291 }
4292
4293@@ -337,6 +375,9 @@
4294 .max_voices_in = 1,
4295 .voice_size_out = sizeof (SpiceVoiceOut),
4296 .voice_size_in = sizeof (SpiceVoiceIn),
4297+#if ((SPICE_INTERFACE_PLAYBACK_MAJOR >= 1) && (SPICE_INTERFACE_PLAYBACK_MINOR >= 2))
4298+ .ctl_caps = VOICE_VOLUME_CAP
4299+#endif
4300 };
4301
4302 void qemu_spice_audio_init (void)
4303
4304=== modified file 'audio/winwaveaudio.c'
4305--- audio/winwaveaudio.c 2011-10-28 17:37:30 +0000
4306+++ audio/winwaveaudio.c 2012-08-21 15:04:54 +0000
4307@@ -72,7 +72,7 @@
4308 break;
4309
4310 case MMSYSERR_NOMEM:
4311- str = "Unable to allocate or locl memory";
4312+ str = "Unable to allocate or lock memory";
4313 break;
4314
4315 case WAVERR_SYNC:
4316
4317=== modified file 'balloon.c'
4318--- balloon.c 2012-02-02 14:25:28 +0000
4319+++ balloon.c 2012-08-21 15:04:54 +0000
4320@@ -30,6 +30,7 @@
4321 #include "balloon.h"
4322 #include "trace.h"
4323 #include "qmp-commands.h"
4324+#include "qjson.h"
4325
4326 static QEMUBalloonEvent *balloon_event_fn;
4327 static QEMUBalloonStatus *balloon_stat_fn;
4328@@ -80,6 +81,19 @@
4329 return 1;
4330 }
4331
4332+void qemu_balloon_changed(int64_t actual)
4333+{
4334+ QObject *data;
4335+
4336+ data = qobject_from_jsonf("{ 'actual': %" PRId64 " }",
4337+ actual);
4338+
4339+ monitor_protocol_event(QEVENT_BALLOON_CHANGE, data);
4340+
4341+ qobject_decref(data);
4342+}
4343+
4344+
4345 BalloonInfo *qmp_query_balloon(Error **errp)
4346 {
4347 BalloonInfo *info;
4348@@ -108,7 +122,7 @@
4349 }
4350
4351 if (value <= 0) {
4352- qerror_report(QERR_INVALID_PARAMETER_VALUE, "target", "a size");
4353+ error_set(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size");
4354 return;
4355 }
4356
4357
4358=== modified file 'balloon.h'
4359--- balloon.h 2012-02-02 14:25:28 +0000
4360+++ balloon.h 2012-08-21 15:04:54 +0000
4361@@ -24,4 +24,6 @@
4362 QEMUBalloonStatus *stat_func, void *opaque);
4363 void qemu_remove_balloon_handler(void *opaque);
4364
4365+void qemu_balloon_changed(int64_t actual);
4366+
4367 #endif
4368
4369=== modified file 'bitops.h'
4370--- bitops.h 2011-09-26 15:07:14 +0000
4371+++ bitops.h 2012-08-21 15:04:54 +0000
4372@@ -114,10 +114,10 @@
4373 * @nr: the bit to set
4374 * @addr: the address to start counting from
4375 */
4376-static inline void set_bit(int nr, volatile unsigned long *addr)
4377+static inline void set_bit(int nr, unsigned long *addr)
4378 {
4379 unsigned long mask = BIT_MASK(nr);
4380- unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
4381+ unsigned long *p = addr + BIT_WORD(nr);
4382
4383 *p |= mask;
4384 }
4385@@ -127,10 +127,10 @@
4386 * @nr: Bit to clear
4387 * @addr: Address to start counting from
4388 */
4389-static inline void clear_bit(int nr, volatile unsigned long *addr)
4390+static inline void clear_bit(int nr, unsigned long *addr)
4391 {
4392 unsigned long mask = BIT_MASK(nr);
4393- unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
4394+ unsigned long *p = addr + BIT_WORD(nr);
4395
4396 *p &= ~mask;
4397 }
4398@@ -140,10 +140,10 @@
4399 * @nr: Bit to change
4400 * @addr: Address to start counting from
4401 */
4402-static inline void change_bit(int nr, volatile unsigned long *addr)
4403+static inline void change_bit(int nr, unsigned long *addr)
4404 {
4405 unsigned long mask = BIT_MASK(nr);
4406- unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
4407+ unsigned long *p = addr + BIT_WORD(nr);
4408
4409 *p ^= mask;
4410 }
4411@@ -153,10 +153,10 @@
4412 * @nr: Bit to set
4413 * @addr: Address to count from
4414 */
4415-static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
4416+static inline int test_and_set_bit(int nr, unsigned long *addr)
4417 {
4418 unsigned long mask = BIT_MASK(nr);
4419- unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
4420+ unsigned long *p = addr + BIT_WORD(nr);
4421 unsigned long old = *p;
4422
4423 *p = old | mask;
4424@@ -168,10 +168,10 @@
4425 * @nr: Bit to clear
4426 * @addr: Address to count from
4427 */
4428-static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
4429+static inline int test_and_clear_bit(int nr, unsigned long *addr)
4430 {
4431 unsigned long mask = BIT_MASK(nr);
4432- unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
4433+ unsigned long *p = addr + BIT_WORD(nr);
4434 unsigned long old = *p;
4435
4436 *p = old & ~mask;
4437@@ -183,10 +183,10 @@
4438 * @nr: Bit to change
4439 * @addr: Address to count from
4440 */
4441-static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
4442+static inline int test_and_change_bit(int nr, unsigned long *addr)
4443 {
4444 unsigned long mask = BIT_MASK(nr);
4445- unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
4446+ unsigned long *p = addr + BIT_WORD(nr);
4447 unsigned long old = *p;
4448
4449 *p = old ^ mask;
4450@@ -198,7 +198,7 @@
4451 * @nr: bit number to test
4452 * @addr: Address to start counting from
4453 */
4454-static inline int test_bit(int nr, const volatile unsigned long *addr)
4455+static inline int test_bit(int nr, const unsigned long *addr)
4456 {
4457 return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
4458 }
4459@@ -269,4 +269,94 @@
4460 return count;
4461 }
4462
4463+/**
4464+ * extract32:
4465+ * @value: the value to extract the bit field from
4466+ * @start: the lowest bit in the bit field (numbered from 0)
4467+ * @length: the length of the bit field
4468+ *
4469+ * Extract from the 32 bit input @value the bit field specified by the
4470+ * @start and @length parameters, and return it. The bit field must
4471+ * lie entirely within the 32 bit word. It is valid to request that
4472+ * all 32 bits are returned (ie @length 32 and @start 0).
4473+ *
4474+ * Returns: the value of the bit field extracted from the input value.
4475+ */
4476+static inline uint32_t extract32(uint32_t value, int start, int length)
4477+{
4478+ assert(start >= 0 && length > 0 && length <= 32 - start);
4479+ return (value >> start) & (~0U >> (32 - length));
4480+}
4481+
4482+/**
4483+ * extract64:
4484+ * @value: the value to extract the bit field from
4485+ * @start: the lowest bit in the bit field (numbered from 0)
4486+ * @length: the length of the bit field
4487+ *
4488+ * Extract from the 64 bit input @value the bit field specified by the
4489+ * @start and @length parameters, and return it. The bit field must
4490+ * lie entirely within the 64 bit word. It is valid to request that
4491+ * all 64 bits are returned (ie @length 64 and @start 0).
4492+ *
4493+ * Returns: the value of the bit field extracted from the input value.
4494+ */
4495+static inline uint64_t extract64(uint64_t value, int start, int length)
4496+{
4497+ assert(start >= 0 && length > 0 && length <= 64 - start);
4498+ return (value >> start) & (~0ULL >> (64 - length));
4499+}
4500+
4501+/**
4502+ * deposit32:
4503+ * @value: initial value to insert bit field into
4504+ * @start: the lowest bit in the bit field (numbered from 0)
4505+ * @length: the length of the bit field
4506+ * @fieldval: the value to insert into the bit field
4507+ *
4508+ * Deposit @fieldval into the 32 bit @value at the bit field specified
4509+ * by the @start and @length parameters, and return the modified
4510+ * @value. Bits of @value outside the bit field are not modified.
4511+ * Bits of @fieldval above the least significant @length bits are
4512+ * ignored. The bit field must lie entirely within the 32 bit word.
4513+ * It is valid to request that all 32 bits are modified (ie @length
4514+ * 32 and @start 0).
4515+ *
4516+ * Returns: the modified @value.
4517+ */
4518+static inline uint32_t deposit32(uint32_t value, int start, int length,
4519+ uint32_t fieldval)
4520+{
4521+ uint32_t mask;
4522+ assert(start >= 0 && length > 0 && length <= 32 - start);
4523+ mask = (~0U >> (32 - length)) << start;
4524+ return (value & ~mask) | ((fieldval << start) & mask);
4525+}
4526+
4527+/**
4528+ * deposit64:
4529+ * @value: initial value to insert bit field into
4530+ * @start: the lowest bit in the bit field (numbered from 0)
4531+ * @length: the length of the bit field
4532+ * @fieldval: the value to insert into the bit field
4533+ *
4534+ * Deposit @fieldval into the 64 bit @value at the bit field specified
4535+ * by the @start and @length parameters, and return the modified
4536+ * @value. Bits of @value outside the bit field are not modified.
4537+ * Bits of @fieldval above the least significant @length bits are
4538+ * ignored. The bit field must lie entirely within the 64 bit word.
4539+ * It is valid to request that all 64 bits are modified (ie @length
4540+ * 64 and @start 0).
4541+ *
4542+ * Returns: the modified @value.
4543+ */
4544+static inline uint64_t deposit64(uint64_t value, int start, int length,
4545+ uint64_t fieldval)
4546+{
4547+ uint64_t mask;
4548+ assert(start >= 0 && length > 0 && length <= 64 - start);
4549+ mask = (~0ULL >> (64 - length)) << start;
4550+ return (value & ~mask) | ((fieldval << start) & mask);
4551+}
4552+
4553 #endif
4554
4555=== modified file 'block-migration.c'
4556--- block-migration.c 2012-02-20 17:32:06 +0000
4557+++ block-migration.c 2012-08-21 15:04:54 +0000
4558@@ -18,7 +18,6 @@
4559 #include "hw/hw.h"
4560 #include "qemu-queue.h"
4561 #include "qemu-timer.h"
4562-#include "monitor.h"
4563 #include "block-migration.h"
4564 #include "migration.h"
4565 #include "blockdev.h"
4566@@ -204,8 +203,7 @@
4567 assert(block_mig_state.submitted >= 0);
4568 }
4569
4570-static int mig_save_device_bulk(Monitor *mon, QEMUFile *f,
4571- BlkMigDevState *bmds)
4572+static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState *bmds)
4573 {
4574 int64_t total_sectors = bmds->total_sectors;
4575 int64_t cur_sector = bmds->cur_sector;
4576@@ -272,7 +270,6 @@
4577
4578 static void init_blk_migration_it(void *opaque, BlockDriverState *bs)
4579 {
4580- Monitor *mon = opaque;
4581 BlkMigDevState *bmds;
4582 int64_t sectors;
4583
4584@@ -295,19 +292,17 @@
4585 block_mig_state.total_sector_sum += sectors;
4586
4587 if (bmds->shared_base) {
4588- monitor_printf(mon, "Start migration for %s with shared base "
4589- "image\n",
4590- bs->device_name);
4591+ DPRINTF("Start migration for %s with shared base image\n",
4592+ bs->device_name);
4593 } else {
4594- monitor_printf(mon, "Start full migration for %s\n",
4595- bs->device_name);
4596+ DPRINTF("Start full migration for %s\n", bs->device_name);
4597 }
4598
4599 QSIMPLEQ_INSERT_TAIL(&block_mig_state.bmds_list, bmds, entry);
4600 }
4601 }
4602
4603-static void init_blk_migration(Monitor *mon, QEMUFile *f)
4604+static void init_blk_migration(QEMUFile *f)
4605 {
4606 block_mig_state.submitted = 0;
4607 block_mig_state.read_done = 0;
4608@@ -318,10 +313,10 @@
4609 block_mig_state.total_time = 0;
4610 block_mig_state.reads = 0;
4611
4612- bdrv_iterate(init_blk_migration_it, mon);
4613+ bdrv_iterate(init_blk_migration_it, NULL);
4614 }
4615
4616-static int blk_mig_save_bulked_block(Monitor *mon, QEMUFile *f)
4617+static int blk_mig_save_bulked_block(QEMUFile *f)
4618 {
4619 int64_t completed_sector_sum = 0;
4620 BlkMigDevState *bmds;
4621@@ -330,7 +325,7 @@
4622
4623 QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
4624 if (bmds->bulk_completed == 0) {
4625- if (mig_save_device_bulk(mon, f, bmds) == 1) {
4626+ if (mig_save_device_bulk(f, bmds) == 1) {
4627 /* completed bulk section for this device */
4628 bmds->bulk_completed = 1;
4629 }
4630@@ -352,8 +347,7 @@
4631 block_mig_state.prev_progress = progress;
4632 qemu_put_be64(f, (progress << BDRV_SECTOR_BITS)
4633 | BLK_MIG_FLAG_PROGRESS);
4634- monitor_printf(mon, "Completed %d %%\r", progress);
4635- monitor_flush(mon);
4636+ DPRINTF("Completed %d %%\r", progress);
4637 }
4638
4639 return ret;
4640@@ -368,8 +362,8 @@
4641 }
4642 }
4643
4644-static int mig_save_device_dirty(Monitor *mon, QEMUFile *f,
4645- BlkMigDevState *bmds, int is_async)
4646+static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds,
4647+ int is_async)
4648 {
4649 BlkMigBlock *blk;
4650 int64_t total_sectors = bmds->total_sectors;
4651@@ -428,20 +422,20 @@
4652 return (bmds->cur_dirty >= bmds->total_sectors);
4653
4654 error:
4655- monitor_printf(mon, "Error reading sector %" PRId64 "\n", sector);
4656+ DPRINTF("Error reading sector %" PRId64 "\n", sector);
4657 qemu_file_set_error(f, ret);
4658 g_free(blk->buf);
4659 g_free(blk);
4660 return 0;
4661 }
4662
4663-static int blk_mig_save_dirty_block(Monitor *mon, QEMUFile *f, int is_async)
4664+static int blk_mig_save_dirty_block(QEMUFile *f, int is_async)
4665 {
4666 BlkMigDevState *bmds;
4667 int ret = 0;
4668
4669 QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
4670- if (mig_save_device_dirty(mon, f, bmds, is_async) == 0) {
4671+ if (mig_save_device_dirty(f, bmds, is_async) == 0) {
4672 ret = 1;
4673 break;
4674 }
4675@@ -520,7 +514,7 @@
4676 return 0;
4677 }
4678
4679-static void blk_mig_cleanup(Monitor *mon)
4680+static void blk_mig_cleanup(void)
4681 {
4682 BlkMigDevState *bmds;
4683 BlkMigBlock *blk;
4684@@ -540,95 +534,127 @@
4685 g_free(blk->buf);
4686 g_free(blk);
4687 }
4688-
4689- monitor_printf(mon, "\n");
4690-}
4691-
4692-static int block_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
4693-{
4694- int ret;
4695-
4696- DPRINTF("Enter save live stage %d submitted %d transferred %d\n",
4697- stage, block_mig_state.submitted, block_mig_state.transferred);
4698-
4699- if (stage < 0) {
4700- blk_mig_cleanup(mon);
4701- return 0;
4702- }
4703-
4704- if (block_mig_state.blk_enable != 1) {
4705- /* no need to migrate storage */
4706- qemu_put_be64(f, BLK_MIG_FLAG_EOS);
4707- return 1;
4708- }
4709-
4710- if (stage == 1) {
4711- init_blk_migration(mon, f);
4712-
4713- /* start track dirty blocks */
4714- set_dirty_tracking(1);
4715- }
4716-
4717- flush_blks(f);
4718-
4719- ret = qemu_file_get_error(f);
4720- if (ret) {
4721- blk_mig_cleanup(mon);
4722- return ret;
4723- }
4724-
4725- blk_mig_reset_dirty_cursor();
4726-
4727- if (stage == 2) {
4728- /* control the rate of transfer */
4729- while ((block_mig_state.submitted +
4730- block_mig_state.read_done) * BLOCK_SIZE <
4731- qemu_file_get_rate_limit(f)) {
4732- if (block_mig_state.bulk_completed == 0) {
4733- /* first finish the bulk phase */
4734- if (blk_mig_save_bulked_block(mon, f) == 0) {
4735- /* finished saving bulk on all devices */
4736- block_mig_state.bulk_completed = 1;
4737- }
4738- } else {
4739- if (blk_mig_save_dirty_block(mon, f, 1) == 0) {
4740- /* no more dirty blocks */
4741- break;
4742- }
4743- }
4744- }
4745-
4746- flush_blks(f);
4747-
4748- ret = qemu_file_get_error(f);
4749- if (ret) {
4750- blk_mig_cleanup(mon);
4751- return ret;
4752- }
4753- }
4754-
4755- if (stage == 3) {
4756- /* we know for sure that save bulk is completed and
4757- all async read completed */
4758- assert(block_mig_state.submitted == 0);
4759-
4760- while (blk_mig_save_dirty_block(mon, f, 0) != 0);
4761- blk_mig_cleanup(mon);
4762-
4763- /* report completion */
4764- qemu_put_be64(f, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS);
4765-
4766- ret = qemu_file_get_error(f);
4767- if (ret) {
4768- return ret;
4769- }
4770-
4771- monitor_printf(mon, "Block migration completed\n");
4772- }
4773-
4774- qemu_put_be64(f, BLK_MIG_FLAG_EOS);
4775-
4776- return ((stage == 2) && is_stage2_completed());
4777+}
4778+
4779+static void block_migration_cancel(void *opaque)
4780+{
4781+ blk_mig_cleanup();
4782+}
4783+
4784+static int block_save_setup(QEMUFile *f, void *opaque)
4785+{
4786+ int ret;
4787+
4788+ DPRINTF("Enter save live setup submitted %d transferred %d\n",
4789+ block_mig_state.submitted, block_mig_state.transferred);
4790+
4791+ init_blk_migration(f);
4792+
4793+ /* start track dirty blocks */
4794+ set_dirty_tracking(1);
4795+
4796+ flush_blks(f);
4797+
4798+ ret = qemu_file_get_error(f);
4799+ if (ret) {
4800+ blk_mig_cleanup();
4801+ return ret;
4802+ }
4803+
4804+ blk_mig_reset_dirty_cursor();
4805+
4806+ qemu_put_be64(f, BLK_MIG_FLAG_EOS);
4807+
4808+ return 0;
4809+}
4810+
4811+static int block_save_iterate(QEMUFile *f, void *opaque)
4812+{
4813+ int ret;
4814+
4815+ DPRINTF("Enter save live iterate submitted %d transferred %d\n",
4816+ block_mig_state.submitted, block_mig_state.transferred);
4817+
4818+ flush_blks(f);
4819+
4820+ ret = qemu_file_get_error(f);
4821+ if (ret) {
4822+ blk_mig_cleanup();
4823+ return ret;
4824+ }
4825+
4826+ blk_mig_reset_dirty_cursor();
4827+
4828+ /* control the rate of transfer */
4829+ while ((block_mig_state.submitted +
4830+ block_mig_state.read_done) * BLOCK_SIZE <
4831+ qemu_file_get_rate_limit(f)) {
4832+ if (block_mig_state.bulk_completed == 0) {
4833+ /* first finish the bulk phase */
4834+ if (blk_mig_save_bulked_block(f) == 0) {
4835+ /* finished saving bulk on all devices */
4836+ block_mig_state.bulk_completed = 1;
4837+ }
4838+ } else {
4839+ if (blk_mig_save_dirty_block(f, 1) == 0) {
4840+ /* no more dirty blocks */
4841+ break;
4842+ }
4843+ }
4844+ }
4845+
4846+ flush_blks(f);
4847+
4848+ ret = qemu_file_get_error(f);
4849+ if (ret) {
4850+ blk_mig_cleanup();
4851+ return ret;
4852+ }
4853+
4854+ qemu_put_be64(f, BLK_MIG_FLAG_EOS);
4855+
4856+ return is_stage2_completed();
4857+}
4858+
4859+static int block_save_complete(QEMUFile *f, void *opaque)
4860+{
4861+ int ret;
4862+
4863+ DPRINTF("Enter save live complete submitted %d transferred %d\n",
4864+ block_mig_state.submitted, block_mig_state.transferred);
4865+
4866+ flush_blks(f);
4867+
4868+ ret = qemu_file_get_error(f);
4869+ if (ret) {
4870+ blk_mig_cleanup();
4871+ return ret;
4872+ }
4873+
4874+ blk_mig_reset_dirty_cursor();
4875+
4876+ /* we know for sure that save bulk is completed and
4877+ all async read completed */
4878+ assert(block_mig_state.submitted == 0);
4879+
4880+ while (blk_mig_save_dirty_block(f, 0) != 0) {
4881+ /* Do nothing */
4882+ }
4883+ blk_mig_cleanup();
4884+
4885+ /* report completion */
4886+ qemu_put_be64(f, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS);
4887+
4888+ ret = qemu_file_get_error(f);
4889+ if (ret) {
4890+ return ret;
4891+ }
4892+
4893+ DPRINTF("Block migration completed\n");
4894+
4895+ qemu_put_be64(f, BLK_MIG_FLAG_EOS);
4896+
4897+ return 0;
4898 }
4899
4900 static int block_load(QEMUFile *f, void *opaque, int version_id)
4901@@ -708,20 +734,35 @@
4902 return 0;
4903 }
4904
4905-static void block_set_params(int blk_enable, int shared_base, void *opaque)
4906+static void block_set_params(const MigrationParams *params, void *opaque)
4907 {
4908- block_mig_state.blk_enable = blk_enable;
4909- block_mig_state.shared_base = shared_base;
4910+ block_mig_state.blk_enable = params->blk;
4911+ block_mig_state.shared_base = params->shared;
4912
4913 /* shared base means that blk_enable = 1 */
4914- block_mig_state.blk_enable |= shared_base;
4915-}
4916+ block_mig_state.blk_enable |= params->shared;
4917+}
4918+
4919+static bool block_is_active(void *opaque)
4920+{
4921+ return block_mig_state.blk_enable == 1;
4922+}
4923+
4924+SaveVMHandlers savevm_block_handlers = {
4925+ .set_params = block_set_params,
4926+ .save_live_setup = block_save_setup,
4927+ .save_live_iterate = block_save_iterate,
4928+ .save_live_complete = block_save_complete,
4929+ .load_state = block_load,
4930+ .cancel = block_migration_cancel,
4931+ .is_active = block_is_active,
4932+};
4933
4934 void blk_mig_init(void)
4935 {
4936 QSIMPLEQ_INIT(&block_mig_state.bmds_list);
4937 QSIMPLEQ_INIT(&block_mig_state.blk_list);
4938
4939- register_savevm_live(NULL, "block", 0, 1, block_set_params,
4940- block_save_live, NULL, block_load, &block_mig_state);
4941+ register_savevm_live(NULL, "block", 0, 1, &savevm_block_handlers,
4942+ &block_mig_state);
4943 }
4944
4945=== modified file 'block.c'
4946--- block.c 2012-03-15 16:18:18 +0000
4947+++ block.c 2012-08-21 15:04:54 +0000
4948@@ -80,6 +80,8 @@
4949 void *opaque,
4950 bool is_write);
4951 static void coroutine_fn bdrv_co_do_rw(void *opaque);
4952+static int coroutine_fn bdrv_co_do_write_zeroes(BlockDriverState *bs,
4953+ int64_t sector_num, int nb_sectors);
4954
4955 static bool bdrv_exceed_bps_limits(BlockDriverState *bs, int nb_sectors,
4956 bool is_write, double elapsed_time, uint64_t *wait);
4957@@ -196,33 +198,31 @@
4958 /* check if the path starts with "<protocol>:" */
4959 static int path_has_protocol(const char *path)
4960 {
4961+ const char *p;
4962+
4963 #ifdef _WIN32
4964 if (is_windows_drive(path) ||
4965 is_windows_drive_prefix(path)) {
4966 return 0;
4967 }
4968+ p = path + strcspn(path, ":/\\");
4969+#else
4970+ p = path + strcspn(path, ":/");
4971 #endif
4972
4973- return strchr(path, ':') != NULL;
4974+ return *p == ':';
4975 }
4976
4977 int path_is_absolute(const char *path)
4978 {
4979- const char *p;
4980 #ifdef _WIN32
4981 /* specific case for names like: "\\.\d:" */
4982- if (*path == '/' || *path == '\\')
4983+ if (is_windows_drive(path) || is_windows_drive_prefix(path)) {
4984 return 1;
4985-#endif
4986- p = strchr(path, ':');
4987- if (p)
4988- p++;
4989- else
4990- p = path;
4991-#ifdef _WIN32
4992- return (*p == '/' || *p == '\\');
4993+ }
4994+ return (*path == '/' || *path == '\\');
4995 #else
4996- return (*p == '/');
4997+ return (*path == '/');
4998 #endif
4999 }
5000
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: