Skip to content
Snippets Groups Projects
  1. Oct 27, 2020
    • Greg Kurz's avatar
      block: End quiescent sections when a BDS is deleted · 1a6d3bd2
      Greg Kurz authored
      If a BDS gets deleted during blk_drain_all(), it might miss a
      call to bdrv_do_drained_end(). This means missing a call to
      aio_enable_external() and the AIO context remains disabled for
      ever. This can cause a device to become irresponsive and to
      disrupt the guest execution, ie. hang, loop forever or worse.
      
      This scenario is quite easy to encounter with virtio-scsi
      on POWER when punching multiple blockdev-create QMP commands
      while the guest is booting and it is still running the SLOF
      firmware. This happens because SLOF disables/re-enables PCI
      devices multiple times via IO/MEM/MASTER bits of PCI_COMMAND
      register after the initial probe/feature negotiation, as it
      tends to work with a single device at a time at various stages
      like probing and running block/network bootloaders without
      doing a full reset in-between. This naturally generates many
      dataplane stops and starts, and thus many drain sections that
      can race with blockdev_create_run(). In the end, SLOF bails
      out.
      
      It is somehow reproducible on x86 but it requires to generate
      articial dataplane start/stop activity with stop/cont QMP
      commands. In this case, seabios ends up looping for ever,
      waiting for the virtio-scsi device to send a response to
      a command it never received.
      
      Add a helper that pairs all previously called bdrv_do_drained_begin()
      with a bdrv_do_drained_end() and call it from bdrv_close().
      While at it, update the "/bdrv-drain/graph-change/drain_all"
      test in test-bdrv-drain so that it can catch the issue.
      
      BugId: https://bugzilla.redhat.com/show_bug.cgi?id=1874441
      
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <160346526998.272601.9045392804399803158.stgit@bahia.lan>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      1a6d3bd2
    • Alberto Garcia's avatar
      qcow2: Skip copy-on-write when allocating a zero cluster · 46cd1e8a
      Alberto Garcia authored
      
      Since commit c8bb23cb when a write
      request results in a new allocation QEMU first tries to see if the
      rest of the cluster outside the written area contains only zeroes.
      
      In that case, instead of doing a normal copy-on-write operation and
      writing explicit zero buffers to disk, the code zeroes the whole
      cluster efficiently using pwrite_zeroes() with BDRV_REQ_NO_FALLBACK.
      
      This improves performance very significantly but it only happens when
      we are writing to an area that was completely unallocated before. Zero
      clusters (QCOW2_CLUSTER_ZERO_*) are treated like normal clusters and
      are therefore slower to allocate.
      
      This happens because the code uses bdrv_is_allocated_above() rather
      bdrv_block_status_above(). The former is not as accurate for this
      purpose but it is faster. However in the case of qcow2 the underlying
      call does already report zero clusters just fine so there is no reason
      why we cannot use that information.
      
      After testing 4KB writes on an image that only contains zero clusters
      this patch results in almost five times more IOPS.
      
      Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <6d77cab968c501c44d6e1089b9bc91b04170b49e.1603731354.git.berto@igalia.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      46cd1e8a
    • Alberto Garcia's avatar
      qcow2: Report BDRV_BLOCK_ZERO more accurately in bdrv_co_block_status() · d40f4a56
      Alberto Garcia authored
      
      If a BlockDriverState supports backing files but has none then any
      unallocated area reads back as zeroes.
      
      bdrv_co_block_status() is only reporting this is if want_zero is true,
      but this is an inexpensive test and there is no reason not to do it in
      all cases.
      
      Suggested-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <66fa0914a0e2b727ab6d1b63ca773d7cd29a9a9e.1603731354.git.berto@igalia.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      d40f4a56
    • Zhengui Li's avatar
      qemu-img: add support for rate limit in qemu-img convert · 0c8c4895
      Zhengui Li authored
      
      add support for rate limit in qemu-img convert.
      
      Signed-off-by: default avatarZhengui <lizhengui@huawei.com>
      Message-Id: <1603205264-17424-3-git-send-email-lizhengui@huawei.com>
      Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      0c8c4895
    • Zhengui Li's avatar
      qemu-img: add support for rate limit in qemu-img commit · a0441b66
      Zhengui Li authored
      
      add support for rate limit in qemu-img commit.
      
      Signed-off-by: default avatarZhengui <lizhengui@huawei.com>
      Message-Id: <1603205264-17424-2-git-send-email-lizhengui@huawei.com>
      Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      a0441b66
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20201026a' into staging · d55450df
      Peter Maydell authored
      
      migration pull: 2020-10-26
      
      Another go at Peter's postcopy fixes
      
      Cleanups from Bihong Yu and Peter Maydell.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      
      # gpg: Signature made Mon 26 Oct 2020 16:17:03 GMT
      # gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
      # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full]
      # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7
      
      * remotes/dgilbert/tags/pull-migration-20201026a:
        migration-test: Only hide error if !QTEST_LOG
        migration/postcopy: Release fd before going into 'postcopy-pause'
        migration: Sync requested pages after postcopy recovery
        migration: Maintain postcopy faulted addresses
        migration: Introduce migrate_send_rp_message_req_pages()
        migration: Pass incoming state into qemu_ufd_copy_ioctl()
        migration: using trace_ to replace DPRINTF
        migration: Delete redundant spaces
        migration: Open brace '{' following function declarations go on the next line
        migration: Do not initialise statics and globals to 0 or NULL
        migration: Add braces {} for if statement
        migration: Open brace '{' following struct go on the same line
        migration: Add spaces around operator
        migration: Don't use '#' flag of printf format
        migration: Do not use C99 // comments
        migration: Drop unused VMSTATE_FLOAT64 support
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      d55450df
  2. Oct 26, 2020
Loading