1. 08 8月, 2017 1 次提交
    • E
      maint: Include bug-reporting info in --help output · f5048cb7
      Eric Blake 提交于
      These days, many programs are including a bug-reporting address,
      or better yet, a link to the project web site, at the tail of
      their --help output.  However, we were not very consistent at
      doing so: only qemu-nbd and qemu-qa mentioned anything, with the
      latter pointing to an individual person instead of the project.
      
      Add a new #define that sets up a uniform string, mentioning both
      bug reporting instructions and overall project details, and which
      a downstream vendor could tweak if they want bugs to go to a
      downstream database.  Then use it in all of our binaries which
      have --help output.
      
      The canned text intentionally references http:// instead of https://
      because our https website currently causes certificate errors in
      some browsers.  That can be tweaked later once we have resolved the
      web site issued.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20170803163353.19558-5-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f5048cb7
  2. 24 7月, 2017 1 次提交
  3. 18 7月, 2017 1 次提交
    • J
      qemu-img: Check for backing image if specified during create · 6e6e55f5
      John Snow 提交于
      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=1213786Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6e6e55f5
  4. 12 7月, 2017 1 次提交
  5. 11 7月, 2017 5 次提交
  6. 10 7月, 2017 3 次提交
    • E
      block: Make bdrv_is_allocated_above() byte-based · 51b0a488
      Eric Blake 提交于
      We are gradually moving away from sector-based interfaces, towards
      byte-based.  In the common case, allocation is unlikely to ever use
      values that are not naturally sector-aligned, but it is possible
      that byte-based values will let us be more precise about allocation
      at the end of an unaligned file that can do byte-based access.
      
      Changing the signature of the function to use int64_t *pnum ensures
      that the compiler enforces that all callers are updated.  For now,
      the io.c layer still assert()s that all callers are sector-aligned,
      but that can be relaxed when a later patch implements byte-based
      block status.  Therefore, for the most part this patch is just the
      addition of scaling at the callers followed by inverse scaling at
      bdrv_is_allocated().  But some code, particularly stream_run(),
      gets a lot simpler because it no longer has to mess with sectors.
      Leave comments where we can further simplify by switching to
      byte-based iterations, once later patches eliminate the need for
      sector-aligned operations.
      
      For ease of review, bdrv_is_allocated() was tackled separately.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      51b0a488
    • E
      block: Make bdrv_is_allocated() byte-based · d6a644bb
      Eric Blake 提交于
      We are gradually moving away from sector-based interfaces, towards
      byte-based.  In the common case, allocation is unlikely to ever use
      values that are not naturally sector-aligned, but it is possible
      that byte-based values will let us be more precise about allocation
      at the end of an unaligned file that can do byte-based access.
      
      Changing the signature of the function to use int64_t *pnum ensures
      that the compiler enforces that all callers are updated.  For now,
      the io.c layer still assert()s that all callers are sector-aligned
      on input and that *pnum is sector-aligned on return to the caller,
      but that can be relaxed when a later patch implements byte-based
      block status.  Therefore, this code adds usages like
      DIV_ROUND_UP(,BDRV_SECTOR_SIZE) to callers that still want aligned
      values, where the call might reasonbly give non-aligned results
      in the future; on the other hand, no rounding is needed for callers
      that should just continue to work with byte alignment.
      
      For the most part this patch is just the addition of scaling at the
      callers followed by inverse scaling at bdrv_is_allocated().  But
      some code, particularly bdrv_commit(), gets a lot simpler because it
      no longer has to mess with sectors; also, it is now possible to pass
      NULL if the caller does not care how much of the image is allocated
      beyond the initial offset.  Leave comments where we can further
      simplify once a later patch eliminates the need for sector-aligned
      requests through bdrv_is_allocated().
      
      For ease of review, bdrv_is_allocated_above() will be tackled
      separately.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d6a644bb
    • D
      qemu-img: drop -e and -6 options from the 'create' & 'convert' commands · 6b4df548
      Daniel P. Berrange 提交于
      The '-e' and '-6' options to the 'create' & 'convert' commands were
      "deprecated" in favour of the more generic '-o' option many years ago:
      
        commit eec77d9e
        Author: Jes Sorensen <Jes.Sorensen@redhat.com>
        Date:   Tue Dec 7 17:44:34 2010 +0100
      
          qemu-img: Deprecate obsolete -6 and -e options
      
      Except this was never actually a deprecation, which would imply giving
      the user a warning while the functionality continues to work for a
      number of releases before eventual removal. Instead the options were
      immediately turned into an error + exit. Given that the functionality
      is already broken, there's no point in keeping these psuedo-deprecation
      messages around any longer.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6b4df548
  7. 26 6月, 2017 2 次提交
  8. 29 5月, 2017 5 次提交
  9. 23 5月, 2017 1 次提交
  10. 11 5月, 2017 2 次提交
  11. 09 5月, 2017 1 次提交
  12. 29 4月, 2017 1 次提交
  13. 28 4月, 2017 2 次提交
  14. 27 4月, 2017 3 次提交
    • M
      qemu-img/convert: Move bs_n > 1 && -B check down · 48758a84
      Max Reitz 提交于
      It does not make much sense to use a backing image for the target when
      you concatenate multiple images (because then there is no correspondence
      between the source images' backing files and the target's); but it was
      still possible to give one by using -o backing_file=X instead of -B X.
      
      Fix this by moving the check.
      
      (Also, change the error message because -B is not the only way to
       specify the backing file, evidently.)
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      48758a84
    • M
      qemu-img/convert: Use @opts for one thing only · 3258b911
      Max Reitz 提交于
      After storing the creation options for the new image into @opts, we
      fetch some things for our own information, like the backing file name,
      or whether to use encryption or preallocation.
      
      With the -n parameter, there will not be any creation options; this is
      not too bad because this just means that querying a NULL @opts will
      always return the default value.
      
      However, we also use @opts for the --object options. Therefore, @opts is
      not necessarily NULL if -n was specified; instead, it may contain those
      options. In practice, this probably does not cause any problems because
      there most likely is no object that supports any of the parameters we
      query here, but this is neither something we should rely on nor does
      this variable reuse make the code very nice to read.
      
      Therefore, just use a separate variable for the --object options.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      3258b911
    • P
      qemu-img: simplify img_convert · 9fd77f99
      Peter Lieven 提交于
      img_convert has been around before there was an ImgConvertState or
      a block backend, but it has never been modified to directly use
      these structs. Change this by parsing parameters directly into
      the ImgConvertState and directly use BlockBackend where possible.
      Furthermore variable initialization has been reworked and sorted.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      9fd77f99
  15. 24 4月, 2017 2 次提交
  16. 27 3月, 2017 3 次提交
  17. 01 3月, 2017 4 次提交
    • K
      commit: Add filter-node-name to block-commit · 0db832f4
      Kevin Wolf 提交于
      Management tools need to be able to know about every node in the graph
      and need a way to address them. Changing the graph structure was okay
      because libvirt doesn't really manage the node level yet, but future
      libvirt versions need to deal with both new and old version of qemu.
      
      This new option to blockdev-commit allows the client to set a node-name
      for the automatically inserted filter driver, and at the same time
      serves as a witness for a future libvirt that this version of qemu does
      automatically insert a filter driver.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      0db832f4
    • K
      mirror: Use real permissions in mirror/active commit block job · 4ef85a9c
      Kevin Wolf 提交于
      The mirror block job is mainly used for two different scenarios:
      Mirroring to an otherwise unused, independent target node, or for active
      commit where the target node is part of the backing chain of the source.
      
      Similarly to the commit block job patch, we need to insert a new filter
      node to keep the permissions correct during active commit.
      
      Note that one change this implies is that job->blk points to
      mirror_top_bs as its root now, and mirror_top_bs (rather than the actual
      source node) contains the bs->job pointer. This requires qemu-img commit
      to get the job by name now rather than just taking bs->job.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      Acked-by: NMax Reitz <mreitz@redhat.com>
      4ef85a9c
    • K
      block: Add BDRV_O_RESIZE for blk_new_open() · 55880601
      Kevin Wolf 提交于
      blk_new_open() is a convenience function that processes flags rather
      than QDict options as a simple way to just open an image file.
      
      In order to keep it convenient in the future, it must automatically
      request the necessary permissions. This can easily be inferred from the
      flags for read and write, but we need another flag that tells us whether
      to get the resize permission.
      
      We can't just always request it because that means that no block jobs
      can run on the resulting BlockBackend (which is something that e.g.
      qemu-img commit wants to do), but we also can't request it never because
      most of the .bdrv_create() implementations call blk_truncate().
      
      The solution is to introduce another flag that is passed by all users
      that want to resize the image.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      55880601
    • P
      qemu-img: make convert async · 2d9187bc
      Peter Lieven 提交于
      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: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2d9187bc
  18. 24 2月, 2017 2 次提交