Skip to content
Snippets Groups Projects
  1. Jan 14, 2022
  2. Dec 28, 2021
  3. Dec 15, 2021
    • Markus Armbruster's avatar
      blockdev: Drop unused drive_get_next() · 95fd260f
      Markus Armbruster authored
      
      drive_get_next() is basically a bad idea.  It returns the "next" block
      backend of a certain interface type.  "Next" means bus=0,unit=N, where
      subsequent calls count N up from zero, per interface type.
      
      This lets you define unit numbers implicitly by execution order.  If the
      order changes, or new calls appear "in the middle", unit numbers change.
      ABI break.  Hard to spot in review.
      
      The previous commits eliminated all uses.  Drop the function.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Hanna Reitz <hreitz@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20211117163409.3587705-14-armbru@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      95fd260f
  4. Oct 07, 2021
    • Hanna Reitz's avatar
      job: @force parameter for job_cancel_sync() · 4cfb3f05
      Hanna Reitz authored
      Callers should be able to specify whether they want job_cancel_sync() to
      force-cancel the job or not.
      
      In fact, almost all invocations do not care about consistency of the
      result and just want the job to terminate as soon as possible, so they
      should pass force=true.  The replication block driver is the exception,
      specifically the active commit job it runs.
      
      As for job_cancel_sync_all(), all callers want it to force-cancel all
      jobs, because that is the point of it: To cancel all remaining jobs as
      quickly as possible (generally on process termination).  So make it
      invoke job_cancel_sync() with force=true.
      
      This changes some iotest outputs, because quitting qemu while a mirror
      job is active will now lead to it being cancelled instead of completed,
      which is what we want.  (Cancelling a READY mirror job with force=false
      may take an indefinite amount of time, which we do not want when
      quitting.  If users want consistent results, they must have all jobs be
      done before they quit qemu.)
      
      Buglink: https://gitlab.com/qemu-project/qemu/-/issues/462
      
      
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20211006151940.214590-6-hreitz@redhat.com>
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      4cfb3f05
  5. Aug 26, 2021
  6. Jul 09, 2021
  7. Jun 02, 2021
  8. Apr 30, 2021
  9. Mar 24, 2021
  10. Mar 23, 2021
  11. Mar 19, 2021
  12. Mar 09, 2021
  13. Mar 08, 2021
  14. Feb 12, 2021
  15. Jan 28, 2021
  16. Jan 26, 2021
    • Vladimir Sementsov-Ogievskiy's avatar
      qapi: backup: disable copy_range by default · 6a30f663
      Vladimir Sementsov-Ogievskiy authored
      
      Further commit will add a benchmark
      (scripts/simplebench/bench-backup.py), which will show that backup
      works better with async parallel requests (previous commit) and
      disabled copy_range. So, let's disable copy_range by default.
      
      Note: the option was added several commits ago with default to true,
      to follow old behavior (the feature was enabled unconditionally), and
      only now we are going to change the default behavior.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20210116214705.822267-19-vsementsov@virtuozzo.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      6a30f663
    • Vladimir Sementsov-Ogievskiy's avatar
      qapi: backup: add max-chunk and max-workers to x-perf struct · 2c59fd83
      Vladimir Sementsov-Ogievskiy authored
      
      Add new parameters to configure future backup features. The patch
      doesn't introduce aio backup requests (so we actually have only one
      worker) neither requests larger than one cluster. Still, formally we
      satisfy these maximums anyway, so add the parameters now, to facilitate
      further patch which will really change backup job behavior.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20210116214705.822267-11-vsementsov@virtuozzo.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      2c59fd83
    • Vladimir Sementsov-Ogievskiy's avatar
      qapi: backup: add perf.use-copy-range parameter · 86c6a3b6
      Vladimir Sementsov-Ogievskiy authored
      
      Experiments show, that copy_range is not always making things faster.
      So, to make experimentation simpler, let's add a parameter. Some more
      perf parameters will be added soon, so here is a new struct.
      
      For now, add new backup qmp parameter with x- prefix for the following
      reasons:
      
       - We are going to add more performance parameters, some will be
         related to the whole block-copy process, some only to background
         copying in backup (ignored for copy-before-write operations).
       - On the other hand, we are going to use block-copy interface in other
         block jobs, which will need performance options as well.. And it
         should be the same structure or at least somehow related.
      
      So, there are too much unclean things about how the interface and now
      we need the new options mostly for testing. Let's keep them
      experimental for a while.
      
      In do_backup_common() new x-perf parameter handled in a way to
      make further options addition simpler.
      
      We add use-copy-range with default=true, and we'll change the default
      in further patch, after moving backup to use block-copy.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20210116214705.822267-2-vsementsov@virtuozzo.com>
      [mreitz: s/5\.2/6.0/]
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      86c6a3b6
    • Vladimir Sementsov-Ogievskiy's avatar
      qapi: block-stream: add "bottom" argument · 7f4a396d
      Vladimir Sementsov-Ogievskiy authored
      
      The code already don't freeze base node and we try to make it prepared
      for the situation when base node is changed during the operation. In
      other words, block-stream doesn't own base node.
      
      Let's introduce a new interface which should replace the current one,
      which will in better relations with the code. Specifying bottom node
      instead of base, and requiring it to be non-filter gives us the
      following benefits:
      
       - drop difference between above_base and base_overlay, which will be
         renamed to just bottom, when old interface dropped
      
       - clean way to work with parallel streams/commits on the same backing
         chain, which otherwise become a problem when we introduce a filter
         for stream job
      
       - cleaner interface. Nobody will surprised the fact that base node may
         disappear during block-stream, when there is no word about "base" in
         the interface.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20201216061703.70908-11-vsementsov@virtuozzo.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      7f4a396d
    • Andrey Shinkevich's avatar
      stream: rework backing-file changing · 000e5a1c
      Andrey Shinkevich authored
      
      Stream in stream_prepare calls bdrv_change_backing_file() to change
      backing-file in the metadata of bs.
      
      It may use either backing-file parameter given by user or just take
      filename of base on job start.
      
      Backing file format is determined by base on job finish.
      
      There are some problems with this design, we solve only two by this
      patch:
      
      1. Consider scenario with backing-file unset. Current concept of stream
      supports changing of the base during the job (we don't freeze link to
      the base). So, we should not save base filename at job start,
      
        - let's determine name of the base on job finish.
      
      2. Using direct base to determine filename and format is not very good:
      base node may be a filter, so its filename may be JSON, and format_name
      is not good for storing into qcow2 metadata as backing file format.
      
        - let's use unfiltered_base
      
      Signed-off-by: default avatarAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
        [vsementsov: change commit subject, change logic in stream_prepare]
      Message-Id: <20201216061703.70908-10-vsementsov@virtuozzo.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      000e5a1c
    • Andrey Shinkevich's avatar
      qapi: add filter-node-name to block-stream · 880747a8
      Andrey Shinkevich authored
      
      Provide the possibility to pass the 'filter-node-name' parameter to the
      block-stream job as it is done for the commit block job.
      
      Signed-off-by: default avatarAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
        [vsementsov: comment indentation, s/Since: 5.2/Since: 6.0/]
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201216061703.70908-5-vsementsov@virtuozzo.com>
      [mreitz: s/commit/stream/]
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      880747a8
  17. Dec 13, 2020
  18. Dec 11, 2020
  19. Dec 10, 2020
  20. Oct 09, 2020
    • Kevin Wolf's avatar
      block: Convert 'block_resize' to coroutine · eb94b81a
      Kevin Wolf authored
      
      block_resize performs some I/O that could potentially take quite some
      time, so use it as an example for the new 'coroutine': true annotation
      in the QAPI schema.
      
      bdrv_truncate() requires that we're already in the right AioContext for
      the BlockDriverState if called in coroutine context. So instead of just
      taking the AioContext lock, move the QMP handler coroutine to the
      context.
      
      Call blk_unref() only after switching back because blk_unref() may only
      be called in the main thread.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20201005155855.256490-15-kwolf@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      eb94b81a
  21. Oct 06, 2020
    • Pavel Dovgalyuk's avatar
      migration: introduce icount field for snapshots · b39847a5
      Pavel Dovgalyuk authored
      
      Saving icount as a parameters of the snapshot allows navigation between
      them in the execution replay scenario.
      This information can be used for finding a specific snapshot for proceeding
      the recorded execution to the specific moment of the time.
      E.g., 'reverse step' action (introduced in one of the following patches)
      needs to load the nearest snapshot which is prior to the current moment
      of time.
      This patch also updates snapshot test which verifies qemu monitor output.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
      
      --
      
      v4 changes:
       - squashed format update with test output update
      v7 changes:
       - introduced the spaces between the fields in snapshot info output
       - updated the test to match new field widths
      Message-Id: <160174518865.12451.14327573383978752463.stgit@pasha-ThinkPad-X280>
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b39847a5
  22. Sep 23, 2020
    • Stefan Hajnoczi's avatar
      qemu/atomic.h: rename atomic_ to qatomic_ · d73415a3
      Stefan Hajnoczi authored
      
      clang's C11 atomic_fetch_*() functions only take a C11 atomic type
      pointer argument. QEMU uses direct types (int, etc) and this causes a
      compiler error when a QEMU code calls these functions in a source file
      that also included <stdatomic.h> via a system header file:
      
        $ CC=clang CXX=clang++ ./configure ... && make
        ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid)
      
      Avoid using atomic_*() names in QEMU's atomic.h since that namespace is
      used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h
      and <stdatomic.h> can co-exist. I checked /usr/include on my machine and
      searched GitHub for existing "qatomic_" users but there seem to be none.
      
      This patch was generated using:
      
        $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \
          sort -u >/tmp/changed_identifiers
        $ for identifier in $(</tmp/changed_identifiers); do
              sed -i "s%\<$identifier\>%q$identifier%g" \
                  $(git grep -I -l "\<$identifier\>")
          done
      
      I manually fixed line-wrap issues and misaligned rST tables.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200923105646.47864-1-stefanha@redhat.com>
      d73415a3
  23. Sep 07, 2020
    • Hanna Reitz's avatar
      blockdev: Fix active commit choice · 05ea385a
      Hanna Reitz authored
      
      We have to perform an active commit whenever the top node has a parent
      that has taken the WRITE permission on it.
      
      This means that block-commit's @backing-file parameter is no longer
      allowed for such nodes, and that users will have to issue a
      block-job-complete command.  Neither should pose a problem in practice,
      because this case was basically just broken until now.
      
      (Since this commit already touches block-commit's documentation, it also
      moves up the chunk explaining general block-commit behavior that for
      some reason was situated under @backing-file.)
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      05ea385a
    • Hanna Reitz's avatar
      commit: Deal with filters · 9a71b9de
      Hanna Reitz authored
      
      This includes some permission limiting (for example, we only need to
      take the RESIZE permission if the base is smaller than the top).
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      9a71b9de
    • Hanna Reitz's avatar
      backup: Deal with filters · 2b088c60
      Hanna Reitz authored
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      2b088c60
    • Hanna Reitz's avatar
      mirror: Deal with filters · 3f072a7f
      Hanna Reitz authored
      
      This includes some permission limiting (for example, we only need to
      take the RESIZE permission for active commits where the base is smaller
      than the top).
      
      base_overlay is introduced so we can query bdrv_is_allocated_above() on
      it - we cannot do that with base itself, because a filter's block_status
      is the same as its child node, so if there are filters on base,
      bdrv_is_allocated_above() on base would return information including
      base.
      
      Use this opportunity to rename qmp_drive_mirror()'s "source" BDS to
      "target_backing_bs", because that is what it really refers to.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      3f072a7f
    • Hanna Reitz's avatar
      blockdev: Use CAF in external_snapshot_prepare() · 7cc734a9
      Hanna Reitz authored
      
      This allows us to differentiate between filters and nodes with COW
      backing files: Filters cannot be used as overlays at all (for this
      function).
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      7cc734a9
    • Hanna Reitz's avatar
      stream: Deal with filters · 67acfd21
      Hanna Reitz authored
      
      Because of the (not so recent anymore) changes that make the stream job
      independent of the base node and instead track the node above it, we
      have to split that "bottom" node into two cases: The bottom COW node,
      and the node directly above the base node (which may be an R/W filter
      or the bottom COW node).
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      67acfd21
Loading