1. 09 4月, 2015 1 次提交
    • P
      block/iscsi: handle zero events from iscsi_which_events · 05b685fb
      Peter Lieven 提交于
      newer libiscsi versions may return zero events from iscsi_which_events.
      
      In this case iscsi_service will return immediately without any progress.
      To avoid busy waiting for iscsi_which_events to change we deregister all
      read and write handlers in this case and schedule a timer to periodically
      check iscsi_which_events for changed events.
      
      Next libiscsi version will introduce async reconnects and zero events
      are returned while libiscsi is waiting for a reconnect retry.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Message-id: 1428437295-29577-1-git-send-email-pl@kamp.de
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      05b685fb
  2. 10 3月, 2015 1 次提交
  3. 28 2月, 2015 1 次提交
  4. 03 1月, 2015 1 次提交
  5. 03 11月, 2014 3 次提交
  6. 31 10月, 2014 1 次提交
  7. 20 10月, 2014 3 次提交
  8. 30 9月, 2014 1 次提交
  9. 26 9月, 2014 1 次提交
  10. 22 9月, 2014 2 次提交
  11. 12 9月, 2014 1 次提交
  12. 26 8月, 2014 1 次提交
  13. 22 8月, 2014 1 次提交
  14. 20 8月, 2014 1 次提交
    • M
      block: Use g_new() & friends where that makes obvious sense · 5839e53b
      Markus Armbruster 提交于
      g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
      for two reasons.  One, it catches multiplication overflowing size_t.
      Two, it returns T * rather than void *, which lets the compiler catch
      more type errors.
      
      Patch created with Coccinelle, with two manual changes on top:
      
      * Add const to bdrv_iterate_format() to keep the types straight
      
      * Convert the allocation in bdrv_drop_intermediate(), which Coccinelle
        inexplicably misses
      
      Coccinelle semantic patch:
      
          @@
          type T;
          @@
          -g_malloc(sizeof(T))
          +g_new(T, 1)
          @@
          type T;
          @@
          -g_try_malloc(sizeof(T))
          +g_try_new(T, 1)
          @@
          type T;
          @@
          -g_malloc0(sizeof(T))
          +g_new0(T, 1)
          @@
          type T;
          @@
          -g_try_malloc0(sizeof(T))
          +g_try_new0(T, 1)
          @@
          type T;
          expression n;
          @@
          -g_malloc(sizeof(T) * (n))
          +g_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc(sizeof(T) * (n))
          +g_try_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_malloc0(sizeof(T) * (n))
          +g_new0(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc0(sizeof(T) * (n))
          +g_try_new0(T, n)
          @@
          type T;
          expression p, n;
          @@
          -g_realloc(p, sizeof(T) * (n))
          +g_renew(T, p, n)
          @@
          type T;
          expression p, n;
          @@
          -g_try_realloc(p, sizeof(T) * (n))
          +g_try_renew(T, p, n)
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5839e53b
  15. 15 8月, 2014 1 次提交
  16. 18 7月, 2014 1 次提交
  17. 25 6月, 2014 1 次提交
  18. 19 6月, 2014 3 次提交
  19. 18 6月, 2014 3 次提交
    • P
      block/iscsi: use 16 byte CDBs only when necessary · 9281fe9e
      Peter Lieven 提交于
      this patch changes the driver to uses 16 Byte CDBs for
      READ/WRITE only if the target requires 64bit lba addressing.
      
      On one hand this saves 6 bytes in each PDU on the other
      hand it seems that 10 Byte CDBs seems to be much better
      supported and tested as a recent issue I had with a
      major storage supplier lined out.
      
      For WRITESAME the logic is a bit more tricky as WRITESAME10
      with UNMAP was added really late. Thus a fallback to WRITESAME16
      is possible if it supports UNMAP and WRITESAME10 not.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9281fe9e
    • P
      block/iscsi: fix potential segfault on early callback · fcd470d8
      Peter Lieven 提交于
      it might happen in the future that a function directly invokes its callback.
      In this case we end up in a segfault because the iTask is gone when the BH
      is scheduled.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fcd470d8
    • P
      block/iscsi: handle BUSY condition · efc6de0d
      Peter Lieven 提交于
      this patch adds handling of BUSY status reponse from an iSCSI target.
      Currently, we fail with -EIO in case of SCSI_STATUS_BUSY while the
      obvious reaction would be to retry the operation after some time.
      The retry time is randomly choosen from a range with exponential
      growth increasing with each retry.
      
      This patch includes most of the changes by a an upcoming patch
      from Stefan Hajnoczi:
      
       iscsi: implement .bdrv_detach/attach_aio_context()
      
      because I also need the reference to the aio_context for
      the retry timer to work. I included the changes to maintain
      better mergeability.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      efc6de0d
  20. 16 6月, 2014 3 次提交
  21. 04 6月, 2014 1 次提交
  22. 20 5月, 2014 1 次提交
  23. 09 5月, 2014 1 次提交
  24. 05 5月, 2014 1 次提交
  25. 29 4月, 2014 3 次提交
    • P
      block/iscsi: allow cluster_size of 4K and greater · 3d2acaa3
      Peter Lieven 提交于
      depending on the target the opt_unmap_gran might be as low
      as 4K. As we know use this also as a knob to activate the allocationmap
      feature lower the barrier. The limit 4K (and not 512) is choosen
      to avoid a potentially too big allocationmap.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3d2acaa3
    • P
      5917af81
    • P
      block/iscsi: speed up read for unallocated sectors · b03c3805
      Peter Lieven 提交于
      this patch implements a cache that tracks if a page on the
      iscsi target is allocated or not. The cache is implemented in
      a way that it allows for false positives
      (e.g. pretending a page is allocated, but it isn't), but
      no false negatives.
      
      The cached allocation info is then used to speed up the
      read process for unallocated sectors by issueing a GET_LBA_STATUS
      request for all sectors that are not yet known to be allocated.
      If the read request is confirmed to fall into an unallocated
      range we directly return zeroes and do not transfer the
      data over the wire.
      
      Tests have shown that a relatively small amount of GET_LBA_STATUS
      requests happens a vServer boot time to fill the allocation cache
      (all those blocks are not queried again).
      
      Not to transfer all the data of unallocated sectors saves a lot
      of time, bandwidth and storage I/O load during block jobs or storage
      migration and it saves a lot of bandwidth as well for any big sequential
      read of the whole disk (e.g. block copy or speed tests) if a significant
      number of blocks is unallocated.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b03c3805
  26. 28 4月, 2014 1 次提交
  27. 26 4月, 2014 1 次提交