Skip to content
Snippets Groups Projects
  1. Feb 01, 2022
    • Hanna Reitz's avatar
      qemu-img: Unify [-b [-F]] documentation · 111fbd74
      Hanna Reitz authored
      
      qemu-img convert documents the backing file and backing format options
      as follows:
          [-B backing_file [-F backing_fmt]]
      whereas qemu-img create has this:
          [-b backing_file] [-F backing_fmt]
      
      That is, for convert, we document that -F cannot be given without -B,
      while for create, way say that they are independent.
      
      Indeed, it is technically possible to give -F without -b, because it is
      left to the block driver to decide whether this is an error or not, so
      sometimes it is:
      
      $ qemu-img create -f qed -F qed test.qed 64M
      Formatting 'test.qed', fmt=qed size=67108864 backing_fmt=qed [...]
      
      And sometimes it is not:
      
      $ qemu-img create -f qcow2 -F qcow2 test.qcow2 64M
      Formatting 'test.qcow2', fmt=qcow2 cluster_size=65536 [...]
      qemu-img: test.qcow2: Backing format cannot be used without backing file
      
      Generally, it does not make much sense, though, and users should only
      give -F with -b, so document it that way, as we have already done for
      qemu-img convert (commit 1899bf47).
      
      Reported-by: default avatarTingting Mao <timao@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220131135908.32393-1-hreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      111fbd74
  2. Nov 02, 2021
  3. Sep 15, 2021
  4. Oct 27, 2020
  5. Oct 12, 2020
  6. Jul 06, 2020
  7. May 28, 2020
    • Eric Blake's avatar
      qemu-img: Add convert --bitmaps option · 15e39ad9
      Eric Blake authored
      Make it easier to copy all the persistent bitmaps of (the top layer
      of) a source image along with its guest-visible contents, by adding a
      boolean flag for use with qemu-img convert.  This is basically
      shorthand, as the same effect could be accomplished with a series of
      'qemu-img bitmap --add' and 'qemu-img bitmap --merge -b source'
      commands, or by their corresponding QMP commands.
      
      Note that this command will fail in the same scenarios where 'qemu-img
      measure' omits a 'bitmaps size:' line, namely, when either the source
      or the destination lacks persistent bitmap support altogether.
      
      See also https://bugzilla.redhat.com/show_bug.cgi?id=1779893
      
      
      
      While touching this, clean up a couple coding issues spotted in the
      same function: an extra blank line, and merging back-to-back 'if
      (!skip_create)' blocks.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20200521192137.1120211-5-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      15e39ad9
  8. May 19, 2020
    • Eric Blake's avatar
      qemu-img: Add bitmap sub-command · 3b51ab4b
      Eric Blake authored
      
      Include actions for --add, --remove, --clear, --enable, --disable, and
      --merge (note that --clear is a bit of fluff, because the same can be
      accomplished by removing a bitmap and then adding a new one in its
      place, but it matches what QMP commands exist).  Listing is omitted,
      because it does not require a bitmap name and because it was already
      possible with 'qemu-img info'.  A single command line can play one or
      more bitmap commands in sequence on the same bitmap name (although all
      added bitmaps share the same granularity, and and all merged bitmaps
      come from the same source file).  Merge defaults to other bitmaps in
      the primary image, but can also be told to merge bitmaps from a
      distinct image.
      
      While this supports --image-opts for the file being modified, I did
      not think it worth the extra complexity to support that for the source
      file in a cross-file merges.  Likewise, I chose to have --merge only
      take a single source rather than following the QMP support for
      multiple merges in one go (although you can still use more than one
      --merge in the command line); in part because qemu-img is offline and
      therefore atomicity is not an issue.
      
      Upcoming patches will add iotest coverage of these commands while
      also testing other features.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20200513011648.166876-7-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      3b51ab4b
    • Eric Blake's avatar
      qemu-img: Fix stale comments on doc location · 0562adf5
      Eric Blake authored
      
      Missed in commit e13c59fa.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20200513011648.166876-3-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      0562adf5
  9. May 18, 2020
  10. Feb 20, 2020
  11. Feb 06, 2020
  12. Feb 03, 2020
  13. Jan 30, 2020
  14. Jun 14, 2019
  15. Apr 12, 2019
    • John Snow's avatar
      qemu-img: fix .hx and .texi disparity · 13c24eda
      John Snow authored
      
      It turns out that having options listed in three places continues to be
      a bad idea. I'm still toying with the idea of an improved infrastructure
      here, but in the meantime, another bandaid.
      
      There are three locations:
      (1) .hx file, formatted as texi
      (2) .hx file, formatted as human readable.
      (3) .texi file, as section headers, formatted as texi.
      
      You can compare the two summaries within the .hx file like so:
      
      Human-readable command summaries:
      `./qemu-img --help | grep 'Command syntax' -A14`
      Detokenized texi command summaries:
      `grep "@item" qemu-img-cmds.hx | sed -E 's|@var\{([^\}]*?)\}|\1|g'`
      
      You can compare the two separate texi summaries like so:
      
      Texi command summaries:
      `grep "@item" qemu-img-cmds.hx"`
      Texi command headers:
      grep -E "@item.*@var" qemu-img.texi | tail -14
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20190409210655.777-1-jsnow@redhat.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      13c24eda
  16. Jul 30, 2018
  17. Jun 11, 2018
  18. May 20, 2018
  19. Sep 26, 2017
  20. Aug 08, 2017
  21. Jul 18, 2017
    • John Snow's avatar
      qemu-img: Check for backing image if specified during create · 6e6e55f5
      John Snow authored
      Or, rather, force the open of a backing image if one was specified
      for creation. Using a similar -unsafe option as rebase, allow qemu-img
      to ignore the backing file validation if possible.
      
      It may not always be possible, as in the existing case when a filesize
      for the new image was not specified.
      
      This is accomplished by shifting around the conditionals in
      bdrv_img_create, such that a backing file is always opened unless we
      provide BDRV_O_NO_BACKING. qemu-img is adjusted to pass this new flag
      when -u is provided to create.
      
      Sorry for the heinous looking diffstat, but it's mostly whitespace.
      
      Inspired by: https://bugzilla.redhat.com/show_bug.cgi?id=1213786
      
      
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      6e6e55f5
  22. Jul 11, 2017
  23. May 29, 2017
  24. May 11, 2017
  25. Apr 27, 2017
  26. Apr 07, 2017
  27. Feb 28, 2017
    • Peter Lieven's avatar
      qemu-img: make convert async · 2d9187bc
      Peter Lieven authored
      
      the convert process is currently completely implemented with sync operations.
      That means it reads one buffer and then writes it. No parallelism and each sync
      request takes as long as it takes until it is completed.
      
      This can be a big performance hit when the convert process reads and writes
      to devices which do not benefit from kernel readahead or pagecache.
      In our environment we heavily have the following two use cases when using
      qemu-img convert.
      
      a) reading from NFS and writing to iSCSI for deploying templates
      b) reading from iSCSI and writing to NFS for backups
      
      In both processes we use libiscsi and libnfs so we have no kernel cache.
      
      This patch changes the convert process to work with parallel running coroutines
      which can significantly improve performance for network storage devices:
      
      qemu-img (master)
       nfs -> iscsi 22.8 secs
       nfs -> ram   11.7 secs
       ram -> iscsi 12.3 secs
      
      qemu-img-async (8 coroutines, in-order write disabled)
       nfs -> iscsi 11.0 secs
       nfs -> ram   10.4 secs
       ram -> iscsi  9.0 secs
      
      This patches introduces 2 new cmdline parameters. The -m parameter to specify
      the number of coroutines running in parallel (defaults to 8). And the -W parameter to
      allow qemu-img to write to the target out of order rather than sequential. This improves
      performance as the writes do not have to wait for each other to complete.
      
      Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      2d9187bc
  28. Sep 20, 2016
  29. Jun 08, 2016
Loading