1. 14 10月, 2019 13 次提交
    • M
      iotests/028: Fix for long $TEST_DIRs · 48c8d3ce
      Max Reitz 提交于
      For long test image paths, the order of the "Formatting" line and the
      "(qemu)" prompt after a drive_backup HMP command may be reversed.  In
      fact, the interaction between the prompt and the line may lead to the
      "Formatting" to being greppable at all after "read"-ing it (if the
      prompt injects an IFS character into the "Formatting" string).
      
      So just wait until we get a prompt.  At that point, the block job must
      have been started, so "info block-jobs" will only return "No active
      jobs" once it is done.
      Reported-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      48c8d3ce
    • A
      block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK · f2208fdc
      Alberto Garcia 提交于
      The BDRV_REQ_NO_FALLBACK flag means that an operation should only be
      performed if it can be offloaded or otherwise performed efficiently.
      
      However a misaligned write request requires a RMW so we should return
      an error and let the caller decide how to proceed.
      
      This hits an assertion since commit c8bb23cb if the required
      alignment is larger than the cluster size:
      
      qemu-img create -f qcow2 -o cluster_size=2k img.qcow2 4G
      qemu-io -c "open -o driver=qcow2,file.align=4k blkdebug::img.qcow2" \
              -c 'write 0 512'
      qemu-io: block/io.c:1127: bdrv_driver_pwritev: Assertion `!(flags & BDRV_REQ_NO_FALLBACK)' failed.
      Aborted
      
      The reason is that when writing to an unallocated cluster we try to
      skip the copy-on-write part and zeroize it using BDRV_REQ_NO_FALLBACK
      instead, resulting in a write request that is too small (2KB cluster
      size vs 4KB required alignment).
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f2208fdc
    • P
      replay: add BH oneshot event for block layer · e4ec5ad4
      Pavel Dovgalyuk 提交于
      Replay is capable of recording normal BH events, but sometimes
      there are single use callbacks scheduled with aio_bh_schedule_oneshot
      function. This patch enables recording and replaying such callbacks.
      Block layer uses these events for calling the completion function.
      Replaying these calls makes the execution deterministic.
      Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
      Acked-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e4ec5ad4
    • P
      replay: finish record/replay before closing the disks · ae25dccb
      Pavel Dovgalyuk 提交于
      After recent updates block devices cannot be closed on qemu exit.
      This happens due to the block request polling when replay is not finished.
      Therefore now we stop execution recording before closing the block devices.
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ae25dccb
    • P
      replay: don't drain/flush bdrv queue while RR is working · c8aa7895
      Pavel Dovgalyuk 提交于
      In record/replay mode bdrv queue is controlled by replay mechanism.
      It does not allow saving or loading the snapshots
      when bdrv queue is not empty. Stopping the VM is not blocked by nonempty
      queue, but flushing the queue is still impossible there,
      because it may cause deadlocks in replay mode.
      This patch disables bdrv_drain_all and bdrv_flush_all in
      record/replay mode.
      
      Stopping the machine when the IO requests are not finished is needed
      for the debugging. E.g., breakpoint may be set at the specified step,
      and forcing the IO requests to finish may break the determinism
      of the execution.
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Acked-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c8aa7895
    • P
      replay: update docs for record/replay with block devices · de499eb6
      Pavel Dovgalyuk 提交于
      This patch updates the description of the command lines for using
      record/replay with attached block devices.
      Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      de499eb6
    • P
      replay: disable default snapshot for record/replay · 25863975
      Pavel Dovgalyuk 提交于
      This patch disables setting '-snapshot' option on by default
      in record/replay mode. This is needed for creating vmstates in record
      and replay modes.
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Acked-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      25863975
    • P
      block: implement bdrv_snapshot_goto for blkreplay · 3c6c4348
      Pavel Dovgalyuk 提交于
      This patch enables making snapshots with blkreplay used in
      block devices.
      This function is required to make bdrv_snapshot_goto without
      calling .bdrv_open which is not implemented.
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Acked-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      3c6c4348
    • P
      block/vhdx: add check for truncated image files · 6caaad46
      Peter Lieven 提交于
      qemu is currently not able to detect truncated vhdx image files.
      Add a basic check if all allocated blocks are reachable at open and
      report all errors during bdrv_co_check.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6caaad46
    • P
      Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20191010.0' into staging · 22dbfdec
      Peter Maydell 提交于
      VFIO update 2019-10-10
      
       - Fix MSI error path double free (Evgeny Yakovlev)
      
      # gpg: Signature made Thu 10 Oct 2019 20:07:39 BST
      # gpg:                using RSA key 239B9B6E3BB08B22
      # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full]
      # gpg:                 aka "Alex Williamson <alex@shazbot.org>" [full]
      # gpg:                 aka "Alex Williamson <alwillia@redhat.com>" [full]
      # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>" [full]
      # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22
      
      * remotes/awilliam/tags/vfio-update-20191010.0:
        hw/vfio/pci: fix double free in vfio_msi_disable
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      22dbfdec
    • P
      Merge remote-tracking branch 'remotes/gkurz/tags/9p-next-2019-10-10' into staging · c8b2bc51
      Peter Maydell 提交于
      The most notable change is that we now detect cross-device setups in the
      host since it may cause inode number collision and mayhem in the guest.
      A new fsdev property is added for the user to choose the appropriate
      policy to handle that: either remap all inode numbers or fail I/Os to
      another host device or just print out a warning (default behaviour).
      
      This is also my last PR as _active_ maintainer of 9pfs.
      
      # gpg: Signature made Thu 10 Oct 2019 12:14:07 BST
      # gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
      # gpg: Good signature from "Greg Kurz <groug@kaod.org>" [full]
      # gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>" [full]
      # gpg:                 aka "[jpeg image of size 3330]" [full]
      # Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6
      
      * remotes/gkurz/tags/9p-next-2019-10-10:
        MAINTAINERS: Downgrade status of virtio-9p to "Odd Fixes"
        9p: Use variable length suffixes for inode remapping
        9p: stat_to_qid: implement slow path
        9p: Added virtfs option 'multidevs=remap|forbid|warn'
        9p: Treat multiple devices on one export as an error
        fsdev: Add return value to fsdev_throttle_parse_opts()
        9p: Simplify error path of v9fs_device_realize_common()
        9p: unsigned type for type, version, path
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c8b2bc51
    • P
      Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-10-10' into staging · 088d6709
      Peter Maydell 提交于
      Block patches:
      - Parallelized request handling for qcow2
      - Backup job refactoring to use a filter node instead of before-write
        notifiers
      - Add discard accounting information to file-posix nodes
      - Allow trivial reopening of nbd nodes
      - Some iotest fixes
      
      # gpg: Signature made Thu 10 Oct 2019 12:40:34 BST
      # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
      # gpg:                issuer "mreitz@redhat.com"
      # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
      # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
      
      * remotes/maxreitz/tags/pull-block-2019-10-10: (36 commits)
        iotests/162: Fix for newer Linux 5.3+
        tests: fix I/O test for hosts defaulting to LUKSv2
        nbd: add empty .bdrv_reopen_prepare
        block/backup: use backup-top instead of write notifiers
        block: introduce backup-top filter driver
        block/block-copy: split block_copy_set_callbacks function
        block/backup: move write_flags calculation inside backup_job_create
        block/backup: move in-flight requests handling from backup to block-copy
        iotests: Use stat -c %b in 125
        iotests: Disable 125 on broken XFS versions
        iotests: Fix 125 for growth_mode = metadata
        qapi: query-blockstat: add driver specific file-posix stats
        file-posix: account discard operations
        scsi: account unmap operations
        scsi: move unmap error checking to the complete callback
        scsi: store unmap offset and nb_sectors in request struct
        ide: account UNMAP (TRIM) operations
        block: add empty account cookie type
        qapi: add unmap to BlockDeviceStats
        qapi: group BlockDeviceStats fields
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      088d6709
    • P
      Merge remote-tracking branch 'remotes/davidhildenbrand/tags/s390x-tcg-2019-10-10' into staging · cdfc44ac
      Peter Maydell 提交于
      - MMU DAT translation rewrite and cleanup
      - Implement more TCG CPU features related to the MMU (e.g., IEP)
      - Add the current instruction length to unwind data and clean up
      - Resolve one TODO for the MVCL instruction
      
      # gpg: Signature made Thu 10 Oct 2019 12:25:06 BST
      # gpg:                using RSA key 1BD9CAAD735C4C3A460DFCCA4DDE10F700FF835A
      # gpg:                issuer "david@redhat.com"
      # gpg: Good signature from "David Hildenbrand <david@redhat.com>" [unknown]
      # gpg:                 aka "David Hildenbrand <davidhildenbrand@gmail.com>" [full]
      # Primary key fingerprint: 1BD9 CAAD 735C 4C3A 460D  FCCA 4DDE 10F7 00FF 835A
      
      * remotes/davidhildenbrand/tags/s390x-tcg-2019-10-10: (31 commits)
        s390x/tcg: MVCL: Exit to main loop if requested
        target/s390x: Remove ILEN_UNWIND
        target/s390x: Remove ilen argument from trigger_pgm_exception
        target/s390x: Remove ilen argument from trigger_access_exception
        target/s390x: Remove ILEN_AUTO
        target/s390x: Rely on unwinding in s390_cpu_virt_mem_rw
        target/s390x: Rely on unwinding in s390_cpu_tlb_fill
        target/s390x: Simplify helper_lra
        target/s390x: Remove fail variable from s390_cpu_tlb_fill
        target/s390x: Return exception from translate_pages
        target/s390x: Return exception from mmu_translate
        target/s390x: Remove exc argument to mmu_translate_asce
        target/s390x: Return exception from mmu_translate_real
        target/s390x: Handle tec in s390_cpu_tlb_fill
        target/s390x: Push trigger_pgm_exception lower in s390_cpu_tlb_fill
        target/s390x: Use tcg_s390_program_interrupt in TCG helpers
        target/s390x: Remove ilen parameter from s390_program_interrupt
        target/s390x: Remove ilen parameter from tcg_s390_program_interrupt
        target/s390x: Add ilen to unwind data
        s390x/cpumodel: Add new TCG features to QEMU cpu model
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      cdfc44ac
  2. 11 10月, 2019 1 次提交
    • E
      hw/vfio/pci: fix double free in vfio_msi_disable · d964d3b5
      Evgeny Yakovlev 提交于
      The following guest behaviour patter leads to double free in VFIO PCI:
      
      1. Guest enables MSI interrupts
      vfio_msi_enable is called, but fails in vfio_enable_vectors.
      In our case this was because VFIO GPU device was in D3 state.
      Unhappy path in vfio_msi_enable will g_free(vdev->msi_vectors) but not
      set this pointer to NULL
      
      2. Guest still sees MSI an enabled after that because emulated config
      write is done in vfio_pci_write_config unconditionally before calling
      vfio_msi_enable
      
      3. Guest disables MSI interrupts
      vfio_msi_disable is called and tries to g_free(vdev->msi_vectors)
      in vfio_msi_disable_common => double free
      Signed-off-by: NEvgeny Yakovlev <wrfsh@yandex-team.ru>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      d964d3b5
  3. 10 10月, 2019 26 次提交