[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [qemu-xen master] Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20161013' into staging
=== This changeset includes merge from high-traffic branch === Commits on that branch are not reported individually. commit c9662023ab97cd163bb5525bf5007422fdff7983 Merge: c264a8807299852fc45562768ae60ccc886cea91 2e68f28854f0120c9a938a61b64aaf1eaecb162b Author: Peter Maydell <peter.maydell@xxxxxxxxxx> AuthorDate: Thu Oct 13 11:48:01 2016 +0100 Commit: Peter Maydell <peter.maydell@xxxxxxxxxx> CommitDate: Thu Oct 13 11:48:01 2016 +0100 Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20161013' into staging [stable] ppc-for-2.7 queue # gpg: Signature made Thu 13 Oct 2016 06:03:37 BST # gpg: using RSA key 0x6C38CACA20D9B392 # gpg: Good signature from "David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>" # gpg: aka "David Gibson (Red Hat) <dgibson@xxxxxxxxxx>" # gpg: aka "David Gibson (ozlabs.org) <dgibson@xxxxxxxxxx>" # gpg: aka "David Gibson (kernel.org) <dwg@xxxxxxxxxx>" # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dgibson/tags/ppc-for-2.7-20161013: ppc: Check the availability of transactional memory hw/ppc/spapr: Fix the selection of the processor features hw/ppc/spapr: Move code related to "ibm,pa-features" to a separate function linux-headers: update Signed-off-by: Peter Maydell <peter.maydell@xxxxxxxxxx> .gitignore | 6 +- .travis.yml | 45 + CODING_STYLE | 2 +- MAINTAINERS | 155 +- Makefile | 135 +- Makefile.objs | 4 +- Makefile.target | 27 +- README | 2 - VERSION | 2 +- aio-posix.c | 12 +- arch_init.c | 19 - async.c | 27 +- backends/msmouse.c | 4 +- backends/rng-egd.c | 4 +- block.c | 229 +- block/Makefile.objs | 12 +- block/archipelago.c | 5 +- block/backup.c | 71 +- block/blkdebug.c | 7 +- block/blkreplay.c | 15 +- block/blkverify.c | 8 +- block/block-backend.c | 182 +- block/commit.c | 11 +- block/crypto.c | 6 + block/curl.c | 32 +- block/dmg-bz2.c | 61 + block/dmg.c | 69 +- block/dmg.h | 59 + block/gluster.c | 48 +- block/io.c | 84 +- block/iscsi.c | 58 +- block/linux-aio.c | 181 +- block/mirror.c | 13 +- block/nfs.c | 7 +- block/null.c | 5 +- block/qcow.c | 113 +- block/qcow2-cluster.c | 6 +- block/qcow2.c | 133 +- block/qcow2.h | 1 - block/qed.c | 6 +- block/qed.h | 1 - block/raw-posix.c | 44 +- block/raw-win32.c | 56 +- block/rbd.c | 8 +- block/replication.c | 659 +++ block/sheepdog.c | 4 +- block/vdi.c | 73 +- block/vhdx-endian.c | 3 - block/vhdx.c | 9 +- block/vmdk.c | 55 +- block/vpc.c | 10 +- block/vvfat.c | 3 +- block/write-threshold.c | 3 +- blockdev-nbd.c | 21 +- blockdev.c | 801 +-- blockjob.c | 11 +- bsd-user/main.c | 45 +- configure | 241 +- cpu-exec.c | 128 +- cpus-common.c | 352 ++ cpus.c | 128 +- cputlb.c | 6 +- crypto/block-luks.c | 104 +- crypto/block.c | 6 +- crypto/cipher-builtin.c | 9 +- crypto/cipher-gcrypt.c | 12 +- crypto/cipher-nettle.c | 26 +- crypto/init.c | 3 +- crypto/pbkdf-gcrypt.c | 21 +- crypto/pbkdf-nettle.c | 71 +- crypto/pbkdf-stub.c | 2 +- crypto/pbkdf.c | 35 +- crypto/tlscredsx509.c | 6 +- crypto/tlssession.c | 10 +- crypto/trace-events | 1 + default-configs/arm-softmmu.mak | 3 +- default-configs/i386-softmmu.mak | 2 - default-configs/ppc-softmmu.mak | 1 - default-configs/ppc64-softmmu.mak | 1 - default-configs/sparc64-softmmu.mak | 1 - default-configs/x86_64-softmmu.mak | 2 - disas.c | 2 - disas/Makefile.objs | 1 - disas/arm.c | 11 - disas/hppa.c | 2832 --------- disas/sh4.c | 6 - docs/block-replication.txt | 239 + docs/colo-proxy.txt | 188 + docs/generic-loader.txt | 84 + docs/qapi-code-gen.txt | 6 +- docs/qmp-commands.txt | 3805 ++++++++++++ docs/qmp-events.txt | 14 +- docs/rcu.txt | 2 +- docs/specs/edu.txt | 7 +- docs/tcg-exclusive.promela | 225 + docs/throttle.txt | 5 +- docs/tracing.txt | 12 + docs/writing-qmp-commands.txt | 50 +- docs/xen-save-devices-state.txt | 2 +- exec.c | 43 +- fpu/softfloat.c | 116 +- fsdev/9p-marshal.c | 5 - fsdev/9p-marshal.h | 1 - gdbstub.c | 4 +- hmp-commands-info.hx | 127 +- hmp-commands.hx | 216 +- hmp.c | 124 +- hmp.h | 2 + hw/9pfs/9p-local.c | 7 +- hw/9pfs/9p-proxy.c | 75 +- hw/9pfs/9p.c | 32 +- hw/9pfs/9p.h | 1 + hw/9pfs/virtio-9p-device.c | 45 +- hw/Makefile.objs | 1 + hw/acpi/aml-build.c | 2 +- hw/acpi/cpu.c | 12 + hw/adc/Makefile.objs | 1 + hw/adc/stm32f2xx_adc.c | 306 + hw/arm/Makefile.objs | 2 +- hw/arm/aspeed.c | 197 + hw/arm/aspeed_soc.c | 254 + hw/arm/ast2400.c | 214 - hw/arm/integratorcp.c | 35 +- hw/arm/mainstone.c | 5 +- hw/arm/musicpal.c | 2 +- hw/arm/nseries.c | 3 +- hw/arm/omap2.c | 8 +- hw/arm/palmetto-bmc.c | 102 - hw/arm/pxa2xx.c | 4 +- hw/arm/stm32f205_soc.c | 92 +- hw/arm/strongarm.c | 4 +- hw/arm/sysbus-fdt.c | 4 +- hw/arm/virt-acpi-build.c | 20 +- hw/arm/virt.c | 73 +- hw/arm/xlnx-zynqmp.c | 2 + hw/audio/gus.c | 9 +- hw/audio/pcspk.c | 17 +- hw/audio/sb16.c | 4 +- hw/block/fdc.c | 4 +- hw/block/m25p80.c | 29 +- hw/block/virtio-blk.c | 76 +- hw/block/xen_disk.c | 173 +- hw/bt/hci-csr.c | 2 +- hw/bt/hci.c | 2 +- hw/char/bcm2835_aux.c | 4 +- hw/char/debugcon.c | 4 +- hw/char/digic-uart.c | 2 + hw/char/escc.c | 4 +- hw/char/etraxfs_ser.c | 4 +- hw/char/exynos4210_uart.c | 4 +- hw/char/grlib_apbuart.c | 4 +- hw/char/imx_serial.c | 4 +- hw/char/ipoctal232.c | 4 +- hw/char/lm32_juart.c | 2 + hw/char/lm32_uart.c | 2 + hw/char/mcf_uart.c | 4 +- hw/char/parallel.c | 7 +- hw/char/pl011.c | 4 +- hw/char/sclpconsole-lm.c | 25 +- hw/char/sclpconsole.c | 2 + hw/char/sh_serial.c | 4 +- hw/char/spapr_vty.c | 5 +- hw/char/stm32f2xx_usart.c | 2 + hw/char/virtio-console.c | 21 + hw/char/virtio-serial-bus.c | 79 +- hw/char/xilinx_uartlite.c | 4 +- hw/core/Makefile.objs | 3 + hw/core/bus.c | 21 +- hw/core/generic-loader.c | 211 + hw/core/loader.c | 89 +- hw/core/machine.c | 3 +- hw/core/or-irq.c | 107 + hw/core/platform-bus.c | 8 +- hw/core/ptimer.c | 14 +- hw/display/ssd0323.c | 102 +- hw/display/vga-isa.c | 8 +- hw/display/virtio-gpu-pci.c | 1 + hw/display/virtio-gpu.c | 39 +- hw/display/virtio-vga.c | 15 +- hw/display/vmware_vga.c | 12 +- hw/dma/i8257.c | 8 +- hw/dma/omap_dma.c | 2 +- hw/dma/rc4030.c | 81 +- hw/dma/xilinx_axidma.c | 2 +- hw/i386/Makefile.objs | 1 + hw/i386/acpi-build.c | 87 +- hw/i386/amd_iommu.c | 1212 ++++ hw/i386/amd_iommu.h | 289 + hw/i386/intel_iommu.c | 31 +- hw/i386/kvm/apic.c | 31 +- hw/i386/kvm/i8259.c | 2 +- hw/i386/kvmvapic.c | 7 +- hw/i386/pc.c | 35 +- hw/i386/pc_piix.c | 33 +- hw/i386/pc_q35.c | 28 +- hw/i386/trace-events | 33 +- hw/i386/x86-iommu.c | 6 + hw/i386/xen/xen_platform.c | 2 - hw/ide/ahci.c | 1 + hw/ide/core.c | 10 +- hw/ide/piix.c | 4 + hw/ide/qdev.c | 31 +- hw/input/adb.c | 229 +- hw/input/pckbd.c | 4 +- hw/input/ps2.c | 612 +- hw/input/tsc2005.c | 190 +- hw/input/tsc210x.c | 227 +- hw/input/virtio-input.c | 21 +- hw/intc/Makefile.objs | 3 + hw/intc/apic.c | 26 +- hw/intc/arm_gic_kvm.c | 12 + hw/intc/arm_gicv3_its_common.c | 148 + hw/intc/arm_gicv3_its_kvm.c | 121 + hw/intc/arm_gicv3_kvm.c | 13 + hw/intc/i8259.c | 73 +- hw/intc/i8259_common.c | 5 +- hw/intc/intc.c | 41 + hw/intc/ioapic.c | 2 +- hw/intc/lm32_pic.c | 63 +- hw/intc/s390_flic_kvm.c | 42 +- hw/intc/slavio_intctl.c | 67 +- hw/intc/xics.c | 7 +- hw/intc/xics_kvm.c | 20 +- hw/ipmi/ipmi_bmc_extern.c | 17 +- hw/ipmi/ipmi_bmc_sim.c | 2 +- hw/isa/isa-bus.c | 14 +- hw/m68k/mcf5206.c | 2 +- hw/m68k/mcf5208.c | 4 +- hw/mem/trace-events | 5 + hw/misc/Makefile.objs | 2 +- hw/misc/aspeed_scu.c | 45 +- hw/misc/aspeed_sdmc.c | 280 + hw/misc/edu.c | 18 +- hw/misc/imx25_ccm.c | 2 +- hw/misc/imx31_ccm.c | 2 +- hw/misc/imx6_ccm.c | 4 +- hw/misc/imx6_src.c | 2 +- hw/misc/ivshmem.c | 1 - hw/misc/macio/macio.c | 26 +- hw/net/cadence_gem.c | 557 +- hw/net/e1000e.c | 2 +- hw/net/e1000e_core.c | 34 +- hw/net/e1000e_core.h | 3 + hw/net/fsl_etsec/etsec.c | 2 +- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 2 +- hw/net/mcf_fec.c | 7 +- hw/net/spapr_llan.c | 91 +- hw/net/trace-events | 18 +- hw/net/virtio-net.c | 126 +- hw/nvram/fw_cfg.c | 6 +- hw/ppc/Makefile.objs | 2 +- hw/ppc/e500.c | 4 +- hw/ppc/fdt.c | 49 + hw/ppc/ppc405.h | 6 - hw/ppc/ppce500_spin.c | 31 +- hw/ppc/spapr.c | 113 +- hw/ppc/spapr_cpu_core.c | 118 +- hw/ppc/spapr_drc.c | 62 +- hw/ppc/spapr_events.c | 11 +- hw/ppc/spapr_hcall.c | 23 +- hw/ppc/spapr_iommu.c | 22 +- hw/ppc/spapr_pci.c | 13 + hw/ppc/spapr_rtas.c | 65 +- hw/ppc/spapr_vio.c | 20 +- hw/ppc/trace-events | 33 + hw/s390x/css.c | 20 +- hw/s390x/s390-pci-bus.c | 55 +- hw/s390x/s390-pci-bus.h | 4 +- hw/s390x/s390-pci-inst.c | 6 +- hw/s390x/s390-virtio-ccw.c | 40 +- hw/s390x/s390-virtio.c | 6 +- hw/s390x/sclp.c | 44 +- hw/s390x/virtio-ccw.c | 104 +- hw/s390x/virtio-ccw.h | 19 +- hw/scsi/lsi53c895a.c | 280 +- hw/scsi/megasas.c | 6 +- hw/scsi/mptconfig.c | 6 +- hw/scsi/mptsas.c | 6 +- hw/scsi/scsi-disk.c | 31 +- hw/scsi/spapr_vscsi.c | 88 +- hw/scsi/trace-events | 27 + hw/scsi/virtio-scsi.c | 92 +- hw/scsi/vmw_pvscsi.c | 35 +- hw/sd/sd.c | 9 + hw/sd/ssi-sd.c | 70 +- hw/sh4/shix.c | 2 +- hw/smbios/smbios.c | 13 +- hw/sparc/sun4m.c | 15 +- hw/ssi/Makefile.objs | 1 + hw/ssi/imx_spi.c | 2 +- hw/ssi/stm32f2xx_spi.c | 225 + hw/timer/allwinner-a10-pit.c | 2 +- hw/timer/arm_timer.c | 2 +- hw/timer/digic-timer.c | 2 +- hw/timer/etraxfs_timer.c | 6 +- hw/timer/exynos4210_mct.c | 7 +- hw/timer/exynos4210_pwm.c | 2 +- hw/timer/exynos4210_rtc.c | 4 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/imx_epit.c | 6 +- hw/timer/imx_gpt.c | 4 +- hw/timer/lm32_timer.c | 2 +- hw/timer/mc146818rtc.c | 10 +- hw/timer/milkymist-sysctl.c | 4 +- hw/timer/puv3_ost.c | 2 +- hw/timer/sh_timer.c | 2 +- hw/timer/slavio_timer.c | 2 +- hw/timer/stm32f2xx_timer.c | 9 + hw/timer/xilinx_timer.c | 2 +- hw/tricore/tricore_testboard.c | 2 +- hw/usb/ccid-card-passthru.c | 7 +- hw/usb/desc.c | 12 +- hw/usb/dev-mtp.c | 197 +- hw/usb/dev-serial.c | 4 +- hw/usb/hcd-ehci.c | 1 + hw/usb/hcd-ohci.c | 2 +- hw/usb/hcd-xhci.c | 238 +- hw/usb/host-libusb.c | 7 +- hw/usb/redirect.c | 10 +- hw/vfio/common.c | 4 +- hw/vfio/pci.c | 4 +- hw/virtio/Makefile.objs | 2 + hw/virtio/trace-events | 5 + hw/virtio/vhost-backend.c | 17 + hw/virtio/vhost-vsock.c | 417 ++ hw/virtio/vhost.c | 14 + hw/virtio/virtio-balloon.c | 31 +- hw/virtio/virtio-bus.c | 12 +- hw/virtio/virtio-pci.c | 139 +- hw/virtio/virtio-pci.h | 36 +- hw/virtio/virtio-rng.c | 19 +- hw/virtio/virtio.c | 304 +- hw/xenpv/xen_domainbuild.c | 8 +- include/block/aio.h | 6 + include/block/block.h | 15 +- include/block/block_backup.h | 39 + include/block/block_int.h | 19 +- include/block/nbd.h | 3 +- include/crypto/pbkdf.h | 16 +- include/exec/cpu-common.h | 5 + include/exec/exec-all.h | 22 +- include/exec/memory.h | 63 +- include/exec/tb-context.h | 2 +- include/fpu/softfloat.h | 15 + include/glib-compat.h | 24 + include/hw/acpi/acpi-defs.h | 13 +- include/hw/acpi/aml-build.h | 1 + include/hw/adc/stm32f2xx_adc.h | 87 + include/hw/arm/aspeed_soc.h | 59 + include/hw/arm/ast2400.h | 42 - include/hw/arm/pxa.h | 1 - include/hw/arm/stm32f205_soc.h | 9 + include/hw/boards.h | 2 +- include/hw/bt.h | 4 +- include/hw/compat.h | 15 + include/hw/core/generic-loader.h | 46 + include/hw/dma/xlnx-zynq-devcfg.h | 2 +- include/hw/elf_ops.h | 10 +- include/hw/i386/pc.h | 39 +- include/hw/i386/x86-iommu.h | 12 + include/hw/ide/internal.h | 3 + include/hw/input/adb-keys.h | 141 + include/hw/intc/arm_gicv3_its_common.h | 78 + include/hw/intc/intc.h | 33 + include/hw/isa/i8257.h | 2 + include/hw/isa/isa.h | 5 +- include/hw/lm32/lm32_pic.h | 3 - include/hw/loader.h | 73 +- include/hw/misc/aspeed_scu.h | 193 + include/hw/misc/aspeed_sdmc.h | 33 + include/hw/net/cadence_gem.h | 19 +- include/hw/or-irq.h | 44 + include/hw/pci-host/spapr.h | 4 +- include/hw/pci/pci.h | 4 + include/hw/pci/pci_bridge.h | 1 - include/hw/pci/pcie_port.h | 1 - include/hw/ppc/fdt.h | 29 + include/hw/ppc/ppc4xx.h | 6 - include/hw/ppc/spapr.h | 4 +- include/hw/ppc/spapr_cpu_core.h | 11 +- include/hw/ppc/spapr_rtas.h | 10 + include/hw/ppc/spapr_vio.h | 4 - include/hw/ppc/xics.h | 2 +- include/hw/ptimer.h | 25 +- include/hw/qdev-core.h | 2 +- include/hw/s390x/css.h | 2 +- include/hw/s390x/s390-virtio-ccw.h | 3 + include/hw/s390x/sclp.h | 17 +- include/hw/scsi/scsi.h | 1 - include/hw/sparc/sun4m.h | 8 - include/hw/ssi/stm32f2xx_spi.h | 72 + include/hw/sysbus.h | 2 +- include/hw/vfio/vfio-common.h | 2 +- include/hw/virtio/vhost-backend.h | 5 + include/hw/virtio/vhost-vsock.h | 41 + include/hw/virtio/virtio-blk.h | 8 - include/hw/virtio/virtio-bus.h | 13 +- include/hw/virtio/virtio-net.h | 1 + include/hw/virtio/virtio-serial.h | 2 + include/hw/virtio/virtio.h | 33 +- include/hw/xen/xen_common.h | 14 + include/migration/migration.h | 2 - include/net/net.h | 2 - include/qapi/qmp/dispatch.h | 1 + include/qemu/atomic.h | 40 +- include/qemu/bitmap.h | 11 +- include/qemu/compiler.h | 6 +- include/qemu/coroutine.h | 14 + include/qemu/coroutine_int.h | 3 + include/qemu/cutils.h | 3 +- include/qemu/jhash.h | 59 + include/qemu/module.h | 5 + include/qemu/osdep.h | 18 + include/qemu/queue.h | 2 + include/qemu/seqlock.h | 4 +- include/qemu/timer.h | 44 +- include/qemu/uri.h | 2 - include/qemu/uuid.h | 59 + include/qom/cpu.h | 111 +- include/sysemu/arch_init.h | 9 + include/sysemu/block-backend.h | 14 +- include/sysemu/char.h | 33 +- include/sysemu/cpus.h | 5 +- include/sysemu/iothread.h | 1 + include/sysemu/kvm.h | 13 +- include/sysemu/numa.h | 3 + include/sysemu/os-posix.h | 27 + include/sysemu/replay.h | 4 + include/sysemu/sysemu.h | 8 +- include/trace-tcg.h | 1 - include/trace.h | 1 - include/ui/console.h | 3 +- include/ui/input.h | 2 - include/ui/spice-display.h | 7 +- io/trace-events | 6 - iothread.c | 27 +- kvm-all.c | 45 +- kvm-stub.c | 5 +- linux-user/arm/target_syscall.h | 8 + linux-user/elfload.c | 35 +- linux-user/flatload.c | 6 + linux-user/i386/target_syscall.h | 1 + linux-user/ioctls.h | 3 + linux-user/m68k/target_syscall.h | 2 + linux-user/main.c | 288 +- linux-user/microblaze/target_syscall.h | 2 + linux-user/mips/target_structs.h | 16 + linux-user/mips/target_syscall.h | 9 + linux-user/mips64/target_syscall.h | 9 + linux-user/openrisc/syscall_nr.h | 2 - linux-user/ppc/syscall_nr.h | 2 + linux-user/ppc/target_syscall.h | 1 + linux-user/qemu.h | 17 +- linux-user/sh4/syscall_nr.h | 2 +- linux-user/sh4/target_syscall.h | 7 + linux-user/signal.c | 337 +- linux-user/sparc/target_syscall.h | 16 + linux-user/strace.c | 106 + linux-user/strace.list | 114 + linux-user/syscall.c | 253 +- linux-user/syscall_defs.h | 25 +- linux-user/tilegx/syscall_nr.h | 1 - memory.c | 113 +- migration/ram.c | 4 +- migration/rdma.c | 5 +- monitor.c | 467 +- nbd/server.c | 25 +- net/Makefile.objs | 3 + net/colo-compare.c | 755 +++ net/colo.c | 211 + net/colo.h | 88 + net/filter-mirror.c | 4 +- net/filter-rewriter.c | 263 + net/filter.c | 2 +- net/net.c | 9 +- net/socket.c | 127 +- net/tap.c | 4 +- net/trace-events | 16 + net/vhost-user.c | 41 +- numa.c | 12 + pc-bios/linuxboot_dma.bin | Bin 1536 -> 1536 bytes pc-bios/openbios-ppc | Bin 750840 -> 750840 bytes pc-bios/openbios-sparc32 | Bin 381584 -> 382048 bytes pc-bios/openbios-sparc64 | Bin 1592280 -> 1593424 bytes pc-bios/optionrom/Makefile | 8 +- pc-bios/optionrom/linuxboot_dma.c | 18 +- pc-bios/s390-ccw.img | Bin 26440 -> 26392 bytes pc-bios/s390-ccw/Makefile | 4 +- pc-bios/s390-ccw/virtio.c | 3 +- pc-bios/spapr-rtas/Makefile | 4 +- po/Makefile | 6 +- qapi-schema.json | 313 +- qapi/block-core.json | 215 +- qapi/block.json | 31 +- qapi/crypto.json | 6 +- qapi/qmp-input-visitor.c | 75 +- qapi/qmp-registry.c | 8 + qdev-monitor.c | 34 +- qemu-char.c | 167 +- qemu-doc.texi | 352 +- qemu-img-cmds.hx | 6 + qemu-img.c | 354 +- qemu-img.texi | 27 + qemu-io-cmds.c | 2 +- qemu-io.c | 1 + qemu-nbd.c | 13 +- qemu-options.hx | 111 +- qemu-seccomp.c | 1 + qemu-tech.texi | 558 +- qemu.nsi | 3 - qga/commands.c | 17 +- qga/guest-agent-command-state.c | 6 + qga/guest-agent-core.h | 1 + qga/main.c | 13 +- qga/vss-win32/Makefile.objs | 6 +- qmp-commands.hx | 5041 ---------------- qmp.c | 60 +- qom/cpu.c | 28 +- qom/object.c | 15 +- qtest.c | 79 +- replay/Makefile.objs | 1 + replay/replay-events.c | 10 +- replay/replay-internal.c | 20 +- replay/replay-internal.h | 23 +- replay/replay-snapshot.c | 61 + replay/replay-time.c | 2 +- replay/replay.c | 16 +- replication.c | 107 + replication.h | 174 + roms/openbios | 2 +- rules.mak | 37 +- scripts/checkpatch.pl | 12 +- scripts/coccinelle/typecast.cocci | 7 + scripts/create_config | 6 + scripts/kvm/vmxcap | 2 + scripts/modules/module_block.py | 101 + scripts/qapi-commands.py | 81 +- scripts/show-fixed-bugs.sh | 91 + scripts/simpletrace.py | 56 +- scripts/tracetool.py | 20 +- scripts/tracetool/__init__.py | 28 +- scripts/tracetool/backend/__init__.py | 12 +- scripts/tracetool/backend/dtrace.py | 4 +- scripts/tracetool/backend/ftrace.py | 5 +- scripts/tracetool/backend/log.py | 7 +- scripts/tracetool/backend/simple.py | 12 +- scripts/tracetool/backend/syslog.py | 44 + scripts/tracetool/backend/ust.py | 4 +- scripts/tracetool/format/__init__.py | 4 +- scripts/tracetool/format/c.py | 56 +- scripts/tracetool/format/d.py | 2 +- scripts/tracetool/format/events_c.py | 44 - scripts/tracetool/format/events_h.py | 60 - scripts/tracetool/format/h.py | 37 +- scripts/tracetool/format/simpletrace_stap.py | 26 +- scripts/tracetool/format/stap.py | 2 +- scripts/tracetool/format/tcg_h.py | 8 +- scripts/tracetool/format/tcg_helper_c.py | 2 +- scripts/tracetool/format/tcg_helper_h.py | 2 +- scripts/tracetool/format/tcg_helper_wrapper_h.py | 2 +- scripts/tracetool/format/ust_events_c.py | 2 +- scripts/tracetool/format/ust_events_h.py | 9 +- slirp/slirp.c | 4 +- softmmu_template.h | 48 +- stubs/Makefile.objs | 3 + stubs/arch-query-cpu-model-baseline.c | 12 + stubs/arch-query-cpu-model-comparison.c | 12 + stubs/arch-query-cpu-model-expansion.c | 12 + stubs/replay.c | 5 + stubs/trace-control.c | 31 +- stubs/uuid.c | 2 +- stubs/vmstate.c | 5 + target-alpha/cpu.h | 1 - target-alpha/translate.c | 4 +- target-arm/cpu.c | 46 + target-arm/helper.c | 8 +- target-arm/kvm_arm.h | 35 +- target-arm/machine.c | 15 - target-arm/op_helper.c | 2 +- target-arm/translate-a64.c | 29 +- target-arm/translate.c | 11 +- target-cris/cpu.c | 14 + target-cris/cpu.h | 7 + target-cris/crisv10-decode.h | 1 + target-cris/translate.c | 36 +- target-cris/translate_v10.c | 23 + target-i386/cpu.c | 642 +- target-i386/cpu.h | 55 +- target-i386/fpu_helper.c | 108 +- target-i386/helper.c | 19 +- target-i386/kvm.c | 104 +- target-i386/kvm_i386.h | 2 + target-i386/monitor.c | 3 +- target-i386/seg_helper.c | 36 +- target-i386/translate.c | 8 + target-m68k/cpu.h | 9 +- target-m68k/helper.c | 2 +- target-mips/op_helper.c | 18 +- target-mips/translate.c | 32 +- target-mips/translate_init.c | 22 + target-ppc/cpu-models.c | 5 + target-ppc/cpu-models.h | 1 + target-ppc/cpu-qom.h | 1 + target-ppc/cpu.h | 18 +- target-ppc/dfp_helper.c | 35 + target-ppc/excp_helper.c | 207 +- target-ppc/fpu_helper.c | 193 +- target-ppc/helper.h | 103 +- target-ppc/helper_regs.h | 25 +- target-ppc/int_helper.c | 279 + target-ppc/kvm.c | 70 +- target-ppc/kvm_ppc.h | 5 + target-ppc/mem_helper.c | 84 +- target-ppc/misc_helper.c | 9 +- target-ppc/mmu-hash64.c | 22 +- target-ppc/mmu-hash64.h | 1 - target-ppc/mmu_helper.c | 46 +- target-ppc/timebase_helper.c | 23 +- target-ppc/translate.c | 6835 ++++------------------ target-ppc/translate/dfp-impl.inc.c | 232 + target-ppc/translate/dfp-ops.inc.c | 165 + target-ppc/translate/fp-impl.inc.c | 1070 ++++ target-ppc/translate/fp-ops.inc.c | 111 + target-ppc/translate/spe-impl.inc.c | 1229 ++++ target-ppc/translate/spe-ops.inc.c | 105 + target-ppc/translate/vmx-impl.inc.c | 946 +++ target-ppc/translate/vmx-ops.inc.c | 283 + target-ppc/translate/vsx-impl.inc.c | 926 +++ target-ppc/translate/vsx-ops.inc.c | 286 + target-ppc/translate_init.c | 218 +- target-s390x/Makefile.objs | 22 +- target-s390x/cpu-qom.h | 6 + target-s390x/cpu.c | 39 +- target-s390x/cpu.h | 23 +- target-s390x/cpu_features.c | 404 ++ target-s390x/cpu_features.h | 93 + target-s390x/cpu_features_def.h | 231 + target-s390x/cpu_models.c | 1100 ++++ target-s390x/cpu_models.h | 119 + target-s390x/gen-features.c | 592 ++ target-s390x/helper.c | 33 +- target-s390x/ioinst.c | 2 +- target-s390x/kvm.c | 517 +- target-s390x/machine.c | 14 +- target-s390x/misc_helper.c | 4 +- target-sh4/README.sh4 | 2 +- target-sparc/cpu.c | 3 +- target-sparc/cpu.h | 5 + tcg/README | 22 + tcg/aarch64/tcg-target.inc.c | 35 +- tcg/arm/tcg-target.inc.c | 37 +- tcg/i386/tcg-target.inc.c | 36 +- tcg/ia64/tcg-target.inc.c | 27 +- tcg/mips/tcg-target.inc.c | 41 +- tcg/optimize.c | 42 +- tcg/ppc/tcg-target.inc.c | 79 +- tcg/s390/tcg-target.inc.c | 26 +- tcg/sparc/tcg-target.inc.c | 29 +- tcg/tcg-op.c | 17 + tcg/tcg-op.h | 2 + tcg/tcg-opc.h | 2 + tcg/tcg.c | 2 - tcg/tcg.h | 70 +- tcg/tci/README | 2 +- tcg/tci/tcg-target.inc.c | 3 + tci.c | 4 + tests/.gitignore | 5 + tests/Makefile.include | 110 +- tests/acpi-test-data/pc/DSDT.cphp | Bin 6435 -> 6471 bytes tests/acpi-test-data/pc/SRAT.cphp | Bin 0 -> 304 bytes tests/acpi-test-data/q35/DSDT.cphp | Bin 9197 -> 9233 bytes tests/acpi-test-data/q35/SRAT.cphp | Bin 0 -> 304 bytes tests/bios-tables-test.c | 41 +- tests/boot-sector.c | 9 + tests/boot-serial-test.c | 110 + tests/check-block.sh | 13 +- tests/check-qom-interface.c | 1 + tests/check-qom-proplist.c | 16 + tests/crypto-tls-x509-helpers.h | 1 - tests/docker/Makefile.include | 15 +- tests/docker/common.rc | 17 +- tests/docker/docker.py | 24 +- tests/docker/dockerfiles/centos6.docker | 6 +- tests/docker/dockerfiles/debian-bootstrap.pre | 32 +- tests/docker/dockerfiles/fedora.docker | 16 +- tests/docker/dockerfiles/min-glib.docker | 8 + tests/docker/dockerfiles/ubuntu.docker | 4 +- tests/docker/run | 26 +- tests/docker/test-clang | 2 + tests/docker/test-full | 2 + tests/docker/test-mingw | 2 + tests/docker/test-quick | 4 +- tests/e1000e-test.c | 2 +- tests/hd-geo-test.c | 4 +- tests/i440fx-test.c | 2 +- tests/ide-test.c | 2 +- tests/ivshmem-test.c | 2 +- tests/libqos/ahci.c | 2 +- tests/libqos/libqos-pc.c | 10 +- tests/libqos/libqos-spapr.c | 34 + tests/libqos/libqos-spapr.h | 10 + tests/libqos/libqos.c | 33 +- tests/libqos/libqos.h | 11 +- tests/libqos/malloc-spapr.c | 38 + tests/libqos/malloc-spapr.h | 17 + tests/libqos/pci-pc.c | 24 +- tests/libqos/pci-pc.h | 3 +- tests/libqos/pci-spapr.c | 288 + tests/libqos/pci-spapr.h | 17 + tests/libqos/pci.c | 22 +- tests/libqos/rtas.c | 116 + tests/libqos/rtas.h | 15 + tests/libqos/virtio.c | 8 +- tests/libqtest.c | 29 + tests/libqtest.h | 32 + tests/pc-cpu-test.c | 24 +- tests/postcopy-test.c | 7 +- tests/ptimer-test-stubs.c | 107 + tests/ptimer-test.c | 568 ++ tests/ptimer-test.h | 22 + tests/pxe-test.c | 22 +- tests/q35-test.c | 2 +- tests/qemu-iotests/030 | 2 +- tests/qemu-iotests/041 | 79 +- tests/qemu-iotests/055 | 159 +- tests/qemu-iotests/055.out | 4 +- tests/qemu-iotests/057 | 4 +- tests/qemu-iotests/067 | 6 +- tests/qemu-iotests/067.out | 211 +- tests/qemu-iotests/071 | 8 +- tests/qemu-iotests/081 | 2 +- tests/qemu-iotests/085.out | 6 +- tests/qemu-iotests/087 | 66 +- tests/qemu-iotests/087.out | 12 +- tests/qemu-iotests/117 | 4 +- tests/qemu-iotests/118 | 91 +- tests/qemu-iotests/124 | 17 +- tests/qemu-iotests/139 | 178 +- tests/qemu-iotests/139.out | 4 +- tests/qemu-iotests/141 | 24 +- tests/qemu-iotests/141.out | 24 +- tests/qemu-iotests/158 | 80 + tests/qemu-iotests/158.out | 36 + tests/qemu-iotests/159 | 70 + tests/qemu-iotests/159.out | 87 + tests/qemu-iotests/160 | 72 + tests/qemu-iotests/160.out | 51 + tests/qemu-iotests/170 | 67 + tests/qemu-iotests/170.out | 15 + tests/qemu-iotests/common.filter | 9 + tests/qemu-iotests/common.rc | 5 +- tests/qemu-iotests/group | 4 + tests/qemu-iotests/iotests.py | 20 +- tests/qom-test.c | 5 +- tests/rtas-test.c | 41 + tests/rtl8139-test.c | 2 +- tests/tcg/README | 76 + tests/tcg/cris/Makefile | 21 +- tests/tcg/cris/check_abs.c | 4 +- tests/tcg/cris/check_addc.c | 2 +- tests/tcg/cris/check_addcm.c | 4 +- tests/tcg/cris/check_addcv17.s | 65 + tests/tcg/cris/check_bound.c | 6 +- tests/tcg/cris/check_ftag.c | 8 +- tests/tcg/cris/check_int64.c | 4 +- tests/tcg/cris/check_lz.c | 2 +- tests/tcg/cris/check_openpf4.c | 5 - tests/tcg/cris/check_swap.c | 2 +- tests/tcg/cris/check_time1.c | 46 - tests/tcg/cris/crisutils.h | 20 +- tests/tcg/cris/sys.c | 26 +- tests/tcg/cris/sys.h | 2 + tests/tco-test.c | 2 +- tests/test-bufferiszero.c | 78 + tests/test-coroutine.c | 49 + tests/test-crypto-block.c | 2 +- tests/test-crypto-cipher.c | 43 +- tests/test-crypto-pbkdf.c | 54 +- tests/test-cutils.c | 24 +- tests/test-iov.c | 7 + tests/test-qga.c | 26 + tests/test-qht.c | 4 + tests/test-qmp-commands.c | 15 + tests/test-qmp-input-strict.c | 46 + tests/test-replication.c | 575 ++ tests/test-string-input-visitor.c | 1 + tests/test-uuid.c | 177 + tests/test-vmstate.c | 8 +- tests/test-x86-cpuid-compat.c | 171 + tests/usb-hcd-ehci-test.c | 2 +- tests/usb-hcd-uhci-test.c | 24 +- tests/vhost-user-test.c | 245 +- tests/virtio-9p-test.c | 119 +- tests/virtio-blk-test.c | 2 +- tests/virtio-net-test.c | 2 +- tests/virtio-scsi-test.c | 2 +- trace-events | 36 +- trace/Makefile.objs | 48 +- trace/control-internal.h | 48 +- trace/control-target.c | 81 +- trace/control.c | 144 +- trace/control.h | 120 +- trace/event-internal.h | 19 +- trace/ftrace.c | 6 + trace/qmp.c | 16 +- trace/simple.c | 41 +- trace/simple.h | 6 +- translate-all.c | 63 +- ui/cocoa.m | 123 +- ui/console.c | 23 +- ui/curses.c | 20 +- ui/spice-core.c | 2 +- ui/spice-display.c | 92 +- ui/vnc-enc-tight.c | 6 +- ui/vnc.c | 4 + user-exec.c | 7 +- util/Makefile.objs | 2 + util/bitmap.c | 2 - util/bufferiszero.c | 311 + util/coroutine-sigaltstack.c | 25 +- util/coroutine-ucontext.c | 11 +- util/coroutine-win32.c | 2 +- util/cutils.c | 244 - util/log.c | 41 +- util/module.c | 46 +- util/oslib-posix.c | 104 + util/oslib-win32.c | 7 + util/qemu-config.c | 2 +- util/qemu-coroutine-lock.c | 14 + util/qemu-coroutine.c | 6 + util/qemu-sockets.c | 26 +- util/qht.c | 65 +- util/trace-events | 19 + util/uuid.c | 114 + vl.c | 84 +- 836 files changed, 41252 insertions(+), 23215 deletions(-) diff --git a/.gitignore b/.gitignore index 88ec249..3d7848c 100644 --- a/.gitignore +++ b/.gitignore @@ -39,9 +39,7 @@ /qmp-introspect.[ch] /qmp-marshal.c /qemu-doc.html -/qemu-tech.html /qemu-doc.info -/qemu-tech.info /qemu-img /qemu-nbd /qemu-options.def @@ -53,7 +51,9 @@ /qemu-bridge-helper /qemu-monitor.texi /qemu-monitor-info.texi -/qmp-commands.txt +/qemu-version.h +/qemu-version.h.tmp +/module_block.h /vscclient /fsdev/virtfs-proxy-helper *.[1-9] diff --git a/.travis.yml b/.travis.yml index f30b10e..9916178 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ cache: ccache addons: apt: packages: + # Build dependencies - libaio-dev - libattr1-dev - libbrlapi-dev @@ -89,6 +90,7 @@ matrix: - env: CONFIG="" os: osx compiler: clang + # Plain Trusty Build - env: CONFIG="" sudo: required addons: @@ -99,3 +101,46 @@ matrix: - sudo apt-get build-dep -qq qemu - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ - git submodule update --init --recursive + # Using newer GCC with sanitizers + - addons: + apt: + sources: + # PPAs for newer toolchains + - ubuntu-toolchain-r-test + packages: + # Extra toolchains + - gcc-5 + - g++-5 + # Build dependencies + - libaio-dev + - libattr1-dev + - libbrlapi-dev + - libcap-ng-dev + - libgnutls-dev + - libgtk-3-dev + - libiscsi-dev + - liblttng-ust-dev + - libnfs-dev + - libncurses5-dev + - libnss3-dev + - libpixman-1-dev + - libpng12-dev + - librados-dev + - libsdl1.2-dev + - libseccomp-dev + - libspice-protocol-dev + - libspice-server-dev + - libssh2-1-dev + - liburcu-dev + - libusb-1.0-0-dev + - libvte-2.90-dev + - sparse + - uuid-dev + language: generic + compiler: none + env: + - COMPILER_NAME=gcc CXX=g++-5 CC=gcc-5 + - CONFIG="--cc=gcc-5 --cxx=g++-5 --disable-pie --disable-linux-user --with-coroutine=gthread" + - TEST_CMD="" + before_script: + - ./configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread -fuse-ld=gold" || cat config.log diff --git a/CODING_STYLE b/CODING_STYLE index e7fde15..f53180b 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -9,7 +9,7 @@ patches before submitting. Of course, the most important aspect in any coding style is whitespace. Crusty old coders who have trouble spotting the glasses on their noses can tell the difference between a tab and eight spaces from a distance -of approximately fifteen parsecs. Many a flamewar have been fought and +of approximately fifteen parsecs. Many a flamewar has been fought and lost on this issue. QEMU indents are four spaces. Tabs are never used, except in Makefiles diff --git a/MAINTAINERS b/MAINTAINERS index b6fb84e..b01fec0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -83,6 +83,7 @@ F: include/exec/cpu*.h F: include/exec/exec-all.h F: include/exec/helper*.h F: include/exec/tb-hash.h +F: include/sysemu/cpus.h FPU emulation M: Aurelien Jarno <aurelien@xxxxxxxxxxx> @@ -115,6 +116,7 @@ M: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxx> S: Maintained F: target-cris/ F: hw/cris/ +F: include/hw/cris/ F: tests/tcg/cris/ F: disas/cris.c @@ -144,10 +146,17 @@ F: disas/microblaze.c MIPS M: Aurelien Jarno <aurelien@xxxxxxxxxxx> -M: Leon Alrae <leon.alrae@xxxxxxxxxx> +M: Yongbok Kim <yongbok.kim@xxxxxxxxxx> S: Maintained F: target-mips/ F: hw/mips/ +F: hw/misc/mips_* +F: hw/intc/mips_gic.c +F: hw/timer/mips_gictimer.c +F: include/hw/mips/ +F: include/hw/misc/mips_* +F: include/hw/intc/mips_gic.h +F: include/hw/timer/mips_gictimer.h F: tests/tcg/mips/ F: disas/mips.c @@ -156,6 +165,8 @@ M: Anthony Green <green@xxxxxxxxxxxxxx> S: Maintained F: target-moxie/ F: disas/moxie.c +F: hw/moxie/ +F: default-configs/moxie-softmmu.mak OpenRISC M: Jia Liu <proljc@xxxxxxxxx> @@ -171,6 +182,7 @@ L: qemu-ppc@xxxxxxxxxx S: Maintained F: target-ppc/ F: hw/ppc/ +F: include/hw/ppc/ F: disas/ppc.c S390 @@ -187,6 +199,7 @@ S: Odd Fixes F: target-sh4/ F: hw/sh4/ F: disas/sh4.c +F: include/hw/sh4/ SPARC M: Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx> @@ -202,6 +215,7 @@ M: Guan Xuetao <gxt@xxxxxxxxxxxxxxx> S: Maintained F: target-unicore32/ F: hw/unicore32/ +F: include/hw/unicore32/ X86 M: Paolo Bonzini <pbonzini@xxxxxxxxxx> @@ -225,6 +239,7 @@ M: Bastian Koppelmann <kbastian@xxxxxxxxxxxxxxxxxxxxx> S: Maintained F: target-tricore/ F: hw/tricore/ +F: include/hw/tricore/ Guest CPU Cores (KVM): ---------------------- @@ -314,6 +329,9 @@ L: qemu-devel@xxxxxxxxxx M: Stefan Weil <sw@xxxxxxxxxxx> S: Maintained F: *win32* +F: */*win32* +F: include/*/*win32* +X: qga/*win32* F: qemu.nsi ARM Machines @@ -456,7 +474,6 @@ S: Maintained F: hw/*/xilinx_* F: hw/*/cadence_* F: hw/misc/zynq_slcr.c -F: include/hw/xilinx.h X: hw/ssi/xilinx_* Xilinx ZynqMP @@ -465,7 +482,7 @@ M: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxx> L: qemu-arm@xxxxxxxxxx S: Maintained F: hw/*/xlnx*.c -F: include/hw/*/xlnx*.c +F: include/hw/*/xlnx*.h ARM ACPI Subsystem M: Shannon Zhao <zhaoshenglong@xxxxxxxxxx> @@ -475,6 +492,21 @@ S: Maintained F: hw/arm/virt-acpi-build.c F: include/hw/arm/virt-acpi-build.h +STM32F205 +M: Alistair Francis <alistair@xxxxxxxxxxxxx> +S: Maintained +F: hw/arm/stm32f205_soc.c +F: hw/misc/stm32f2xx_syscfg.c +F: hw/char/stm32f2xx_usart.c +F: hw/timer/stm32f2xx_timer.c +F: hw/adc/* +F: hw/ssi/stm32f2xx_spi.c + +Netduino 2 +M: Alistair Francis <alistair@xxxxxxxxxxxxx> +S: Maintained +F: hw/arm/netduino2.c + CRIS Machines ------------- Axis Dev88 @@ -571,6 +603,9 @@ L: qemu-ppc@xxxxxxxxxx S: Supported F: hw/ppc/e500.[hc] F: hw/ppc/e500plat.c +F: include/hw/ppc/ppc_e500.h +F: include/hw/pci-host/ppce500.h +F: pc-bios/u-boot.e500 mpc8544ds M: Alexander Graf <agraf@xxxxxxx> @@ -588,6 +623,8 @@ F: hw/ppc/mac_newworld.c F: hw/pci-host/uninorth.c F: hw/pci-bridge/dec.[hc] F: hw/misc/macio/ +F: include/hw/ppc/mac_dbdma.h +F: hw/nvram/mac_nvram.c Old World M: Alexander Graf <agraf@xxxxxxx> @@ -596,6 +633,7 @@ S: Maintained F: hw/ppc/mac_oldworld.c F: hw/pci-host/grackle.c F: hw/misc/macio/ +F: hw/intc/heathrow_pic.c PReP L: qemu-devel@xxxxxxxxxx @@ -604,6 +642,7 @@ S: Odd Fixes F: hw/ppc/prep.c F: hw/pci-host/prep.[hc] F: hw/isa/pc87312.[hc] +F: pc-bios/ppc_rom.bin sPAPR M: David Gibson <david@xxxxxxxxxxxxxxxxxxxxx> @@ -615,6 +654,14 @@ F: include/hw/*/spapr* F: hw/*/xics* F: include/hw/*/xics* F: pc-bios/spapr-rtas/* +F: pc-bios/spapr-rtas.bin +F: pc-bios/slof.bin +F: docs/specs/ppc-spapr-hcalls.txt +F: docs/specs/ppc-spapr-hotplug.txt +F: tests/spapr* +F: tests/libqos/*spapr* +F: tests/rtas* +F: tests/libqos/rtas* virtex_ml507 M: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxx> @@ -628,31 +675,38 @@ R2D M: Magnus Damm <magnus.damm@xxxxxxxxx> S: Maintained F: hw/sh4/r2d.c +F: hw/intc/sh_intc.c +F: hw/timer/sh_timer.c Shix M: Magnus Damm <magnus.damm@xxxxxxxxx> -S: Orphan +S: Odd Fixes F: hw/sh4/shix.c SPARC Machines -------------- Sun4m -M: Blue Swirl <blauwirbel@xxxxxxxxx> M: Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx> S: Maintained F: hw/sparc/sun4m.c +F: hw/dma/sparc32_dma.c +F: hw/dma/sun4m_iommu.c +F: include/hw/sparc/sparc32_dma.h +F: include/hw/sparc/sun4m.h +F: pc-bios/openbios-sparc32 Sun4u -M: Blue Swirl <blauwirbel@xxxxxxxxx> M: Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx> S: Maintained F: hw/sparc64/sun4u.c +F: pc-bios/openbios-sparc64 Leon3 M: Fabien Chouteau <chouteau@xxxxxxxxxxx> S: Maintained F: hw/sparc/leon3.c F: hw/*/grlib* +F: include/hw/sparc/grlib.h S390 Machines ------------- @@ -666,6 +720,9 @@ F: hw/s390x/ F: include/hw/s390x/ F: pc-bios/s390-ccw/ F: hw/watchdog/wdt_diag288.c +F: include/hw/watchdog/wdt_diag288.h +F: pc-bios/s390-ccw.img +F: default-configs/s390x-softmmu.mak T: git git://github.com/cohuck/qemu.git s390-next T: git git://github.com/borntraeger/qemu.git s390-next @@ -695,7 +752,7 @@ F: hw/i2c/smbus_ich9.c F: hw/acpi/piix4.c F: hw/acpi/ich9.c F: include/hw/acpi/ich9.h -F: include/hw/acpi/piix.h +F: include/hw/acpi/piix4.h F: hw/misc/sga.c PC Chipset @@ -715,6 +772,10 @@ F: hw/misc/pc-testdev.c F: hw/timer/hpet* F: hw/timer/i8254* F: hw/timer/mc146818rtc* +F: include/hw/i2c/pm_smbus.h +F: include/hw/timer/hpet.h +F: include/hw/timer/i8254* +F: include/hw/timer/mc146818rtc* Machine core M: Eduardo Habkost <ehabkost@xxxxxxxxxx> @@ -748,6 +809,7 @@ M: John Snow <jsnow@xxxxxxxxxx> L: qemu-block@xxxxxxxxxx S: Supported F: include/hw/ide.h +F: include/hw/ide/ F: hw/ide/ F: hw/block/block.c F: hw/block/cdrom.c @@ -797,16 +859,15 @@ F: hw/mem/* F: hw/acpi/* F: hw/smbios/* F: hw/i386/acpi-build.[hc] -F: hw/i386/*dsl F: hw/arm/virt-acpi-build.c F: include/hw/arm/virt-acpi-build.h -F: scripts/acpi*py ppc4xx M: Alexander Graf <agraf@xxxxxxx> L: qemu-ppc@xxxxxxxxxx S: Odd Fixes F: hw/ppc/ppc4*.c +F: include/hw/ppc/ppc4xx.h ppce500 M: Alexander Graf <agraf@xxxxxxx> @@ -826,13 +887,15 @@ Network devices M: Jason Wang <jasowang@xxxxxxxxxx> S: Odd Fixes F: hw/net/ +F: tests/virtio-net-test.c T: git git://github.com/jasowang/qemu.git net SCSI M: Paolo Bonzini <pbonzini@xxxxxxxxxx> S: Supported -F: include/hw/scsi* +F: include/hw/scsi/* F: hw/scsi/* +F: tests/virtio-scsi-test.c T: git git://github.com/bonzini/qemu.git scsi-next LSI53C895A @@ -883,8 +946,11 @@ virtio M: Michael S. Tsirkin <mst@xxxxxxxxxx> S: Supported F: hw/*/virtio* +F: hw/virtio/Makefile.objs +F: hw/virtio/trace-events F: net/vhost-user.c F: include/hw/virtio/ +F: tests/virtio-balloon-test.c virtio-9p M: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx> @@ -902,7 +968,7 @@ L: qemu-block@xxxxxxxxxx S: Supported F: hw/block/virtio-blk.c F: hw/block/dataplane/* -F: hw/virtio/dataplane/* +F: tests/virtio-blk-test.c T: git git://github.com/stefanha/qemu.git block virtio-ccw @@ -925,6 +991,8 @@ S: Supported F: hw/char/virtio-serial-bus.c F: hw/char/virtio-console.c F: include/hw/virtio/virtio-serial.h +F: tests/virtio-console-test.c +F: tests/virtio-serial-test.c virtio-rng M: Amit Shah <amit.shah@xxxxxxxxxx> @@ -933,6 +1001,7 @@ F: hw/virtio/virtio-rng.c F: include/hw/virtio/virtio-rng.h F: include/sysemu/rng*.h F: backends/rng*.c +F: tests/virtio-rng-test.c nvme M: Keith Busch <keith.busch@xxxxxxxxx> @@ -966,6 +1035,8 @@ Rocker M: Jiri Pirko <jiri@xxxxxxxxxxx> S: Maintained F: hw/net/rocker/ +F: tests/rocker/ +F: docs/specs/rocker.txt NVDIMM M: Xiao Guangrong <guangrong.xiao@xxxxxxxxxxxxxxx> @@ -984,6 +1055,12 @@ M: Dmitry Fleytman <dmitry@xxxxxxxxxx> S: Maintained F: hw/net/e1000e* +Generic Loader +M: Alistair Francis <alistair.francis@xxxxxxxxxx> +S: Maintained +F: hw/core/generic-loader.c +F: include/hw/core/generic-loader.h + Subsystems ---------- Audio @@ -991,6 +1068,7 @@ M: Gerd Hoffmann <kraxel@xxxxxxxxxx> S: Maintained F: audio/ F: hw/audio/ +F: include/hw/audio/ F: tests/ac97-test.c F: tests/es1370-test.c F: tests/intel-hda-test.c @@ -1064,12 +1142,6 @@ S: Supported F: qom/cpu.c F: include/qom/cpu.h -ICC Bus -M: Igor Mammedov <imammedo@xxxxxxxxxx> -S: Supported -F: include/hw/cpu/icc_bus.h -F: hw/cpu/icc_bus.c - Device Tree M: Peter Crosthwaite <crosthwaite.peter@xxxxxxxxx> M: Alexander Graf <agraf@xxxxxxx> @@ -1131,12 +1203,12 @@ F: qemu-timer.c F: vl.c Human Monitor (HMP) -M: Luiz Capitulino <lcapitulino@xxxxxxxxxx> +M: Dr. David Alan Gilbert <dgilbert@xxxxxxxxxx> S: Maintained F: monitor.c -F: hmp.c -F: hmp-commands.hx -T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp +F: hmp.[ch] +F: hmp-commands*.hx +F: include/monitor/hmp-target.h Network device backends M: Jason Wang <jasowang@xxxxxxxxxx> @@ -1201,8 +1273,8 @@ F: qapi/*.json T: git git://repo.or.cz/qemu/armbru.git qapi-next QObject -M: Luiz Capitulino <lcapitulino@xxxxxxxxxx> -S: Maintained +M: Markus Armbruster <armbru@xxxxxxxxxx> +S: Supported F: qobject/ F: include/qapi/qmp/ X: include/qapi/qmp/dispatch.h @@ -1212,7 +1284,7 @@ F: tests/check-qint.c F: tests/check-qjson.c F: tests/check-qlist.c F: tests/check-qstring.c -T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp +T: git git://repo.or.cz/qemu/armbru.git qapi-next QEMU Guest Agent M: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx> @@ -1237,7 +1309,6 @@ M: Markus Armbruster <armbru@xxxxxxxxxx> S: Supported F: qmp.c F: monitor.c -F: qmp-commands.hx F: docs/*qmp-* F: scripts/qmp/ T: git git://repo.or.cz/qemu/armbru.git qapi-next @@ -1257,6 +1328,11 @@ F: net/slirp.c F: include/net/slirp.h T: git git://git.kiszka.org/qemu.git queues/slirp +Stubs +M: Paolo Bonzini <pbonzini@xxxxxxxxxx> +S: Maintained +F: stubs/ + Tracing M: Stefan Hajnoczi <stefanha@xxxxxxxxxx> S: Maintained @@ -1330,6 +1406,22 @@ F: include/qemu/throttle.h F: util/throttle.c L: qemu-block@xxxxxxxxxx +UUID +M: Fam Zheng <famz@xxxxxxxxxx> +S: Supported +F: util/uuid.c +F: include/qemu/uuid.h +F: tests/test-uuid.c + +COLO Proxy +M: Zhang Chen <zhangchen.fnst@xxxxxxxxxxxxxx> +M: Li Zhijian <lizhijian@xxxxxxxxxxxxxx> +S: Supported +F: docs/colo-proxy.txt +F: net/colo* +F: net/filter-rewriter.c +F: net/filter-mirror.c + Usermode Emulation ------------------ Overall @@ -1341,11 +1433,13 @@ F: user-exec.c BSD user S: Orphan F: bsd-user/ +F: default-configs/*-bsd-user.mak Linux user M: Riku Voipio <riku.voipio@xxxxxx> S: Maintained F: linux-user/ +F: default-configs/*-linux-user.mak Tiny Code Generator (TCG) ------------------------- @@ -1580,7 +1674,7 @@ M: Kevin Wolf <kwolf@xxxxxxxxxx> L: qemu-block@xxxxxxxxxx S: Supported F: block/linux-aio.c -F: block/raw-aio.h +F: include/block/raw-aio.h F: block/raw-posix.c F: block/raw-win32.c F: block/raw_bsd.c @@ -1624,6 +1718,15 @@ L: qemu-block@xxxxxxxxxx S: Supported F: tests/image-fuzzer/ +Replication +M: Wen Congyang <wency@xxxxxxxxxxxxxx> +M: Changlong Xie <xiecl.fnst@xxxxxxxxxxxxxx> +S: Supported +F: replication* +F: block/replication.c +F: tests/test-replication.c +F: docs/block-replication.txt + Build and test automation ------------------------- M: Alex Bennée <alex.bennee@xxxxxxxxxx> diff --git a/Makefile b/Makefile index 50b4b3a..3bcb056 100644 --- a/Makefile +++ b/Makefile @@ -56,9 +56,6 @@ GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c GENERATED_HEADERS += qmp-introspect.h GENERATED_SOURCES += qmp-introspect.c -GENERATED_HEADERS += trace/generated-events.h -GENERATED_SOURCES += trace/generated-events.c - GENERATED_HEADERS += trace/generated-tracers.h ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace) GENERATED_HEADERS += trace/generated-tracers-dtrace.h @@ -76,6 +73,8 @@ GENERATED_HEADERS += trace/generated-ust-provider.h GENERATED_SOURCES += trace/generated-ust.c endif +GENERATED_HEADERS += module_block.h + # Don't try to regenerate Makefile or configure # We don't generate any of them Makefile: ; @@ -91,8 +90,7 @@ LIBS+=-lz $(LIBS_TOOLS) HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF) ifdef BUILD_DOCS -DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 -DOCS+=qmp-commands.txt +DOCS=qemu-doc.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 ifdef CONFIG_VIRTFS DOCS+=fsdev/virtfs-proxy-helper.1 endif @@ -106,20 +104,20 @@ SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS)) ifeq ($(SUBDIR_DEVICES_MAK),) config-all-devices.mak: - $(call quiet-command,echo '# no devices' > $@," GEN $@") + $(call quiet-command,echo '# no devices' > $@,"GEN","$@") else config-all-devices.mak: $(SUBDIR_DEVICES_MAK) $(call quiet-command, sed -n \ 's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \ $(SUBDIR_DEVICES_MAK) | sort -u > $@, \ - " GEN $@") + "GEN","$@") endif -include $(SUBDIR_DEVICES_MAK_DEP) %/config-devices.mak: default-configs/%.mak $(SRC_PATH)/scripts/make_device_config.sh $(call quiet-command, \ - $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp, " GEN $@.tmp") + $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp,"GEN","$@.tmp") $(call quiet-command, if test -f $@; then \ if cmp -s $@.old $@; then \ mv $@.tmp $@; \ @@ -136,7 +134,7 @@ endif else \ mv $@.tmp $@; \ cp -p $@ $@.old; \ - fi, " GEN $@"); + fi,"GEN","$@"); defconfig: rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK) @@ -190,7 +188,7 @@ qemu-version.h: FORCE config-host.h: config-host.h-timestamp config-host.h-timestamp: config-host.mak qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@") + $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@") SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES)) @@ -234,9 +232,9 @@ ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS)) recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h | $(BUILD_DIR)/version.lo - $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<," RC version.o") + $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o") $(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc config-host.h - $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<," RC version.lo") + $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.lo") Makefile: $(version-obj-y) $(version-lobj-y) @@ -246,9 +244,6 @@ Makefile: $(version-obj-y) $(version-lobj-y) libqemustub.a: $(stub-obj-y) libqemuutil.a: $(util-obj-y) -block-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL -util/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)' - ###################################################################### qemu-img.o: qemu-img-cmds.h @@ -263,7 +258,7 @@ fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@") + $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@") qemu-ga$(EXESUF): LIBS = $(LIBS_QGA) qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated @@ -276,17 +271,17 @@ qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \ $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ - " GEN $@") + "GEN","$@") qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \ $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ - " GEN $@") + "GEN","$@") qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \ $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ - " GEN $@") + "GEN","$@") qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \ $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \ @@ -298,27 +293,27 @@ qapi-types.c qapi-types.h :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \ $(gen-out-type) -o "." -b $<, \ - " GEN $@") + "GEN","$@") qapi-visit.c qapi-visit.h :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \ $(gen-out-type) -o "." -b $<, \ - " GEN $@") + "GEN","$@") qapi-event.c qapi-event.h :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \ $(gen-out-type) -o "." $<, \ - " GEN $@") + "GEN","$@") qmp-commands.h qmp-marshal.c :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \ - $(gen-out-type) -o "." -m $<, \ - " GEN $@") + $(gen-out-type) -o "." $<, \ + "GEN","$@") qmp-introspect.h qmp-introspect.c :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \ $(gen-out-type) -o "." $<, \ - " GEN $@") + "GEN","$@") QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) @@ -337,7 +332,7 @@ $(QEMU_GA_MSI): config-host.mak $(QEMU_GA_MSI): $(SRC_PATH)/qga/installer/qemu-ga.wxs $(call quiet-command,QEMU_GA_VERSION="$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER="$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO="$(QEMU_GA_DISTRO)" BUILD_DIR="$(BUILD_DIR)" \ - wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<, " WIXL $@") + wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<,"WIXL","$@") else msi: @echo "MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)" @@ -353,6 +348,11 @@ ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) libqemuutil.a libqemustub.a ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) +module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak + $(call quiet-command,$(PYTHON) $< $@ \ + $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \ + "GEN","$@") + clean: # avoid old build problems by removing potentially incorrect old files rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h @@ -395,7 +395,6 @@ distclean: clean rm -f qemu-doc.vr rm -f config.log rm -f linux-headers/asm - rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr for d in $(TARGET_DIRS); do \ rm -rf $$d || exit 1 ; \ done @@ -431,8 +430,8 @@ endif install-doc: $(DOCS) $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)" + $(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)" + $(INSTALL_DATA) $(SRC_PATH)/docs/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)" ifdef CONFIG_POSIX $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1" @@ -518,13 +517,13 @@ ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclu @mkdir -p $(dir $@) $(call quiet-command,\ perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\ - " VERT $@") + "VERT","$@") ui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl @mkdir -p $(dir $@) $(call quiet-command,\ perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\ - " FRAG $@") + "FRAG","$@") ui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \ ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h @@ -534,68 +533,65 @@ MAKEINFO=makeinfo MAKEINFOFLAGS=--no-headers --no-split --number-sections TEXIFLAG=$(if $(V),,--quiet) %.dvi: %.texi - $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<," GEN $@") + $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"GEN","$@") %.html: %.texi $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \ - " GEN $@") + "GEN","$@") %.info: %.texi - $(call quiet-command,$(MAKEINFO) $< -o $@," GEN $@") + $(call quiet-command,$(MAKEINFO) $< -o $@,"GEN","$@") %.pdf: %.texi - $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<," GEN $@") + $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"GEN","$@") qemu-options.texi: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") + $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") + $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") - -qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@," GEN $@") + $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") + $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \ $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \ - " GEN $@") + "GEN","$@") qemu.1: qemu-option-trace.texi qemu-img.1: qemu-img.texi qemu-option-trace.texi qemu-img-cmds.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \ $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \ - " GEN $@") + "GEN","$@") fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \ $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \ - " GEN $@") + "GEN","$@") qemu-nbd.8: qemu-nbd.texi qemu-option-trace.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \ $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \ - " GEN $@") + "GEN","$@") qemu-ga.8: qemu-ga.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-ga.pod && \ $(POD2MAN) --section=8 --center=" " --release=" " qemu-ga.pod > $@, \ - " GEN $@") + "GEN","$@") -dvi: qemu-doc.dvi qemu-tech.dvi -html: qemu-doc.html qemu-tech.html -info: qemu-doc.info qemu-tech.info -pdf: qemu-doc.pdf qemu-tech.pdf +dvi: qemu-doc.dvi +html: qemu-doc.html +info: qemu-doc.info +pdf: qemu-doc.pdf qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ @@ -669,3 +665,40 @@ endif -include $(wildcard *.d tests/*.d) include $(SRC_PATH)/tests/docker/Makefile.include + +.PHONY: help +help: + @echo 'Generic targets:' + @echo ' all - Build all' + @echo ' dir/file.o - Build specified target only' + @echo ' install - Install QEMU, documentation and tools' + @echo ' ctags/TAGS - Generate tags file for editors' + @echo ' cscope - Generate cscope index' + @echo '' + @$(if $(TARGET_DIRS), \ + echo 'Architecture specific targets:'; \ + $(foreach t, $(TARGET_DIRS), \ + printf " %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \ + echo '') + @echo 'Cleaning targets:' + @echo ' clean - Remove most generated files but keep the config' + @echo ' distclean - Remove all generated files' + @echo ' dist - Build a distributable tarball' + @echo '' + @echo 'Test targets:' + @echo ' check - Run all tests (check-help for details)' + @echo ' docker - Help about targets running tests inside Docker containers' + @echo '' + @echo 'Documentation targets:' + @echo ' dvi html info pdf' + @echo ' - Build documentation in specified format' + @echo '' +ifdef CONFIG_WIN32 + @echo 'Windows targets:' + @echo ' installer - Build NSIS-based installer for qemu-ga' +ifdef QEMU_GA_MSI_ENABLED + @echo ' msi - Build MSI-based installer for qemu-ga' +endif + @echo '' +endif + @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' diff --git a/Makefile.objs b/Makefile.objs index 6d5ddcf..02fb8e7 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -15,6 +15,7 @@ block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o block-obj-y += block/ block-obj-y += qemu-io-cmds.o +block-obj-$(CONFIG_REPLICATION) += replication.o block-obj-m = block/ @@ -88,7 +89,7 @@ endif ####################################################################### # Target-independent parts used in system and user emulation -common-obj-y += tcg-runtime.o +common-obj-y += tcg-runtime.o cpus-common.o common-obj-y += hw/ common-obj-y += qom/ common-obj-y += disas/ @@ -141,6 +142,7 @@ trace-events-y += hw/dma/trace-events trace-events-y += hw/sparc/trace-events trace-events-y += hw/sd/trace-events trace-events-y += hw/isa/trace-events +trace-events-y += hw/mem/trace-events trace-events-y += hw/i386/trace-events trace-events-y += hw/9pfs/trace-events trace-events-y += hw/ppc/trace-events diff --git a/Makefile.target b/Makefile.target index a440bcb..2c46091 100644 --- a/Makefile.target +++ b/Makefile.target @@ -26,7 +26,7 @@ ifneq (,$(findstring -mwindows,$(libs_softmmu))) # Terminate program name with a 'w' because the linker builds a windows executable. QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF) $(QEMU_PROG): $(QEMU_PROGW) - $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)") + $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG),"GEN","$(TARGET_DIR)$(QEMU_PROG)") QEMU_PROG_BUILD = $(QEMU_PROGW) else QEMU_PROG_BUILD = $(QEMU_PROG) @@ -55,7 +55,7 @@ $(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace-events-all --binary=$(bindir)/$(QEMU_PROG) \ --target-name=$(TARGET_NAME) \ --target-type=$(TARGET_TYPE) \ - < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp-installed") + $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed") $(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all $(call quiet-command,$(TRACETOOL) \ @@ -64,14 +64,14 @@ $(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all --binary=$(realpath .)/$(QEMU_PROG) \ --target-name=$(TARGET_NAME) \ --target-type=$(TARGET_TYPE) \ - < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp") + $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp") $(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace-events-all $(call quiet-command,$(TRACETOOL) \ --format=simpletrace-stap \ --backends=$(TRACE_BACKENDS) \ --probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \ - < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp") + $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp") else stap: @@ -156,7 +156,7 @@ else obj-y += hw/$(TARGET_BASE_ARCH)/ endif -GENERATED_HEADERS += hmp-commands.h hmp-commands-info.h qmp-commands-old.h +GENERATED_HEADERS += hmp-commands.h hmp-commands-info.h endif # CONFIG_SOFTMMU @@ -196,26 +196,23 @@ $(QEMU_PROG_BUILD): config-devices.mak $(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a $(call LINK, $(filter-out %.mak, $^)) ifdef CONFIG_DARWIN - $(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@," REZ $(TARGET_DIR)$@") - $(call quiet-command,SetFile -a C $@," SETFILE $(TARGET_DIR)$@") + $(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@,"REZ","$(TARGET_DIR)$@") + $(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@") endif gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh - $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") + $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"GEN","$(TARGET_DIR)$@") hmp-commands.h: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") + $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@") hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") + $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@") -qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") - -clean: +clean: clean-target rm -f *.a *~ $(PROGS) rm -f $(shell find . -name '*.[od]') - rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c + rm -f hmp-commands.h gdbstub-xml.c ifdef CONFIG_TRACE_SYSTEMTAP rm -f *.stp endif diff --git a/README b/README index f38193f..bd8060a 100644 --- a/README +++ b/README @@ -42,8 +42,6 @@ of other UNIX targets. The simple steps to build QEMU are: ../configure make -Complete details of the process for building and configuring QEMU for -all supported host platforms can be found in the qemu-tech.html file. Additional information can also be found online via the QEMU website: http://qemu-project.org/Hosts/Linux diff --git a/VERSION b/VERSION index 24ba9a3..dc8231f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.7.0 +2.7.50 diff --git a/aio-posix.c b/aio-posix.c index 43162a9..4ef34dd 100644 --- a/aio-posix.c +++ b/aio-posix.c @@ -431,11 +431,13 @@ bool aio_poll(AioContext *ctx, bool blocking) assert(npfd == 0); /* fill pollfds */ - QLIST_FOREACH(node, &ctx->aio_handlers, node) { - if (!node->deleted && node->pfd.events - && !aio_epoll_enabled(ctx) - && aio_node_check(ctx, node->is_external)) { - add_pollfd(node); + + if (!aio_epoll_enabled(ctx)) { + QLIST_FOREACH(node, &ctx->aio_handlers, node) { + if (!node->deleted && node->pfd.events + && aio_node_check(ctx, node->is_external)) { + add_pollfd(node); + } } } diff --git a/arch_init.c b/arch_init.c index fa05973..5cc58b2 100644 --- a/arch_init.c +++ b/arch_init.c @@ -235,25 +235,6 @@ void audio_init(void) } } -int qemu_uuid_parse(const char *str, uint8_t *uuid) -{ - int ret; - - if (strlen(str) != 36) { - return -1; - } - - ret = sscanf(str, UUID_FMT, &uuid[0], &uuid[1], &uuid[2], &uuid[3], - &uuid[4], &uuid[5], &uuid[6], &uuid[7], &uuid[8], &uuid[9], - &uuid[10], &uuid[11], &uuid[12], &uuid[13], &uuid[14], - &uuid[15]); - - if (ret != 16) { - return -1; - } - return 0; -} - void do_acpitable_option(const QemuOpts *opts) { #ifdef TARGET_I386 diff --git a/async.c b/async.c index 3bca9b0..f30d011 100644 --- a/async.c +++ b/async.c @@ -44,6 +44,25 @@ struct QEMUBH { bool deleted; }; +void aio_bh_schedule_oneshot(AioContext *ctx, QEMUBHFunc *cb, void *opaque) +{ + QEMUBH *bh; + bh = g_new(QEMUBH, 1); + *bh = (QEMUBH){ + .ctx = ctx, + .cb = cb, + .opaque = opaque, + }; + qemu_mutex_lock(&ctx->bh_lock); + bh->next = ctx->first_bh; + bh->scheduled = 1; + bh->deleted = 1; + /* Make sure that the members are ready before putting bh into list */ + smp_wmb(); + ctx->first_bh = bh; + qemu_mutex_unlock(&ctx->bh_lock); +} + QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque) { QEMUBH *bh; @@ -86,7 +105,7 @@ int aio_bh_poll(AioContext *ctx) * thread sees the zero before bh->cb has run, and thus will call * aio_notify again if necessary. */ - if (!bh->deleted && atomic_xchg(&bh->scheduled, 0)) { + if (atomic_xchg(&bh->scheduled, 0)) { /* Idle BHs and the notify BH don't count as progress */ if (!bh->idle && bh != ctx->notify_dummy_bh) { ret = 1; @@ -104,7 +123,7 @@ int aio_bh_poll(AioContext *ctx) bhp = &ctx->first_bh; while (*bhp) { bh = *bhp; - if (bh->deleted) { + if (bh->deleted && !bh->scheduled) { *bhp = bh->next; g_free(bh); } else { @@ -168,7 +187,7 @@ aio_compute_timeout(AioContext *ctx) QEMUBH *bh; for (bh = ctx->first_bh; bh; bh = bh->next) { - if (!bh->deleted && bh->scheduled) { + if (bh->scheduled) { if (bh->idle) { /* idle bottom halves will be polled at least * every 10ms */ @@ -216,7 +235,7 @@ aio_ctx_check(GSource *source) aio_notify_accept(ctx); for (bh = ctx->first_bh; bh; bh = bh->next) { - if (!bh->deleted && bh->scheduled) { + if (bh->scheduled) { return true; } } diff --git a/backends/msmouse.c b/backends/msmouse.c index aeb9055..85d08f7 100644 --- a/backends/msmouse.c +++ b/backends/msmouse.c @@ -139,7 +139,6 @@ static void msmouse_chr_close (struct CharDriverState *chr) qemu_input_handler_unregister(mouse->hs); g_free(mouse); - g_free(chr); } static QemuInputHandler msmouse_handler = { @@ -159,6 +158,9 @@ static CharDriverState *qemu_chr_open_msmouse(const char *id, CharDriverState *chr; chr = qemu_chr_alloc(common, errp); + if (!chr) { + return NULL; + } chr->chr_write = msmouse_chr_write; chr->chr_close = msmouse_chr_close; chr->chr_accept_input = msmouse_chr_accept_input; diff --git a/backends/rng-egd.c b/backends/rng-egd.c index 7a1b924..ba17c07 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -41,7 +41,9 @@ static void rng_egd_request_entropy(RngBackend *b, RngRequest *req) header[0] = 0x02; header[1] = len; - qemu_chr_fe_write(s->chr, header, sizeof(header)); + /* XXX this blocks entire thread. Rewrite to use + * qemu_chr_fe_write and background I/O callbacks */ + qemu_chr_fe_write_all(s->chr, header, sizeof(header)); size -= len; } diff --git a/block.c b/block.c index 30d64e6..7f3e7bc 100644 --- a/block.c +++ b/block.c @@ -25,7 +25,9 @@ #include "trace.h" #include "block/block_int.h" #include "block/blockjob.h" +#include "block/nbd.h" #include "qemu/error-report.h" +#include "module_block.h" #include "qemu/module.h" #include "qapi/qmp/qerror.h" #include "qapi/qmp/qbool.h" @@ -40,6 +42,7 @@ #include "qapi-event.h" #include "qemu/cutils.h" #include "qemu/id.h" +#include "qapi/util.h" #ifdef CONFIG_BSD #include <sys/ioctl.h> @@ -241,17 +244,40 @@ BlockDriverState *bdrv_new(void) return bs; } -BlockDriver *bdrv_find_format(const char *format_name) +static BlockDriver *bdrv_do_find_format(const char *format_name) { BlockDriver *drv1; + QLIST_FOREACH(drv1, &bdrv_drivers, list) { if (!strcmp(drv1->format_name, format_name)) { return drv1; } } + return NULL; } +BlockDriver *bdrv_find_format(const char *format_name) +{ + BlockDriver *drv1; + int i; + + drv1 = bdrv_do_find_format(format_name); + if (drv1) { + return drv1; + } + + /* The driver isn't registered, maybe we need to load a module */ + for (i = 0; i < (int)ARRAY_SIZE(block_driver_modules); ++i) { + if (!strcmp(block_driver_modules[i].format_name, format_name)) { + block_module_load_one(block_driver_modules[i].library_name); + break; + } + } + + return bdrv_do_find_format(format_name); +} + static int bdrv_is_whitelisted(BlockDriver *drv, bool read_only) { static const char *whitelist_rw[] = { @@ -460,6 +486,19 @@ static BlockDriver *find_hdev_driver(const char *filename) return drv; } +static BlockDriver *bdrv_do_find_protocol(const char *protocol) +{ + BlockDriver *drv1; + + QLIST_FOREACH(drv1, &bdrv_drivers, list) { + if (drv1->protocol_name && !strcmp(drv1->protocol_name, protocol)) { + return drv1; + } + } + + return NULL; +} + BlockDriver *bdrv_find_protocol(const char *filename, bool allow_protocol_prefix, Error **errp) @@ -468,6 +507,7 @@ BlockDriver *bdrv_find_protocol(const char *filename, char protocol[128]; int len; const char *p; + int i; /* TODO Drivers without bdrv_file_open must be specified explicitly */ @@ -494,15 +534,25 @@ BlockDriver *bdrv_find_protocol(const char *filename, len = sizeof(protocol) - 1; memcpy(protocol, filename, len); protocol[len] = '\0'; - QLIST_FOREACH(drv1, &bdrv_drivers, list) { - if (drv1->protocol_name && - !strcmp(drv1->protocol_name, protocol)) { - return drv1; + + drv1 = bdrv_do_find_protocol(protocol); + if (drv1) { + return drv1; + } + + for (i = 0; i < (int)ARRAY_SIZE(block_driver_modules); ++i) { + if (block_driver_modules[i].protocol_name && + !strcmp(block_driver_modules[i].protocol_name, protocol)) { + block_module_load_one(block_driver_modules[i].library_name); + break; } } - error_setg(errp, "Unknown protocol '%s'", protocol); - return NULL; + drv1 = bdrv_do_find_protocol(protocol); + if (!drv1) { + error_setg(errp, "Unknown protocol '%s'", protocol); + } + return drv1; } /* @@ -684,6 +734,9 @@ static void bdrv_temp_snapshot_options(int *child_flags, QDict *child_options, qdict_set_default_str(child_options, BDRV_OPT_CACHE_DIRECT, "off"); qdict_set_default_str(child_options, BDRV_OPT_CACHE_NO_FLUSH, "on"); + /* Copy the read-only option from the parent */ + qdict_copy_default(child_options, parent_options, BDRV_OPT_READ_ONLY); + /* aio=native doesn't work for cache.direct=off, so disable it for the * temporary snapshot */ *child_flags &= ~BDRV_O_NATIVE_AIO; @@ -706,10 +759,13 @@ static void bdrv_inherited_options(int *child_flags, QDict *child_options, qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_DIRECT); qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_NO_FLUSH); + /* Inherit the read-only option from the parent if it's not set */ + qdict_copy_default(child_options, parent_options, BDRV_OPT_READ_ONLY); + /* Our block drivers take care to send flushes and respect unmap policy, * so we can default to enable both on lower layers regardless of the * corresponding parent options. */ - flags |= BDRV_O_UNMAP; + qdict_set_default_str(child_options, BDRV_OPT_DISCARD, "unmap"); /* Clear flags that only apply to the top layer */ flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING | BDRV_O_COPY_ON_READ | @@ -759,7 +815,8 @@ static void bdrv_backing_options(int *child_flags, QDict *child_options, qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_NO_FLUSH); /* backing files always opened read-only */ - flags &= ~(BDRV_O_RDWR | BDRV_O_COPY_ON_READ); + qdict_set_default_str(child_options, BDRV_OPT_READ_ONLY, "on"); + flags &= ~BDRV_O_COPY_ON_READ; /* snapshot=on is handled on the top layer */ flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_TEMPORARY); @@ -806,6 +863,14 @@ static void update_flags_from_options(int *flags, QemuOpts *opts) if (qemu_opt_get_bool(opts, BDRV_OPT_CACHE_DIRECT, false)) { *flags |= BDRV_O_NOCACHE; } + + *flags &= ~BDRV_O_RDWR; + + assert(qemu_opt_find(opts, BDRV_OPT_READ_ONLY)); + if (!qemu_opt_get_bool(opts, BDRV_OPT_READ_ONLY, false)) { + *flags |= BDRV_O_RDWR; + } + } static void update_options_from_flags(QDict *options, int flags) @@ -818,6 +883,10 @@ static void update_options_from_flags(QDict *options, int flags) qdict_put(options, BDRV_OPT_CACHE_NO_FLUSH, qbool_from_bool(flags & BDRV_O_NO_FLUSH)); } + if (!qdict_haskey(options, BDRV_OPT_READ_ONLY)) { + qdict_put(options, BDRV_OPT_READ_ONLY, + qbool_from_bool(!(flags & BDRV_O_RDWR))); + } } static void bdrv_assign_node_name(BlockDriverState *bs, @@ -857,7 +926,7 @@ out: g_free(gen_node_name); } -static QemuOptsList bdrv_runtime_opts = { +QemuOptsList bdrv_runtime_opts = { .name = "bdrv_common", .head = QTAILQ_HEAD_INITIALIZER(bdrv_runtime_opts.head), .desc = { @@ -881,6 +950,21 @@ static QemuOptsList bdrv_runtime_opts = { .type = QEMU_OPT_BOOL, .help = "Ignore flush requests", }, + { + .name = BDRV_OPT_READ_ONLY, + .type = QEMU_OPT_BOOL, + .help = "Node is opened in read-only mode", + }, + { + .name = "detect-zeroes", + .type = QEMU_OPT_STRING, + .help = "try to optimize zero writes (off, on, unmap)", + }, + { + .name = "discard", + .type = QEMU_OPT_STRING, + .help = "discard operation (ignore/off, unmap/on)", + }, { /* end of list */ } }, }; @@ -897,6 +981,8 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file, const char *filename; const char *driver_name = NULL; const char *node_name = NULL; + const char *discard; + const char *detect_zeroes; QemuOpts *opts; BlockDriver *drv; Error *local_err = NULL; @@ -912,6 +998,8 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file, goto fail_opts; } + update_flags_from_options(&bs->open_flags, opts); + driver_name = qemu_opt_get(opts, "driver"); drv = bdrv_find_format(driver_name); assert(drv != NULL); @@ -963,6 +1051,41 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file, } } + discard = qemu_opt_get(opts, "discard"); + if (discard != NULL) { + if (bdrv_parse_discard_flags(discard, &bs->open_flags) != 0) { + error_setg(errp, "Invalid discard option"); + ret = -EINVAL; + goto fail_opts; + } + } + + detect_zeroes = qemu_opt_get(opts, "detect-zeroes"); + if (detect_zeroes) { + BlockdevDetectZeroesOptions value = + qapi_enum_parse(BlockdevDetectZeroesOptions_lookup, + detect_zeroes, + BLOCKDEV_DETECT_ZEROES_OPTIONS__MAX, + BLOCKDEV_DETECT_ZEROES_OPTIONS_OFF, + &local_err); + if (local_err) { + error_propagate(errp, local_err); + ret = -EINVAL; + goto fail_opts; + } + + if (value == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP && + !(bs->open_flags & BDRV_O_UNMAP)) + { + error_setg(errp, "setting detect-zeroes to unmap is not allowed " + "without setting discard operation to unmap"); + ret = -EINVAL; + goto fail_opts; + } + + bs->detect_zeroes = value; + } + if (filename != NULL) { pstrcpy(bs->filename, sizeof(bs->filename), filename); } else { @@ -973,9 +1096,6 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file, bs->drv = drv; bs->opaque = g_malloc0(drv->instance_size); - /* Apply cache mode options */ - update_flags_from_options(&bs->open_flags, opts); - /* Open the image, either directly or using a protocol */ open_flags = bdrv_open_flags(bs, bs->open_flags); if (drv->bdrv_file_open) { @@ -1311,6 +1431,23 @@ void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd) /* Otherwise we won't be able to commit due to check in bdrv_commit */ bdrv_op_unblock(backing_hd, BLOCK_OP_TYPE_COMMIT_TARGET, bs->backing_blocker); + /* + * We do backup in 3 ways: + * 1. drive backup + * The target bs is new opened, and the source is top BDS + * 2. blockdev backup + * Both the source and the target are top BDSes. + * 3. internal backup(used for block replication) + * Both the source and the target are backing file + * + * In case 1 and 2, neither the source nor the target is the backing file. + * In case 3, we will block the top BDS, so there is only one block job + * for the top BDS and its backing chain. + */ + bdrv_op_unblock(backing_hd, BLOCK_OP_TYPE_BACKUP_SOURCE, + bs->backing_blocker); + bdrv_op_unblock(backing_hd, BLOCK_OP_TYPE_BACKUP_TARGET, + bs->backing_blocker); out: bdrv_refresh_limits(bs, NULL); } @@ -1609,6 +1746,25 @@ static BlockDriverState *bdrv_open_inherit(const char *filename, goto fail; } + /* Set the BDRV_O_RDWR and BDRV_O_ALLOW_RDWR flags. + * FIXME: we're parsing the QDict to avoid having to create a + * QemuOpts just for this, but neither option is optimal. */ + if (g_strcmp0(qdict_get_try_str(options, BDRV_OPT_READ_ONLY), "on") && + !qdict_get_try_bool(options, BDRV_OPT_READ_ONLY, false)) { + flags |= (BDRV_O_RDWR | BDRV_O_ALLOW_RDWR); + } else { + flags &= ~BDRV_O_RDWR; + } + + if (flags & BDRV_O_SNAPSHOT) { + snapshot_options = qdict_new(); + bdrv_temp_snapshot_options(&snapshot_flags, snapshot_options, + flags, options); + /* Let bdrv_backing_options() override "read-only" */ + qdict_del(options, BDRV_OPT_READ_ONLY); + bdrv_backing_options(&flags, options, flags, options); + } + bs->open_flags = flags; bs->options = options; options = qdict_clone_shallow(options); @@ -1633,18 +1789,6 @@ static BlockDriverState *bdrv_open_inherit(const char *filename, /* Open image file without format layer */ if ((flags & BDRV_O_PROTOCOL) == 0) { - if (flags & BDRV_O_RDWR) { - flags |= BDRV_O_ALLOW_RDWR; - } - if (flags & BDRV_O_SNAPSHOT) { - snapshot_options = qdict_new(); - bdrv_temp_snapshot_options(&snapshot_flags, snapshot_options, - flags, options); - bdrv_backing_options(&flags, options, flags, options); - } - - bs->open_flags = flags; - file = bdrv_open_child(filename, options, "file", bs, &child_file, true, &local_err); if (local_err) { @@ -1829,6 +1973,13 @@ static BlockReopenQueue *bdrv_reopen_queue_child(BlockReopenQueue *bs_queue, options = qdict_new(); } + /* Check if this BlockDriverState is already in the queue */ + QSIMPLEQ_FOREACH(bs_entry, bs_queue, entry) { + if (bs == bs_entry->state.bs) { + break; + } + } + /* * Precedence of options: * 1. Explicitly passed in options (highest) @@ -1849,7 +2000,11 @@ static BlockReopenQueue *bdrv_reopen_queue_child(BlockReopenQueue *bs_queue, } /* Old explicitly set values (don't overwrite by inherited value) */ - old_options = qdict_clone_shallow(bs->explicit_options); + if (bs_entry) { + old_options = qdict_clone_shallow(bs_entry->state.explicit_options); + } else { + old_options = qdict_clone_shallow(bs->explicit_options); + } bdrv_join_options(bs, options, old_options); QDECREF(old_options); @@ -1888,8 +2043,13 @@ static BlockReopenQueue *bdrv_reopen_queue_child(BlockReopenQueue *bs_queue, child->role, options, flags); } - bs_entry = g_new0(BlockReopenQueueEntry, 1); - QSIMPLEQ_INSERT_TAIL(bs_queue, bs_entry, entry); + if (!bs_entry) { + bs_entry = g_new0(BlockReopenQueueEntry, 1); + QSIMPLEQ_INSERT_TAIL(bs_queue, bs_entry, entry); + } else { + QDECREF(bs_entry->state.options); + QDECREF(bs_entry->state.explicit_options); + } bs_entry->state.bs = bs; bs_entry->state.options = options; @@ -2206,6 +2366,7 @@ static void bdrv_close(BlockDriverState *bs) void bdrv_close_all(void) { block_job_cancel_sync_all(); + nbd_export_close_all(); /* Drop references from requests still in flight, such as canceled block * jobs whose AIO context has not been polled yet */ @@ -2946,11 +3107,6 @@ bool bdrv_debug_is_suspended(BlockDriverState *bs, const char *tag) return false; } -int bdrv_is_snapshot(BlockDriverState *bs) -{ - return !!(bs->open_flags & BDRV_O_SNAPSHOT); -} - /* backing_file can either be relative, or absolute, or a protocol. If it is * relative, it must be relative to the chain. So, passing in bs->filename * from a BDS as backing_file should not be done, as that may be relative to @@ -3204,17 +3360,10 @@ int bdrv_media_changed(BlockDriverState *bs) void bdrv_eject(BlockDriverState *bs, bool eject_flag) { BlockDriver *drv = bs->drv; - const char *device_name; if (drv && drv->bdrv_eject) { drv->bdrv_eject(bs, eject_flag); } - - device_name = bdrv_get_device_name(bs); - if (device_name[0] != '\0') { - qapi_event_send_device_tray_moved(device_name, - eject_flag, &error_abort); - } } /** diff --git a/block/Makefile.objs b/block/Makefile.objs index 2593a2f..67a036a 100644 --- a/block/Makefile.objs +++ b/block/Makefile.objs @@ -1,8 +1,8 @@ -block-obj-y += raw_bsd.o qcow.o vdi.o vmdk.o cloop.o bochs.o vpc.o vvfat.o +block-obj-y += raw_bsd.o qcow.o vdi.o vmdk.o cloop.o bochs.o vpc.o vvfat.o dmg.o block-obj-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o block-obj-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o block-obj-y += qed-check.o -block-obj-$(CONFIG_VHDX) += vhdx.o vhdx-endian.o vhdx-log.o +block-obj-y += vhdx.o vhdx-endian.o vhdx-log.o block-obj-y += quorum.o block-obj-y += parallels.o blkdebug.o blkverify.o blkreplay.o block-obj-y += block-backend.o snapshot.o qapi.o @@ -22,12 +22,14 @@ block-obj-$(CONFIG_ARCHIPELAGO) += archipelago.o block-obj-$(CONFIG_LIBSSH2) += ssh.o block-obj-y += accounting.o dirty-bitmap.o block-obj-y += write-threshold.o +block-obj-y += backup.o +block-obj-$(CONFIG_REPLICATION) += replication.o block-obj-y += crypto.o common-obj-y += stream.o -common-obj-y += backup.o +nfs.o-libs := $(LIBNFS_LIBS) iscsi.o-cflags := $(LIBISCSI_CFLAGS) iscsi.o-libs := $(LIBISCSI_LIBS) curl.o-cflags := $(CURL_CFLAGS) @@ -39,7 +41,7 @@ gluster.o-libs := $(GLUSTERFS_LIBS) ssh.o-cflags := $(LIBSSH2_CFLAGS) ssh.o-libs := $(LIBSSH2_LIBS) archipelago.o-libs := $(ARCHIPELAGO_LIBS) -block-obj-m += dmg.o -dmg.o-libs := $(BZIP2_LIBS) +block-obj-$(if $(CONFIG_BZIP2),m,n) += dmg-bz2.o +dmg-bz2.o-libs := $(BZIP2_LIBS) qcow.o-libs := -lz linux-aio.o-libs := -laio diff --git a/block/archipelago.c b/block/archipelago.c index 37b8aca..2449cfc 100644 --- a/block/archipelago.c +++ b/block/archipelago.c @@ -87,7 +87,6 @@ typedef enum { typedef struct ArchipelagoAIOCB { BlockAIOCB common; - QEMUBH *bh; struct BDRVArchipelagoState *s; QEMUIOVector *qiov; ARCHIPCmd cmd; @@ -154,11 +153,10 @@ static void archipelago_finish_aiocb(AIORequestData *reqdata) } else if (reqdata->aio_cb->ret == reqdata->segreq->total) { reqdata->aio_cb->ret = 0; } - reqdata->aio_cb->bh = aio_bh_new( + aio_bh_schedule_oneshot( bdrv_get_aio_context(reqdata->aio_cb->common.bs), qemu_archipelago_complete_aio, reqdata ); - qemu_bh_schedule(reqdata->aio_cb->bh); } static int wait_reply(struct xseg *xseg, xport srcport, struct xseg_port *port, @@ -313,7 +311,6 @@ static void qemu_archipelago_complete_aio(void *opaque) AIORequestData *reqdata = (AIORequestData *) opaque; ArchipelagoAIOCB *aio_cb = (ArchipelagoAIOCB *) reqdata->aio_cb; - qemu_bh_delete(aio_cb->bh); aio_cb->common.cb(aio_cb->common.opaque, aio_cb->ret); aio_cb->status = 0; diff --git a/block/backup.c b/block/backup.c index 2c05323..582bd0f 100644 --- a/block/backup.c +++ b/block/backup.c @@ -17,6 +17,7 @@ #include "block/block.h" #include "block/block_int.h" #include "block/blockjob.h" +#include "block/block_backup.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "qemu/ratelimit.h" @@ -27,13 +28,6 @@ #define BACKUP_CLUSTER_SIZE_DEFAULT (1 << 16) #define SLICE_TIME 100000000ULL /* ns */ -typedef struct CowRequest { - int64_t start; - int64_t end; - QLIST_ENTRY(CowRequest) list; - CoQueue wait_queue; /* coroutines blocked on this request */ -} CowRequest; - typedef struct BackupBlockJob { BlockJob common; BlockBackend *target; @@ -47,6 +41,7 @@ typedef struct BackupBlockJob { uint64_t sectors_read; unsigned long *done_bitmap; int64_t cluster_size; + bool compress; NotifierWithReturn before_write; QLIST_HEAD(, CowRequest) inflight_reqs; } BackupBlockJob; @@ -154,7 +149,8 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *job, bounce_qiov.size, BDRV_REQ_MAY_UNMAP); } else { ret = blk_co_pwritev(job->target, start * job->cluster_size, - bounce_qiov.size, &bounce_qiov, 0); + bounce_qiov.size, &bounce_qiov, + job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0); } if (ret < 0) { trace_backup_do_cow_write_fail(job, start, ret); @@ -253,6 +249,57 @@ static void backup_attached_aio_context(BlockJob *job, AioContext *aio_context) blk_set_aio_context(s->target, aio_context); } +void backup_do_checkpoint(BlockJob *job, Error **errp) +{ + BackupBlockJob *backup_job = container_of(job, BackupBlockJob, common); + int64_t len; + + assert(job->driver->job_type == BLOCK_JOB_TYPE_BACKUP); + + if (backup_job->sync_mode != MIRROR_SYNC_MODE_NONE) { + error_setg(errp, "The backup job only supports block checkpoint in" + " sync=none mode"); + return; + } + + len = DIV_ROUND_UP(backup_job->common.len, backup_job->cluster_size); + bitmap_zero(backup_job->done_bitmap, len); +} + +void backup_wait_for_overlapping_requests(BlockJob *job, int64_t sector_num, + int nb_sectors) +{ + BackupBlockJob *backup_job = container_of(job, BackupBlockJob, common); + int64_t sectors_per_cluster = cluster_size_sectors(backup_job); + int64_t start, end; + + assert(job->driver->job_type == BLOCK_JOB_TYPE_BACKUP); + + start = sector_num / sectors_per_cluster; + end = DIV_ROUND_UP(sector_num + nb_sectors, sectors_per_cluster); + wait_for_overlapping_requests(backup_job, start, end); +} + +void backup_cow_request_begin(CowRequest *req, BlockJob *job, + int64_t sector_num, + int nb_sectors) +{ + BackupBlockJob *backup_job = container_of(job, BackupBlockJob, common); + int64_t sectors_per_cluster = cluster_size_sectors(backup_job); + int64_t start, end; + + assert(job->driver->job_type == BLOCK_JOB_TYPE_BACKUP); + + start = sector_num / sectors_per_cluster; + end = DIV_ROUND_UP(sector_num + nb_sectors, sectors_per_cluster); + cow_request_begin(req, backup_job, start, end); +} + +void backup_cow_request_end(CowRequest *req) +{ + cow_request_end(req); +} + static const BlockJobDriver backup_job_driver = { .instance_size = sizeof(BackupBlockJob), .job_type = BLOCK_JOB_TYPE_BACKUP, @@ -477,6 +524,7 @@ static void coroutine_fn backup_run(void *opaque) void backup_start(const char *job_id, BlockDriverState *bs, BlockDriverState *target, int64_t speed, MirrorSyncMode sync_mode, BdrvDirtyBitmap *sync_bitmap, + bool compress, BlockdevOnError on_source_error, BlockdevOnError on_target_error, BlockCompletionFunc *cb, void *opaque, @@ -507,6 +555,12 @@ void backup_start(const char *job_id, BlockDriverState *bs, return; } + if (compress && target->drv->bdrv_co_pwritev_compressed == NULL) { + error_setg(errp, "Compression is not supported for this drive %s", + bdrv_get_device_name(target)); + return; + } + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP_SOURCE, errp)) { return; } @@ -555,6 +609,7 @@ void backup_start(const char *job_id, BlockDriverState *bs, job->sync_mode = sync_mode; job->sync_bitmap = sync_mode == MIRROR_SYNC_MODE_INCREMENTAL ? sync_bitmap : NULL; + job->compress = compress; /* If there is no backing file on the target, we cannot rely on COW if our * backup cluster size is smaller than the target cluster size. Even for diff --git a/block/blkdebug.c b/block/blkdebug.c index d5db166..4127571 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -49,7 +49,6 @@ typedef struct BDRVBlkdebugState { typedef struct BlkdebugAIOCB { BlockAIOCB common; - QEMUBH *bh; int ret; } BlkdebugAIOCB; @@ -410,7 +409,6 @@ out: static void error_callback_bh(void *opaque) { struct BlkdebugAIOCB *acb = opaque; - qemu_bh_delete(acb->bh); acb->common.cb(acb->common.opaque, acb->ret); qemu_aio_unref(acb); } @@ -421,7 +419,6 @@ static BlockAIOCB *inject_error(BlockDriverState *bs, BDRVBlkdebugState *s = bs->opaque; int error = rule->options.inject.error; struct BlkdebugAIOCB *acb; - QEMUBH *bh; bool immediately = rule->options.inject.immediately; if (rule->options.inject.once) { @@ -436,9 +433,7 @@ static BlockAIOCB *inject_error(BlockDriverState *bs, acb = qemu_aio_get(&blkdebug_aiocb_info, bs, cb, opaque); acb->ret = -error; - bh = aio_bh_new(bdrv_get_aio_context(bs), error_callback_bh, acb); - acb->bh = bh; - qemu_bh_schedule(bh); + aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), error_callback_bh, acb); return &acb->common; } diff --git a/block/blkreplay.c b/block/blkreplay.c index 30f9d5f..a741654 100755 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -20,11 +20,6 @@ typedef struct Request { QEMUBH *bh; } Request; -/* Next request id. - This counter is global, because requests from different - block devices should not get overlapping ids. */ -static uint64_t request_id; - static int blkreplay_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { @@ -84,7 +79,7 @@ static void block_request_create(uint64_t reqid, BlockDriverState *bs, static int coroutine_fn blkreplay_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { - uint64_t reqid = request_id++; + uint64_t reqid = blkreplay_next_id(); int ret = bdrv_co_preadv(bs->file, offset, bytes, qiov, flags); block_request_create(reqid, bs, qemu_coroutine_self()); qemu_coroutine_yield(); @@ -95,7 +90,7 @@ static int coroutine_fn blkreplay_co_preadv(BlockDriverState *bs, static int coroutine_fn blkreplay_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { - uint64_t reqid = request_id++; + uint64_t reqid = blkreplay_next_id(); int ret = bdrv_co_pwritev(bs->file, offset, bytes, qiov, flags); block_request_create(reqid, bs, qemu_coroutine_self()); qemu_coroutine_yield(); @@ -106,7 +101,7 @@ static int coroutine_fn blkreplay_co_pwritev(BlockDriverState *bs, static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags) { - uint64_t reqid = request_id++; + uint64_t reqid = blkreplay_next_id(); int ret = bdrv_co_pwrite_zeroes(bs->file, offset, count, flags); block_request_create(reqid, bs, qemu_coroutine_self()); qemu_coroutine_yield(); @@ -117,7 +112,7 @@ static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs, static int coroutine_fn blkreplay_co_pdiscard(BlockDriverState *bs, int64_t offset, int count) { - uint64_t reqid = request_id++; + uint64_t reqid = blkreplay_next_id(); int ret = bdrv_co_pdiscard(bs->file->bs, offset, count); block_request_create(reqid, bs, qemu_coroutine_self()); qemu_coroutine_yield(); @@ -127,7 +122,7 @@ static int coroutine_fn blkreplay_co_pdiscard(BlockDriverState *bs, static int coroutine_fn blkreplay_co_flush(BlockDriverState *bs) { - uint64_t reqid = request_id++; + uint64_t reqid = blkreplay_next_id(); int ret = bdrv_co_flush(bs->file->bs); block_request_create(reqid, bs, qemu_coroutine_self()); qemu_coroutine_yield(); diff --git a/block/blkverify.c b/block/blkverify.c index da62d75..28f9af6 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -22,7 +22,6 @@ typedef struct { typedef struct BlkverifyAIOCB BlkverifyAIOCB; struct BlkverifyAIOCB { BlockAIOCB common; - QEMUBH *bh; /* Request metadata */ bool is_write; @@ -175,7 +174,6 @@ static BlkverifyAIOCB *blkverify_aio_get(BlockDriverState *bs, bool is_write, { BlkverifyAIOCB *acb = qemu_aio_get(&blkverify_aiocb_info, bs, cb, opaque); - acb->bh = NULL; acb->is_write = is_write; acb->sector_num = sector_num; acb->nb_sectors = nb_sectors; @@ -191,7 +189,6 @@ static void blkverify_aio_bh(void *opaque) { BlkverifyAIOCB *acb = opaque; - qemu_bh_delete(acb->bh); if (acb->buf) { qemu_iovec_destroy(&acb->raw_qiov); qemu_vfree(acb->buf); @@ -218,9 +215,8 @@ static void blkverify_aio_cb(void *opaque, int ret) acb->verify(acb); } - acb->bh = aio_bh_new(bdrv_get_aio_context(acb->common.bs), - blkverify_aio_bh, acb); - qemu_bh_schedule(acb->bh); + aio_bh_schedule_oneshot(bdrv_get_aio_context(acb->common.bs), + blkverify_aio_bh, acb); break; } } diff --git a/block/block-backend.c b/block/block-backend.c index effa038..1a724a8 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -38,6 +38,7 @@ struct BlockBackend { BlockBackendPublic public; void *dev; /* attached device model, if any */ + bool legacy_dev; /* true if dev is not a DeviceState */ /* TODO change to DeviceState when all users are qdevified */ const BlockDevOps *dev_ops; void *dev_opaque; @@ -65,7 +66,6 @@ struct BlockBackend { typedef struct BlockBackendAIOCB { BlockAIOCB common; - QEMUBH *bh; BlockBackend *blk; int ret; } BlockBackendAIOCB; @@ -410,6 +410,22 @@ bool bdrv_has_blk(BlockDriverState *bs) } /* + * Returns true if @bs has only BlockBackends as parents. + */ +bool bdrv_is_root_node(BlockDriverState *bs) +{ + BdrvChild *c; + + QLIST_FOREACH(c, &bs->parents, next_parent) { + if (c->role != &child_root) { + return false; + } + } + + return true; +} + +/* * Return @blk's DriveInfo if any, else null. */ DriveInfo *blk_legacy_dinfo(BlockBackend *blk) @@ -491,32 +507,38 @@ void blk_insert_bs(BlockBackend *blk, BlockDriverState *bs) } } -/* - * Attach device model @dev to @blk. - * Return 0 on success, -EBUSY when a device model is attached already. - */ -int blk_attach_dev(BlockBackend *blk, void *dev) -/* TODO change to DeviceState *dev when all users are qdevified */ +static int blk_do_attach_dev(BlockBackend *blk, void *dev) { if (blk->dev) { return -EBUSY; } blk_ref(blk); blk->dev = dev; + blk->legacy_dev = false; blk_iostatus_reset(blk); return 0; } /* * Attach device model @dev to @blk. + * Return 0 on success, -EBUSY when a device model is attached already. + */ +int blk_attach_dev(BlockBackend *blk, DeviceState *dev) +{ + return blk_do_attach_dev(blk, dev); +} + +/* + * Attach device model @dev to @blk. * @blk must not have a device model attached already. * TODO qdevified devices don't use this, remove when devices are qdevified */ -void blk_attach_dev_nofail(BlockBackend *blk, void *dev) +void blk_attach_dev_legacy(BlockBackend *blk, void *dev) { - if (blk_attach_dev(blk, dev) < 0) { + if (blk_do_attach_dev(blk, dev) < 0) { abort(); } + blk->legacy_dev = true; } /* @@ -543,6 +565,42 @@ void *blk_get_attached_dev(BlockBackend *blk) return blk->dev; } +/* Return the qdev ID, or if no ID is assigned the QOM path, of the block + * device attached to the BlockBackend. */ +static char *blk_get_attached_dev_id(BlockBackend *blk) +{ + DeviceState *dev; + + assert(!blk->legacy_dev); + dev = blk->dev; + + if (!dev) { + return g_strdup(""); + } else if (dev->id) { + return g_strdup(dev->id); + } + return object_get_canonical_path(OBJECT(dev)); +} + +/* + * Return the BlockBackend which has the device model @dev attached if it + * exists, else null. + * + * @dev must not be null. + */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |