Skip to content
Snippets Groups Projects
  1. Jul 18, 2016
  2. Jul 15, 2016
  3. Jul 14, 2016
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160714' into staging · 14c7d993
      Peter Maydell authored
      
      target-arm queue:
       * add virtio-mmio transport base address to device path
         (avoid an assertion failure with multiple virtio-scsi-devices)
       * revert hw/ptimer commit 5a50307b which causes regressions on
         SPARC guests
       * use Neon to accelerate zero-page checking on AArch64 hosts
       * set the MPIDR for TCG to match how KVM does it (and fit with
         GICv2/GICv3 restrictions on SGI target lists)
       * add some missing AArch32 TLBI hypervisor TLB operations
       * m25p80: Fix QIOR/DIOR handling for Winbond
       * hw/misc: fix typo in Aspeed SCU hw-strap2 property name
       * ast2400: pretend DMAs are done for U-boot
       * ast2400: some minor code cleanups
      
      # gpg: Signature made Thu 14 Jul 2016 17:21:30 BST
      # gpg:                using RSA key 0x3C2525ED14360CDE
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>"
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>"
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20160714:
        ast2400: externalize revision numbers
        ast2400: pretend DMAs are done for U-boot
        ast2400: replace aspeed_smc_is_implemented()
        hw/misc: fix typo in Aspeed SCU hw-strap2 property name
        m25p80: Fix QIOR/DIOR handling for Winbond
        target-arm: Add missed AArch32 TLBI sytem registers
        hw/arm/virt: tcg: adjust MPIDR like KVM
        gic: provide defines for v2/v3 targetlist sizes
        target-arm: Use Neon for zero checking
        Revert "hw/ptimer: Perform counter wrap around if timer already expired"
        virtio-mmio: format transport base address in BusClass.get_dev_path
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      14c7d993
    • Cédric Le Goater's avatar
      ast2400: externalize revision numbers · 79a9f323
      Cédric Le Goater authored
      
      AST2400_A0_SILICON_REV is defined twice. Fix this by including the
      definition in the header file as well as the routine to check if a
      silicon revision is supported. It will useful to reuse in other
      controllers.
      
      Let's add also AST2500_A0_SILICON_REV for future use.
      
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Message-id: 1467994016-11678-5-git-send-email-clg@kaod.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      79a9f323
    • Cédric Le Goater's avatar
      ast2400: pretend DMAs are done for U-boot · 2e1f0502
      Cédric Le Goater authored
      
      U-boot does SPI timing calibration using DMA tranfers. To let the
      initialization continue, we fake success by setting the DMA status of
      the Interrupt Control Register.
      
      For the moment, DMA support is not required as it is not used in
      normal operation.
      
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Message-id: 1467994016-11678-4-git-send-email-clg@kaod.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      2e1f0502
    • Cédric Le Goater's avatar
      ast2400: replace aspeed_smc_is_implemented() · 97c2ed5d
      Cédric Le Goater authored
      
      aspeed_smc_is_implemented() filters invalid registers in a peculiar
      way. Let's remove it and open code the if conditions. It serves the
      same purpose, the aesthetic is better, and new registers can easily be
      added.
      
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Message-id: 1467994016-11678-3-git-send-email-clg@kaod.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      97c2ed5d
    • Cédric Le Goater's avatar
      hw/misc: fix typo in Aspeed SCU hw-strap2 property name · 2ddfa281
      Cédric Le Goater authored
      
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Message-id: 1467994016-11678-2-git-send-email-clg@kaod.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      2ddfa281
    • Marcin Krzeminski's avatar
      m25p80: Fix QIOR/DIOR handling for Winbond · fe847705
      Marcin Krzeminski authored
      
      Winbond also support continuous read mode, but as an opposite for other
      flash type read mode clock cycles are included to dummy cycles number.
      This path add proper handling of read mode byte and update needed
      dummy cycles. QPI mode and dummy cycles configuration are not supported.
      
      Signed-off-by: default avatarMarcin Krzeminski <marcin.krzeminski@nokia.com>
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Message-id: 1467809036-6986-1-git-send-email-marcin.krzeminski@nokia.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      fe847705
    • Sergey Sorokin's avatar
      target-arm: Add missed AArch32 TLBI sytem registers · 541ef8c2
      Sergey Sorokin authored
      
      Some PL2 related TLBI system registers are missed in AArch32
      implementation. The patch fixes it.
      
      Signed-off-by: default avatarSergey Sorokin <afarallax@yandex.ru>
      Message-id: 1468328885-3217862-1-git-send-email-afarallax@yandex.ru
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      541ef8c2
    • Andrew Jones's avatar
      hw/arm/virt: tcg: adjust MPIDR like KVM · 95eb49c8
      Andrew Jones authored
      
      KVM adjusts the MPIDR of guest vcpus based on the architecture of
      the host, 32-bit vs. 64-bit, and, for 64-bit, also on the type of
      GIC the guest is using. To be consistent and improve SGI efficiency
      we make the same adjustments for TCG as 64-bit KVM hosts. We neglect
      to add consistency with 32-bit KVM hosts, as that would reduce SGI
      efficiency and KVM is expected to change.
      
      As MPIDR is a system register, and thus guest visible, we only make
      adjustments for current and later versioned machines.
      
      Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
      Message-id: 1467378129-23302-3-git-send-email-drjones@redhat.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      95eb49c8
    • Andrew Jones's avatar
      gic: provide defines for v2/v3 targetlist sizes · c8efd802
      Andrew Jones authored
      
      Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
      Message-id: 1467378129-23302-2-git-send-email-drjones@redhat.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      c8efd802
    • Vijaya Kumar K's avatar
      target-arm: Use Neon for zero checking · 7069532e
      Vijaya Kumar K authored
      
      Use Neon instructions to perform zero checking of
      buffer. This is helps in reducing total migration time.
      
      Use case: Idle VM live migration with 4 VCPUS and 8GB ram
      running CentOS 7.
      
      Without Neon, the Total migration time is 3.5 Sec
      
      Migration status: completed
      total time: 3560 milliseconds
      downtime: 33 milliseconds
      setup: 5 milliseconds
      transferred ram: 297907 kbytes
      throughput: 685.76 mbps
      remaining ram: 0 kbytes
      total ram: 8519872 kbytes
      duplicate: 2062760 pages
      skipped: 0 pages
      normal: 69808 pages
      normal bytes: 279232 kbytes
      dirty sync count: 3
      
      With Neon, the total migration time is 2.9 Sec
      
      Migration status: completed
      total time: 2960 milliseconds
      downtime: 65 milliseconds
      setup: 4 milliseconds
      transferred ram: 299869 kbytes
      throughput: 830.19 mbps
      remaining ram: 0 kbytes
      total ram: 8519872 kbytes
      duplicate: 2064313 pages
      skipped: 0 pages
      normal: 70294 pages
      normal bytes: 281176 kbytes
      dirty sync count: 3
      
      Signed-off-by: default avatarVijaya Kumar K <vijayak@cavium.com>
      Signed-off-by: default avatarSuresh <ksuresh@cavium.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1467190029-694-2-git-send-email-vijayak@cavium.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      7069532e
    • Dmitry Osipenko's avatar
      Revert "hw/ptimer: Perform counter wrap around if timer already expired" · 56215da3
      Dmitry Osipenko authored
      
      Software should see timer counter wraparound only after IRQ being triggered.
      This fixes regression introduced by the commit 5a50307b ("hw/ptimer: Perform
      counter wrap around if timer already expired"), resulting in monotonic timer
      jumping backwards on SPARC emulated machine running NetBSD guest OS, as
      reported by Mark Cave-Ayland.
      
      Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
      Message-id: 20160708132206.2080-1-digetx@gmail.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      56215da3
    • Laszlo Ersek's avatar
      virtio-mmio: format transport base address in BusClass.get_dev_path · f58b39d2
      Laszlo Ersek authored
      
      At the moment the following QEMU command line triggers an assertion
      failure (minimal reproducer by Cole):
      
        qemu-system-aarch64 \
          -machine virt-2.6,accel=tcg \
          -nodefaults \
          -no-user-config \
          -nographic -monitor stdio \
          -device virtio-scsi-device,id=scsi0 \
          -device virtio-scsi-device,id=scsi1 \
          -drive file=foo.img,format=raw,if=none,id=d0 \
          -device scsi-hd,bus=scsi0.0,drive=d0 \
          -drive file=foo.img,format=raw,if=none,id=d1 \
          -device scsi-hd,bus=scsi1.0,drive=d1
      
        qemu-system-aarch64: migration/savevm.c:615:
        vmstate_register_with_alias_id:
        Assertion `!se->compat || se->instance_id == 0' failed.
      
      The reason is that the vmstate sections for the two scsi-hd devices are
      not uniquely identifiable by name.
      
      The direct parent buses of the scsi-hd devices -- scsi0.0 and scsi1.0 --
      support the BusClass.get_dev_path member function. scsibus_get_dev_path()
      formats a device path prefix with the help of its topologically parent
      bus, and then appends the chan:id:lun triplet to it. For both scsi-hd
      devices, this triplet is 0:0:0.
      
      (Here we use "device path" in the QEMU migration sense, for vmstate
      section identification, not in the OFW or UEFI device path senses.)
      
      The virtio-scsi HBA is plugged into the virtio-mmio bus (implemented by
      the internal VirtIOMMIOProxy device). This bus class
      (TYPE_VIRTIO_MMIO_BUS) inherits, as its get_dev_path() member function,
      the virtio_bus_get_dev_path() method from its parent class
      (TYPE_VIRTIO_BUS).
      
      virtio_bus_get_dev_path() does not format any kind of device address on
      its own; "virtio addresses" are transport-specific. Therefore
      virtio_bus_get_dev_path() asks the topologically parent bus of the proxy
      object (implementing the specific virtio transport) to format the address
      of the proxy object.
      
      (For virtio-pci devices (where the proxy is an instance of VirtIOPCIProxy,
      plugged into a PCI bus), this ends up in pcibus_get_dev_path().)
      
      However, VirtIOMMIOProxy is usually (in practice: always) plugged into
      "main-system-bus", the singleton TYPE_SYSTEM_BUS object. This BusClass
      does not support formatting QEMU vmstate device paths at all (as
      SysBusDevice objects can have zero or more IO ports and zero or more MMIO
      regions). Hence the formatting request delegated from
      virtio_bus_get_dev_path() gets answered with NULL.
      
      The end result is that the two scsi-hd devices end up with the same device
      path "0:0:0", which triggers the assert.
      
      We can solve this by recognizing that virtio-mmio transports are
      distinguished from each other by their base addresses in MMIO address
      space. Implement virtio_mmio_bus_get_dev_path() as follows:
      
      (1) The virtio device whose devpath is to be formatted resides on a
          virtio-mmio bus that is implemented by a VirtIOMMIOProxy object. Ask
          the parent bus of VirtIOMMIOProxy to format the device path of
          VirtIOMMIOProxy, as a path prefix. (This is identical to what
          virtio_bus_get_dev_path() does.)
      
      (2) Append the base address of VirtIOMMIOProxy to the device path, such
          as:
          - virtio-mmio@000000000a003e00,
          - virtio-mmio@000000000a003c00.
      
      Given that these device paths are placed in the migration stream, step (2)
      above, if done unconditionally, would break migration. So make that step
      conditional on a new VirtIOMMIOProxy property, which is enabled for 2.7
      machine types and later.
      
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Cole Robinson <crobinso@redhat.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Cc: Kevin Zhao <kevin.zhao@linaro.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Tom Hanson <thomas.hanson@linaro.org>
      Reported-by: default avatarKevin Zhao <kevin.zhao@linaro.org>
      Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Message-id: 1467739394-28357-1-git-send-email-lersek@redhat.com
      Fixes: https://bugs.launchpad.net/qemu/+bug/1594239
      
      
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f58b39d2
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream-fwcfg' into staging · 1c8e93fb
      Peter Maydell authored
      
      * Updated fw_cfg option ROM to include DMA support
      
      # gpg: Signature made Thu 14 Jul 2016 14:51:06 BST
      # gpg:                using RSA key 0xBFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream-fwcfg:
        Add optionrom compatible with fw_cfg DMA version
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      1c8e93fb
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/xtensa/tags/20160714-xtensa' into staging · 22e28174
      Peter Maydell authored
      
      Xtensa-related fixes:
      
      - fix FLASH interface width for XTFPGA boards.
      
      # gpg: Signature made Thu 14 Jul 2016 12:00:05 BST
      # gpg:                using RSA key 0x51F9CC91F83FA044
      # gpg: Good signature from "Max Filippov <max.filippov@cogentembedded.com>"
      # gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>"
      # Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044
      
      * remotes/xtensa/tags/20160714-xtensa:
        target-xtensa: xtfpga: fix FLASH interface width
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      22e28174
    • Marc Marí's avatar
      Add optionrom compatible with fw_cfg DMA version · b2a575a1
      Marc Marí authored
      
      This optionrom is based on linuxboot.S.
      
      Signed-off-by: default avatarMarc Marí <markmb@redhat.com>
      Signed-off-by: default avatarRichard W.M. Jones <rjones@redhat.com>
      Message-Id: <1464027093-24073-2-git-send-email-rjones@redhat.com>
      [Add -fno-toplevel-reorder, support clang without -m16. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b2a575a1
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 190c93c9
      Peter Maydell authored
      
      * SCSI scanner support
      * fixes to qemu-char and net exit
      * FreeBSD fixes
      * Other small bugfixes
      
      # gpg: Signature made Wed 13 Jul 2016 12:30:11 BST
      # gpg:                using RSA key 0xBFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream:
        hostmem: detect host backend memory is being used properly
        hostmem: fix QEMU crash by 'info memdev'
        char: do not use atexit cleanup handler
        net: do not use atexit for cleanup
        slirp: use exit notifier for slirp_smb_cleanup
        tap: use an exit notifier to call down_script
        util: Fix MIN_NON_ZERO
        qemu-sockets: use qapi_free_SocketAddress in cleanup
        disas: avoid including everything in headers compiled from C++
        json-streamer: fix double-free on exiting during a parse
        main-loop: check return value before using pointer
        Use "-s" instead of "--quiet" to resolve non-fatal build error on FreeBSD.
        scsi-bus: Use longer sense buffer with scanners
        scsi-bus: Add SCSI scanner support
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      190c93c9
    • Max Filippov's avatar
      target-xtensa: xtfpga: fix FLASH interface width · f9a555e4
      Max Filippov authored
      
      FLASH chip on XTFPGA boards is connected with 16-bit-wide interface.
      Latest U-Boot can see the difference and does not work correctly with
      32-bit-wide interface.
      Set FLASH chip 'width' property to 2.
      
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      f9a555e4
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 9358450e
      Peter Maydell authored
      
      Block layer patches
      
      # gpg: Signature made Wed 13 Jul 2016 12:46:17 BST
      # gpg:                using RSA key 0x7F09B272C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
      # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
      
      * remotes/kevin/tags/for-upstream: (34 commits)
        iotests: Make 157 actually format-agnostic
        vvfat: Fix qcow write target driver specification
        hmp: show all of snapshot info on every block dev in output of 'info snapshots'
        hmp: use snapshot name to determine whether a snapshot is 'fully available'
        qemu-iotests: Test naming of throttling groups
        blockdev: Fix regression with the default naming of throttling groups
        vmdk: fix metadata write regression
        Improve block job rate limiting for small bandwidth values
        qcow2: Fix qcow2_get_cluster_offset()
        qemu-io: Use correct range limitations
        qcow2: Avoid making the L1 table too big
        qemu-img: Use strerror() for generic resize error
        block: Remove BB options from blockdev-add
        qemu-iotests: Test setting WCE with qdev
        block/qdev: Allow configuring rerror/werror with qdev properties
        commit: Fix use of error handling policy
        block/qdev: Allow configuring WCE with qdev properties
        block/qdev: Allow node name for drive properties
        coroutine: move entry argument to qemu_coroutine_create
        test-coroutine: prepare for the next patch
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      9358450e
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/rth/tags/pull-rth-20160712' into staging · 5bb2399f
      Peter Maydell authored
      
      target-sparc improvements, v4
      
      # gpg: Signature made Tue 12 Jul 2016 19:04:33 BST
      # gpg:                using RSA key 0xAD1270CC4DD0279B
      # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>"
      # gpg:                 aka "Richard Henderson <rth@redhat.com>"
      # gpg:                 aka "Richard Henderson <rth@twiddle.net>"
      # Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC  16A4 AD12 70CC 4DD0 279B
      
      * remotes/rth/tags/pull-rth-20160712: (24 commits)
        target-sparc: Elide duplicate updates to fprs
        target-sparc: Use cpu_loop_exit_restore from helper_check_ieee_exceptions
        target-sparc: Use cpu_fsr in stfsr
        target-sparc: Use explicit writes to cpu_fsr
        target-sparc: Remove helper_ldf_asi, helper_stf_asi
        target-sparc: Directly implement block and short ldf/stf asis
        target-sparc: Directly implement easy ldf/stf asis
        target-sparc: Pass TCGMemOp constants to helper_ld/st_asi
        target-sparc: Fix obvious error in ASI_M_BFILL
        target-sparc: Directly implement easy ldd/std asis
        target-sparc: Introduce gen_check_align
        target-sparc: Use QT0 to return results from ldda
        target-sparc: Directly implement easy ld/st asis
        target-sparc: Use defines from asi.h
        target-sparc: Add UA2005 defines to asi.h
        target-sparc: Import linux/arch/sparc/include/uapi/asm/asi.h
        target-sparc: Pass TCGMemOp to gen_ld/st_asi
        target-sparc: Introduce get_asi
        target-sparc: Store %asi in TB flags
        target-sparc: Unify asi handling between 32 and 64-bit
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      5bb2399f
  4. Jul 13, 2016
    • Kevin Wolf's avatar
      Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2016-07-13' into queue-block · 543d7a42
      Kevin Wolf authored
      
      Block patches (v2) for the block queue.
      
      # gpg: Signature made Wed Jul 13 13:41:53 2016 CEST
      # gpg:                using RSA key 0x3BB14202E838ACAD
      # gpg: Good signature from "Max Reitz <mreitz@redhat.com>"
      # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
      #      Subkey fingerprint: 58B3 81CE 2DC8 9CF9 9730  EE64 3BB1 4202 E838 ACAD
      
      * mreitz/tags/pull-block-for-kevin-2016-07-13:
        iotests: Make 157 actually format-agnostic
        vvfat: Fix qcow write target driver specification
        hmp: show all of snapshot info on every block dev in output of 'info snapshots'
        hmp: use snapshot name to determine whether a snapshot is 'fully available'
        qemu-iotests: Test naming of throttling groups
        blockdev: Fix regression with the default naming of throttling groups
        vmdk: fix metadata write regression
        Improve block job rate limiting for small bandwidth values
        qcow2: Fix qcow2_get_cluster_offset()
        qemu-io: Use correct range limitations
        qcow2: Avoid making the L1 table too big
        qemu-img: Use strerror() for generic resize error
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      543d7a42
    • Hanna Reitz's avatar
      iotests: Make 157 actually format-agnostic · 42190dcc
      Hanna Reitz authored
      
      iotest 157 pretends not to care about the image format used, but in fact
      it does due to the format name not being filtered in its output. This
      patch adds filtering and changes the reference output accordingly.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 20160711132246.3152-1-mreitz@redhat.com
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      42190dcc
    • Hanna Reitz's avatar
      vvfat: Fix qcow write target driver specification · c4b48bfd
      Hanna Reitz authored
      
      First, bdrv_open_child() expects all options for the child to be
      prefixed by the child's name (and a separating dot). Second,
      bdrv_open_child() does not take ownership of the QDict passed to it but
      only extracts all options for the child, so if a QDict is created for
      the sole purpose of passing it to bdrv_open_child(), it needs to be
      freed afterwards.
      
      This patch makes vvfat adhere to both of these rules.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 20160711135452.11304-1-mreitz@redhat.com
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      c4b48bfd
    • Lin Ma's avatar
      hmp: show all of snapshot info on every block dev in output of 'info snapshots' · 0c204cc8
      Lin Ma authored
      
      Currently, the output of 'info snapshots' shows fully available snapshots.
      It's opaque, hides some snapshot information to users. It's not convenient
      if users want to know more about all of snapshot information on every block
      device via monitor.
      
      Follow Kevin's and Max's proposals, The patch makes the output more detailed:
      (qemu) info snapshots
      List of snapshots present on all disks:
       ID        TAG                 VM SIZE                DATE       VM CLOCK
       --        checkpoint-1           165M 2016-05-22 16:58:07   00:02:06.813
      
      List of partial (non-loadable) snapshots on 'drive_image1':
       ID        TAG                 VM SIZE                DATE       VM CLOCK
       1         snap1                     0 2016-05-22 16:57:31   00:01:30.567
      
      Signed-off-by: default avatarLin Ma <lma@suse.com>
      Message-id: 1467869164-26688-3-git-send-email-lma@suse.com
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      0c204cc8
    • Lin Ma's avatar
      hmp: use snapshot name to determine whether a snapshot is 'fully available' · 3a1ee711
      Lin Ma authored
      
      Currently qemu uses snapshot id to determine whether a snapshot is fully
      available, It causes incorrect output in some scenario.
      
      For instance:
      (qemu) info block
      drive_image1 (#block113): /opt/vms/SLES12-SP1-JeOS-x86_64-GM/disk0.qcow2
      (qcow2)
          Cache mode:       writeback
      
      drive_image2 (#block349): /opt/vms/SLES12-SP1-JeOS-x86_64-GM/disk1.qcow2
      (qcow2)
          Cache mode:       writeback
      (qemu)
      (qemu) info snapshots
      There is no snapshot available.
      (qemu)
      (qemu) snapshot_blkdev_internal drive_image1 snap1
      (qemu)
      (qemu) info snapshots
      There is no suitable snapshot available
      (qemu)
      (qemu) savevm checkpoint-1
      (qemu)
      (qemu) info snapshots
      ID        TAG                 VM SIZE                DATE       VM CLOCK
      1         snap1                     0 2016-05-22 16:57:31   00:01:30.567
      (qemu)
      
      $ qemu-img snapshot -l disk0.qcow2
      Snapshot list:
      ID        TAG                 VM SIZE                DATE       VM CLOCK
      1         snap1                     0 2016-05-22 16:57:31   00:01:30.567
      2         checkpoint-1           165M 2016-05-22 16:58:07   00:02:06.813
      
      $ qemu-img snapshot -l disk1.qcow2
      Snapshot list:
      ID        TAG                 VM SIZE                DATE       VM CLOCK
      1         checkpoint-1              0 2016-05-22 16:58:07   00:02:06.813
      
      The patch uses snapshot name instead of snapshot id to determine whether a
      snapshot is fully available and uses '--' instead of snapshot id in output
      because the snapshot id is not guaranteed to be the same on all images.
      For instance:
      (qemu) info snapshots
      List of snapshots present on all disks:
       ID        TAG                 VM SIZE                DATE       VM CLOCK
       --        checkpoint-1           165M 2016-05-22 16:58:07   00:02:06.813
      
      Signed-off-by: default avatarLin Ma <lma@suse.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 1467869164-26688-2-git-send-email-lma@suse.com
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      3a1ee711
    • Alberto Garcia's avatar
      qemu-iotests: Test naming of throttling groups · 435d5ee6
      Alberto Garcia authored
      
      Throttling groups are named using the 'group' parameter of the
      block_set_io_throttle command and the throttling.group command-line
      option. If that parameter is unspecified the groups get the name of
      the block device.
      
      This patch adds a new test to check the naming of throttling groups.
      
      Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
      Message-id: d87d02823a6b91609509d8bb18e2f5dbd9a6102c.1467986342.git.berto@igalia.com
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      435d5ee6
    • Alberto Garcia's avatar
      blockdev: Fix regression with the default naming of throttling groups · ff356ee4
      Alberto Garcia authored
      
      When I/O limits are set for a block device, the name of the throttling
      group is taken from the BlockBackend if the user doesn't specify one.
      
      Commit efaa7c4e moved the naming of the BlockBackend in
      blockdev_init() to the end of the function, after I/O limits are set.
      The consequence is that the throttling group gets an empty name.
      
      Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
      Reported-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: qemu-stable@nongnu.org
      Message-id: af5cd58bd2c4b9f6c57f260d9cfe586b9fb7d34d.1467986342.git.berto@igalia.com
      [mreitz: Use existing "id" variable instead of new "blk_id"]
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      ff356ee4
    • Reda Sallahi's avatar
      vmdk: fix metadata write regression · 524089bc
      Reda Sallahi authored
      
      Commit "cdeaf1f1 vmdk: add bdrv_co_write_zeroes" causes a regression on
      writes. It writes metadata after every write instead of doing it only once
      for each cluster.
      
      vmdk_pwritev() writes metadata whenever m_data is set as valid so this patch
      sets m_data as valid only when we have a new cluster which hasn't been
      allocated before or a zero grain.
      
      Signed-off-by: default avatarReda Sallahi <fullmanet@gmail.com>
      Message-id: 20160707084249.29084-1-fullmanet@gmail.com
      Reviewed-by: default avatarFam Zheng <famz@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      524089bc
    • Sascha Silbe's avatar
      Improve block job rate limiting for small bandwidth values · f14a39cc
      Sascha Silbe authored
      
      ratelimit_calculate_delay() previously reset the accounting every time
      slice, no matter how much data had been processed before. This had (at
      least) two consequences:
      
      1. The minimum speed is rather large, e.g. 5 MiB/s for commit and stream.
      
         Not sure if there are real-world use cases where this would be a
         problem. Mirroring and backup over a slow link (e.g. DSL) would
         come to mind, though.
      
      2. Tests for block job operations (e.g. cancel) were rather racy
      
         All block jobs currently use a time slice of 100ms. That's a
         reasonable value to get smooth output during regular
         operation. However this also meant that the state of block jobs
         changed every 100ms, no matter how low the configured limit was. On
         busy hosts, qemu often transferred additional chunks until the test
         case had a chance to cancel the job.
      
      Fix the block job rate limit code to delay for more than one time
      slice to address the above issues. To make it easier to handle
      oversized chunks we switch the semantics from returning a delay
      _before_ the current request to a delay _after_ the current
      request. If necessary, this delay consists of multiple time slice
      units.
      
      Since the mirror job sends multiple chunks in one go even if the rate
      limit was exceeded in between, we need to keep track of the start of
      the current time slice so we can correctly re-compute the delay for
      the updated amount of data.
      
      The minimum bandwidth now is 1 data unit per time slice. The block
      jobs are currently passing the amount of data transferred in sectors
      and using 100ms time slices, so this translates to 5120
      bytes/second. With chunk sizes usually being O(512KiB), tests have
      plenty of time (O(100s)) to operate on block jobs. The chance of a
      race condition now is fairly remote, except possibly on insanely
      loaded systems.
      
      Signed-off-by: default avatarSascha Silbe <silbe@linux.vnet.ibm.com>
      Message-id: 1467127721-9564-2-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      f14a39cc
    • Hanna Reitz's avatar
      qcow2: Fix qcow2_get_cluster_offset() · c834cba9
      Hanna Reitz authored
      
      Recently, qcow2_get_cluster_offset() has been changed to work with bytes
      instead of sectors. This invalidated some assertions and introduced a
      possible integer multiplication overflow.
      
      This could be reproduced using e.g.
      
      $ qemu-img create -f qcow2 -o cluster_size=1M blub.qcow2 8G
      Formatting 'foo.qcow2', fmt=qcow2 size=8589934592 encryption=off
      cluster_size=1048576 lazy_refcounts=off refcount_bits=16
      $ qemu-io -c map blub.qcow2
      qemu-io: qemu/block/qcow2-cluster.c:504: qcow2_get_cluster_offset:
      Assertion `bytes_needed <= INT_MAX' failed.
      [1]    20775 abort (core dumped)  qemu-io -c map foo.qcow2
      
      This patch removes the now wrong assertion, adding comments and more
      assertions to prove its correctness (and fixing the overflow which would
      become apparent with the original assertion removed).
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 20160620142623.24471-3-mreitz@redhat.com
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      c834cba9
    • Hanna Reitz's avatar
      qemu-io: Use correct range limitations · a3674679
      Hanna Reitz authored
      
      create_iovec() has a comment lamenting the lack of SIZE_T_MAX. Since
      there actually is a SIZE_MAX, use it.
      
      Two places use INT_MAX for checking the upper bound of a sector count
      that is used as an argument for a blk_*() function (blk_discard() and
      blk_write_compressed(), respectively). BDRV_REQUEST_MAX_SECTORS should
      be used instead.
      
      And finally, do_co_pwrite_zeroes() used to similarly check that the
      sector count does not exceed INT_MAX. However, this function is now
      backed by blk_co_pwrite_zeroes() which takes bytes as an argument
      instead of sectors. Therefore, it should be the byte count that does not
      exceed INT_MAX, not the sector count.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      a3674679
    • Hanna Reitz's avatar
      qcow2: Avoid making the L1 table too big · 84c26520
      Hanna Reitz authored
      
      We refuse to open images whose L1 table we deem "too big". Consequently,
      we should not produce such images ourselves.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 20160615153630.2116-3-mreitz@redhat.com
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      [mreitz: Added QEMU_BUILD_BUG_ON()]
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      84c26520
    • Hanna Reitz's avatar
      qemu-img: Use strerror() for generic resize error · bcf23482
      Hanna Reitz authored
      
      Emitting the plain error number is not very helpful. Use strerror()
      instead.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 20160615153630.2116-2-mreitz@redhat.com
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      bcf23482
Loading