1. 22 Apr, 2013 1 commit
    • Kevin Wolf's avatar
      block: Add driver-specific options for backing files · 31ca6d07
      Kevin Wolf authored
      
      
      Options starting in "backing." are passed to the backing file now. If
      you don't need to specify the filename for the backing file, you can add
      it on the command line instead of in the image file:
      
      $ qemu-nbd -t /tmp/test.img
      $ qemu-img create -f qcow2 empty.qcow2 1G
      $ qemu-system-x86_64 -drive file=empty.qcow2,backing.file.driver=nbd,\
          backing.file.host=localhost
      
      Note that this doesn't override the backing filename from the image. If
      the image has one, this will fail because NBD doesn't want the options
      and a filename at the same time.
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      31ca6d07
  2. 15 Apr, 2013 2 commits
  3. 22 Mar, 2013 1 commit
  4. 15 Mar, 2013 1 commit
  5. 22 Feb, 2013 5 commits
  6. 25 Jan, 2013 3 commits
  7. 14 Jan, 2013 1 commit
  8. 02 Jan, 2013 1 commit
    • Stefan Hajnoczi's avatar
      raw-posix: add raw_get_aio_fd() for virtio-blk-data-plane · 4065742a
      Stefan Hajnoczi authored
      
      
      The raw_get_aio_fd() function allows virtio-blk-data-plane to get the
      file descriptor of a raw image file with Linux AIO enabled.  This
      interface is really a layering violation that can be resolved once the
      block layer is able to run outside the global mutex - at that point
      virtio-blk-data-plane will switch from custom Linux AIO code to using
      the block layer.
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      4065742a
  9. 19 Dec, 2012 3 commits
  10. 12 Dec, 2012 1 commit
    • Kevin Wolf's avatar
      qemu-io: Add AIO debugging commands · 41c695c7
      Kevin Wolf authored
      
      
      This makes the blkdebug suspend/resume functionality available in
      qemu-io. Use it like this:
      
        $ ./qemu-io blkdebug::/tmp/test.qcow2
        qemu-io> break write_aio req_a
        qemu-io> aio_write 0 4k
        qemu-io> blkdebug: Suspended request 'req_a'
        qemu-io> resume req_a
        blkdebug: Resuming request 'req_a'
        qemu-io> wrote 4096/4096 bytes at offset 0
        4 KiB, 1 ops; 0:00:30.71 (133.359788 bytes/sec and 0.0326 ops/sec)
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      41c695c7
  11. 11 Dec, 2012 2 commits
  12. 24 Oct, 2012 4 commits
  13. 23 Oct, 2012 1 commit
  14. 28 Sep, 2012 7 commits
  15. 24 Sep, 2012 2 commits
    • Jeff Cody's avatar
      block: Framework for reopening files safely · e971aa12
      Jeff Cody authored
      
      
      This is based on Supriya Kannery's bdrv_reopen() patch series.
      
      This provides a transactional method to reopen multiple
      images files safely.
      
      Image files are queue for reopen via bdrv_reopen_queue(), and the
      reopen occurs when bdrv_reopen_multiple() is called.  Changes are
      staged in bdrv_reopen_prepare() and in the equivalent driver level
      functions.  If any of the staged images fails a prepare, then all
      of the images left untouched, and the staged changes for each image
      abandoned.
      
      Block drivers are passed a reopen state structure, that contains:
          * BDS to reopen
          * flags for the reopen
          * opaque pointer for any driver-specific data that needs to be
            persistent from _prepare to _commit/_abort
          * reopen queue pointer, if the driver needs to queue additional
            BDS for a reopen
      Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      e971aa12
    • Jeff Cody's avatar
      block: correctly set the keep_read_only flag · be028adc
      Jeff Cody authored
      
      
      I believe the bs->keep_read_only flag is supposed to reflect
      the initial open state of the device. If the device is initially
      opened R/O, then commit operations, or reopen operations changing
      to R/W, are prohibited.
      
      Currently, the keep_read_only flag is only accurate for the active
      layer, and its backing file. Subsequent images end up always having
      the keep_read_only flag set.
      
      For instance, what happens now:
      
      [  base  ]  kro = 1, ro = 1
          |
          v
      [ snap-1 ]  kro = 1, ro = 1
          |
          v
      [ snap-2 ]  kro = 0, ro = 1
          |
          v
      [ active ]  kro = 0, ro = 0
      
      What we want:
      
      [  base  ]  kro = 0, ro = 1
          |
          v
      [ snap-1 ]  kro = 0, ro = 1
          |
          v
      [ snap-2 ]  kro = 0, ro = 1
          |
          v
      [ active ]  kro = 0, ro = 0
      Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      be028adc
  16. 10 Aug, 2012 1 commit
    • Stefan Hajnoczi's avatar
      block: add BLOCK_O_CHECK for qemu-img check · 058f8f16
      Stefan Hajnoczi authored
      
      
      Image formats with a dirty bit, like qed and qcow2, repair dirty image
      files upon open with BDRV_O_RDWR.  Performing automatic repair when
      qemu-img check runs is not ideal because the bdrv_open() call repairs
      the image before the actual bdrv_check() call from qemu-img.c.
      
      Fix this "double repair" since it leads to confusing output from
      qemu-img check.  Tell the block driver that this image is being opened
      just for bdrv_check().  This skips automatic repair and qemu-img.c can
      invoke it manually with bdrv_check().
      
      Update the golden output for qemu-iotests 039 to reflect the new
      qemu-img check output.
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      058f8f16
  17. 03 Aug, 2012 1 commit
  18. 17 Jul, 2012 3 commits