1. 04 6月, 2013 2 次提交
    • S
      block: drop bs_snapshots global variable · 29d78271
      Stefan Hajnoczi 提交于
      The bs_snapshots global variable points to the BlockDriverState which
      will be used to save vmstate.  This is really a savevm.c concept but was
      moved into block.c:bdrv_snapshots() when it became clear that hotplug
      could result in a dangling pointer.
      
      While auditing the block layer's global state I came upon bs_snapshots
      and realized that a variable is not necessary here.  Simply find the
      first BlockDriverState capable of internal snapshots each time this is
      needed.
      
      The behavior of bdrv_snapshots() is preserved across hotplug because new
      drives are always appended to the bdrv_states list.  This means that
      calling the new find_vmstate_bs() function is idempotent - it returns
      the same BlockDriverState unless it was hot-unplugged.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NWenchao Xia <xiawenc@linux.vnet.ibm.com>
      Signed-off-by: NWenchao Xia <xiawenc@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      29d78271
    • F
      block: add block driver read only whitelist · b64ec4e4
      Fam Zheng 提交于
      We may want to include a driver in the whitelist for read only tasks
      such as diagnosing or exporting guest data (with libguestfs as a good
      example). This patch introduces a readonly whitelist option, and for
      backward compatibility, the old configure option --block-drv-whitelist
      is now an alias to rw whitelist.
      
      Drivers in readonly list is only permitted to open file readonly, and
      returns -ENOTSUP for RW opening.
      
      E.g. To include vmdk readonly, and others read+write:
          ./configure --target-list=x86_64-softmmu \
                      --block-drv-rw-whitelist=qcow2,raw,file,qed \
                      --block-drv-ro-whitelist=vmdk
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b64ec4e4
  2. 14 5月, 2013 1 次提交
  3. 23 4月, 2013 1 次提交
  4. 22 4月, 2013 5 次提交
  5. 15 4月, 2013 2 次提交
  6. 06 4月, 2013 4 次提交
  7. 28 3月, 2013 1 次提交
  8. 23 3月, 2013 6 次提交
  9. 19 3月, 2013 1 次提交
  10. 15 3月, 2013 4 次提交
  11. 04 3月, 2013 1 次提交
  12. 23 2月, 2013 4 次提交
  13. 01 2月, 2013 1 次提交
  14. 26 1月, 2013 4 次提交
  15. 15 1月, 2013 2 次提交
    • P
      block: clear dirty bitmap when discarding · df702c9b
      Paolo Bonzini 提交于
      Note that resetting bits in the dirty bitmap is done _before_ actually
      processing the request.  Writes, instead, set bits after the request
      is completed.
      
      This way, when there are concurrent write and discard requests, the
      outcome will always be that the blocks are marked dirty.  This scenario
      should never happen, but it is safer to do it this way.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      df702c9b
    • P
      block: fix initialization in bdrv_io_limits_enable() · 029d091e
      Peter Lieven 提交于
      bdrv_io_limits_enable() starts a new slice, but does not set io_base
      correctly for that slice.
      
      Here is how io_base is used:
      
          bytes_base  = bs->nr_bytes[is_write] - bs->io_base.bytes[is_write];
          bytes_res   = (unsigned) nb_sectors * BDRV_SECTOR_SIZE;
      
          if (bytes_base + bytes_res <= bytes_limit) {
              /* no wait */
          } else {
              /* operation needs to be throttled */
          }
      
      As a result, any I/O operations that are triggered between now and
      bs->slice_end are incorrectly limited.  If 10 MB of data has been
      written since the VM was started, QEMU thinks that 10 MB of data has
      been written in this slice. This leads to a I/O lockup in the guest.
      
      We fix this by delaying the start of a new slice to the next
      call of bdrv_exceed_io_limits().
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      029d091e
  16. 14 1月, 2013 1 次提交