1. 06 9月, 2016 6 次提交
  2. 18 8月, 2016 2 次提交
    • D
      block: fix possible reorder of flush operations · 156af3ac
      Denis V. Lunev 提交于
      This patch reduce CPU usage of flush operations a bit. When we have one
      flush completed we should kick only next operation. We should not start
      all pending operations in the hope that they will go back to wait on
      wait_queue.
      
      Also there is a technical possibility that requests will get reordered
      with the previous approach. After wakeup all requests are removed from
      the wait queue. They become active and they are processed one-by-one
      adding to the wait queue in the same order. Though new flush can arrive
      while all requests are not put into the queue.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Tested-by: NEvgeny Yakovlev <eyakovlev@virtuozzo.com>
      Signed-off-by: NEvgeny Yakovlev <eyakovlev@virtuozzo.com>
      Message-id: 1471457214-3994-3-git-send-email-den@openvz.org
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Fam Zheng <famz@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      156af3ac
    • E
      block: fix deadlock in bdrv_co_flush · ce83ee57
      Evgeny Yakovlev 提交于
      The following commit
          commit 3ff2f67a
          Author: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
          Date:   Mon Jul 18 22:39:52 2016 +0300
          block: ignore flush requests when storage is clean
      has introduced a regression.
      
      There is a problem that it is still possible for 2 requests to execute
      in non sequential fashion and sometimes this results in a deadlock
      when bdrv_drain_one/all are called for BDS with such stalled requests.
      
      1. Current flushed_gen and flush_started_gen is 1.
      2. Request 1 enters bdrv_co_flush to with write_gen 1 (i.e. the same
         as flushed_gen). It gets past flushed_gen != flush_started_gen and
         sets flush_started_gen to 1 (again, the same it was before).
      3. Request 1 yields somewhere before exiting bdrv_co_flush
      4. Request 2 enters bdrv_co_flush with write_gen 2. It gets past
         flushed_gen != flush_started_gen and sets flush_started_gen to 2.
      5. Request 2 runs to completion and sets flushed_gen to 2
      6. Request 1 is resumed, runs to completion and sets flushed_gen to 1.
         However flush_started_gen is now 2.
      
      From here on out flushed_gen is always != to flush_started_gen and all
      further requests will wait on flush_queue. This change replaces
      flush_started_gen with an explicitly tracked active flush request.
      Signed-off-by: NEvgeny Yakovlev <eyakovlev@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Message-id: 1471457214-3994-2-git-send-email-den@openvz.org
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Fam Zheng <famz@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      ce83ee57
  3. 17 8月, 2016 1 次提交
    • F
      curl: Cast fd to int for DPRINTF · 92b6a160
      Fam Zheng 提交于
      Currently "make docker-test-mingw@fedora" has a warning like:
      
          /tmp/qemu-test/src/block/curl.c: In function 'curl_sock_cb':
          /tmp/qemu-test/src/block/curl.c:172:6: warning: format '%d' expects
          argument of type 'int', but argument 4 has type 'curl_socket_t {aka long
          long unsigned int}'
               DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd);
                ^
          cc1: all warnings being treated as errors
      
      Cast to int to suppress it.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-Id: <1470027888-24381-1-git-send-email-famz@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      92b6a160
  4. 15 8月, 2016 4 次提交
  5. 12 8月, 2016 1 次提交
  6. 11 8月, 2016 1 次提交
  7. 08 8月, 2016 1 次提交
  8. 05 8月, 2016 1 次提交
  9. 04 8月, 2016 2 次提交
    • E
      block: Cater to iscsi with non-power-of-2 discard · b8d0a980
      Eric Blake 提交于
      Dell Equallogic iSCSI SANs have a very unusual advertised geometry:
      
      $ iscsi-inq -e 1 -c $((0xb0)) iscsi://XXX/0
      wsnz:0
      maximum compare and write length:1
      optimal transfer length granularity:0
      maximum transfer length:0
      optimal transfer length:0
      maximum prefetch xdread xdwrite transfer length:0
      maximum unmap lba count:30720
      maximum unmap block descriptor count:2
      optimal unmap granularity:30720
      ugavalid:1
      unmap granularity alignment:0
      maximum write same length:30720
      
      which says that both the maximum and the optimal discard size
      is 15M.  It is not immediately apparent if the device allows
      discard requests not aligned to the optimal size, nor if it
      allows discards at a finer granularity than the optimal size.
      
      I tried to find details in the SCSI Commands Reference Manual
      Rev. A on what valid values of maximum and optimal sizes are
      permitted, but while that document mentions a "Block Limits
      VPD Page", I couldn't actually find documentation of that page
      or what values it would have, or if a SCSI device has an
      advertisement of its minimal unmap granularity.  So it is not
      obvious to me whether the Dell Equallogic device is compliance
      with the SCSI specification.
      
      Fortunately, it is easy enough to support non-power-of-2 sizing,
      even if it means we are less efficient than truly possible when
      targetting that device (for example, it means that we refuse to
      unmap anything that is not a multiple of 15M and aligned to a
      15M boundary, even if the device truly does support a smaller
      granularity where unmapping actually works).
      Reported-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1469129688-22848-5-git-send-email-eblake@redhat.com>
      Acked-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b8d0a980
    • E
      nbd: Limit nbdflags to 16 bits · 7423f417
      Eric Blake 提交于
      Rather than asserting that nbdflags is within range, just give
      it the correct type to begin with :)  nbdflags corresponds to
      the per-export portion of NBD Protocol "transmission flags", which
      is 16 bits in response to NBD_OPT_EXPORT_NAME and NBD_OPT_GO.
      
      Furthermore, upstream NBD has never passed the global flags to
      the kernel via ioctl(NBD_SET_FLAGS) (the ioctl was first
      introduced in NBD 2.9.22; then a latent bug in NBD 3.1 actually
      tried to OR the global flags with the transmission flags, with
      the disaster that the addition of NBD_FLAG_NO_ZEROES in 3.9
      caused all earlier NBD 3.x clients to treat every export as
      read-only; NBD 3.10 and later intentionally clip things to 16
      bits to pass only transmission flags).  Qemu should follow suit,
      since the current two global flags (NBD_FLAG_FIXED_NEWSTYLE
      and NBD_FLAG_NO_ZEROES) have no impact on the kernel's behavior
      during transmission.
      
      CC: qemu-stable@nongnu.org
      Signed-off-by: NEric Blake <eblake@redhat.com>
      
      Message-Id: <1469129688-22848-3-git-send-email-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7423f417
  10. 27 7月, 2016 1 次提交
  11. 26 7月, 2016 2 次提交
    • D
      block: export LUKS specific data to qemu-img info · c7c4cf49
      Daniel P. Berrange 提交于
      The qemu-img info command has the ability to expose format
      specific metadata about volumes. Wire up this facility for
      the LUKS driver to report on cipher configuration and key
      slot usage.
      
          $ qemu-img info ~/VirtualMachines/demo.luks
          image: /home/berrange/VirtualMachines/demo.luks
          file format: luks
          virtual size: 98M (102760448 bytes)
          disk size: 100M
          encrypted: yes
          Format specific information:
              ivgen alg: plain64
              hash alg: sha1
              cipher alg: aes-128
              uuid: 6ddee74b-3a22-408c-8909-6789d4fa2594
              cipher mode: xts
              slots:
                  [0]:
                      active: true
                      iters: 572706
                      key offset: 4096
                      stripes: 4000
                  [1]:
                      active: false
                      key offset: 135168
                  [2]:
                      active: false
                      key offset: 266240
                  [3]:
                      active: false
                      key offset: 397312
                  [4]:
                      active: false
                      key offset: 528384
                  [5]:
                      active: false
                      key offset: 659456
                  [6]:
                      active: false
                      key offset: 790528
                  [7]:
                      active: false
                      key offset: 921600
              payload offset: 2097152
              master key iters: 142375
      
      One somewhat undesirable artifact is that the data fields are
      printed out in (apparently) random order. This will be addressed
      later by changing the way the block layer pretty-prints the
      image specific data.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1469192015-16487-3-git-send-email-berrange@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c7c4cf49
    • V
      qcow2: do not allocate extra memory · ebf7bba0
      Vladimir Sementsov-Ogievskiy 提交于
      There are no needs to allocate more than one cluster, as we set
      avail_out for deflate to one cluster.
      
      Zlib docs (http://www.zlib.net/manual.html) says:
      "deflate compresses as much data as possible, and stops when the input
      buffer becomes empty or the output buffer becomes full."
      
      So, deflate will not write more than avail_out to output buffer. If
      there is not enough space in output buffer for compressed data (it may
      be larger than input data) deflate just returns Z_OK. (if all data is
      compressed and written to output buffer deflate returns Z_STREAM_END).
      Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-id: 1468515565-81313-1-git-send-email-vsementsov@virtuozzo.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      ebf7bba0
  12. 22 7月, 2016 1 次提交
  13. 20 7月, 2016 17 次提交