1. 04 12月, 2013 1 次提交
  2. 11 10月, 2013 4 次提交
  3. 26 9月, 2013 1 次提交
  4. 12 9月, 2013 6 次提交
  5. 30 8月, 2013 4 次提交
    • M
      qcow2-refcount: Repair OFLAG_COPIED errors · e23e400e
      Max Reitz 提交于
      Since the OFLAG_COPIED checks are now executed after the refcounts have
      been repaired (if repairing), it is safe to assume that they are correct
      but the OFLAG_COPIED flag may be not. Therefore, if its value differs
      from what it should be (considering the according refcount), that
      discrepancy can be repaired by correctly setting (or clearing that flag.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e23e400e
    • M
      qcow2: Metadata overlap checks · a40f1c2a
      Max Reitz 提交于
      Two new functions are added; the first one checks a given range in the
      image file for overlaps with metadata (main header, L1 tables, L2
      tables, refcount table and blocks).
      
      The second one should be used immediately before writing to the image
      file as it calls the first function and, upon collision, marks the
      image as corrupt and makes the BDS unusable, thereby preventing
      further access.
      
      Both functions take a bitmask argument specifying the structures which
      should be checked for overlaps, making it possible to also check
      metadata writes against colliding with other structures.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a40f1c2a
    • M
      qcow2: Add corrupt bit · 69c98726
      Max Reitz 提交于
      This adds an incompatible bit indicating corruption to qcow2. Any image
      with this bit set may not be written to unless for repairing (and
      subsequently clearing the bit if the repair has been successful).
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      69c98726
    • P
      block/qcow2.h: Avoid "1LL << 63" (shifts into sign bit) · 127c84e1
      Peter Maydell 提交于
      The expression "1LL << 63" tries to shift the 1 into the sign bit of a
      'long long', which provokes a clang sanitizer warning:
      
      runtime error: left shift of 1 by 63 places cannot be represented in type 'long long'
      
      Use "1ULL << 63" as the definition of QCOW_OFLAG_COPIED instead
      to avoid this. For consistency, we also update the other QCOW_OFLAG
      definitions to use the ULL suffix rather than LL, though only the
      shift by 63 is undefined behaviour.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      127c84e1
  6. 27 7月, 2013 1 次提交
  7. 24 6月, 2013 3 次提交
  8. 14 5月, 2013 1 次提交
    • K
      qcow2: Catch some L1 table index overflows · 2cf7cfa1
      Kevin Wolf 提交于
      This catches the situation that is described in the bug report at
      https://bugs.launchpad.net/qemu/+bug/865518 and goes like this:
      
          $ qemu-img create -f qcow2 huge.qcow2 $((1024*1024))T
          Formatting 'huge.qcow2', fmt=qcow2 size=1152921504606846976 encryption=off cluster_size=65536 lazy_refcounts=off
          $ qemu-io /tmp/huge.qcow2 -c "write $((1024*1024*1024*1024*1024*1024 - 1024)) 512"
          Segmentation fault
      
      With this patch applied the segfault will be avoided, however the case
      will still fail, though gracefully:
      
          $ qemu-img create -f qcow2 /tmp/huge.qcow2 $((1024*1024))T
          Formatting 'huge.qcow2', fmt=qcow2 size=1152921504606846976 encryption=off cluster_size=65536 lazy_refcounts=off
          qemu-img: The image size is too large for file format 'qcow2'
      
      Note that even long before these overflow checks kick in, you get
      insanely high memory usage (up to INT_MAX * sizeof(uint64_t) = 16 GB for
      the L1 table), so with somewhat smaller image sizes you'll probably see
      qemu aborting for a failed g_malloc().
      
      If you need huge image sizes, you should increase the cluster size to
      the maximum of 2 MB in order to get higher limits.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      2cf7cfa1
  9. 13 4月, 2013 1 次提交
  10. 28 3月, 2013 5 次提交
  11. 19 3月, 2013 1 次提交
  12. 15 3月, 2013 1 次提交
  13. 19 12月, 2012 1 次提交
  14. 13 12月, 2012 5 次提交
  15. 07 8月, 2012 2 次提交
    • S
      qcow2: implement lazy refcounts · bfe8043e
      Stefan Hajnoczi 提交于
      Lazy refcounts is a performance optimization for qcow2 that postpones
      refcount metadata updates and instead marks the image dirty.  In the
      case of crash or power failure the image will be left in a dirty state
      and repaired next time it is opened.
      
      Reducing metadata I/O is important for cache=writethrough and
      cache=directsync because these modes guarantee that data is on disk
      after each write (hence we cannot take advantage of caching updates in
      RAM).  Refcount metadata is not needed for guest->file block address
      translation and therefore does not need to be on-disk at the time of
      write completion - this is the motivation behind the lazy refcount
      optimization.
      
      The lazy refcount optimization must be enabled at image creation time:
      
        qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=on a.qcow2 10G
        qemu-system-x86_64 -drive if=virtio,file=a.qcow2,cache=writethrough
      
      Update qemu-iotests 031 and 036 since the extension header size changes
      when we add feature bit table entries.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      bfe8043e
    • S
      qcow2: introduce dirty bit · c61d0004
      Stefan Hajnoczi 提交于
      This patch adds an incompatible feature bit to mark images that have not
      been closed cleanly.  When a dirty image file is opened a consistency
      check and repair is performed.
      
      Update qemu-iotests 031 and 036 since the extension header size changes
      when we add feature bit table entries.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c61d0004
  16. 15 6月, 2012 2 次提交
  17. 20 4月, 2012 1 次提交