1. 11 11月, 2015 1 次提交
    • A
      commit: reopen overlay_bs before base · 3db2bd55
      Alberto Garcia 提交于
      'block-commit' needs write access to two different nodes of the chain:
      
      - 'base', because that's where the data is written to.
      - the overlay of 'top', because it needs to update the backing file
        string to point to 'base' after the operation.
      
      Both images have to be opened in read-write mode, and commit_start()
      takes care of reopening them if necessary.
      
      With the current implementation, however, when overlay_bs is reopened
      in read-write mode it has the side effect of making 'base' read-only
      again, eventually making 'block-commit' fail.
      
      This needs to be fixed in bdrv_reopen(), but until we get to that it
      can be worked around simply by swapping the order of base and
      overlay_bs in the reopen queue.
      
      In order to reproduce this bug, overlay_bs needs to be initially in
      read-only mode. That is: the 'top' parameter of 'block-commit' cannot
      be the active layer nor its immediate backing chain.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      3db2bd55
  2. 24 10月, 2015 1 次提交
  3. 14 9月, 2015 1 次提交
  4. 23 6月, 2015 2 次提交
  5. 03 11月, 2014 1 次提交
    • S
      block: let commit blockjob run in BDS AioContext · 9e85cd5c
      Stefan Hajnoczi 提交于
      The commit block job must run in the BlockDriverState AioContext so that
      it works with dataplane.
      
      Acquire the AioContext in blockdev.c so starting the block job is safe.
      One detail here is that the bdrv_drain_all() must be moved inside the
      aio_context_acquire() region so requests cannot sneak in between the
      drain and acquire.
      
      The completion code in block/commit.c must perform backing chain
      manipulation and bdrv_reopen() from the main loop.  Use
      block_job_defer_to_main_loop() to achieve that.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 1413889440-32577-11-git-send-email-stefanha@redhat.com
      9e85cd5c
  6. 20 10月, 2014 1 次提交
  7. 01 7月, 2014 1 次提交
    • J
      block: extend block-commit to accept a string for the backing file · 54e26900
      Jeff Cody 提交于
      On some image chains, QEMU may not always be able to resolve the
      filenames properly, when updating the backing file of an image
      after a block commit.
      
      For instance, certain relative pathnames may fail, or drives may
      have been specified originally by file descriptor (e.g. /dev/fd/???),
      or a relative protocol pathname may have been used.
      
      In these instances, QEMU may lack the information to be able to make
      the correct choice, but the user or management layer most likely does
      have that knowledge.
      
      With this extension to the block-commit api, the user is able to change
      the backing file of the overlay image as part of the block-commit
      operation.
      
      This allows the change to be 'safe', in the sense that if the attempt
      to write the overlay image metadata fails, then the block-commit
      operation returns failure, without disrupting the guest.
      
      If the commit top is the active layer, then specifying the backing
      file string will be treated as an error (there is no overlay image
      to modify in that case).
      
      If a backing file string is not specified in the command, the backing
      file string to use is determined in the same manner as it was
      previously.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      54e26900
  8. 25 4月, 2014 1 次提交
  9. 20 12月, 2013 1 次提交
  10. 11 10月, 2013 2 次提交
  11. 06 9月, 2013 1 次提交
  12. 23 8月, 2013 1 次提交
  13. 28 6月, 2013 1 次提交
  14. 17 1月, 2013 1 次提交
  15. 19 12月, 2012 1 次提交
  16. 11 12月, 2012 1 次提交
  17. 24 10月, 2012 2 次提交
  18. 29 9月, 2012 3 次提交