1. 08 5月, 2015 1 次提交
  2. 28 4月, 2015 1 次提交
    • S
      Convert (ffs(val) - 1) to ctz32(val) · 786a4ea8
      Stefan Hajnoczi 提交于
      This commit was generated mechanically by coccinelle from the following
      semantic patch:
      
      @@
      expression val;
      @@
      - (ffs(val) - 1)
      + ctz32(val)
      
      The call sites have been audited to ensure the ffs(0) - 1 == -1 case
      never occurs (due to input validation, asserts, etc).  Therefore we
      don't need to worry about the fact that ctz32(0) == 32.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1427124571-28598-5-git-send-email-stefanha@redhat.com
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      786a4ea8
  3. 10 3月, 2015 2 次提交
  4. 09 3月, 2015 1 次提交
    • T
      sheepdog: selectable object size support · 876eb1b0
      Teruaki Ishizaki 提交于
      Previously, qemu block driver of sheepdog used hard-coded VDI object size.
      This patch enables users to handle VDI object size.
      
      When you start qemu, you don't need to specify additional command option.
      
      But when you create the VDI which doesn't have default object size
      with qemu-img command, you specify object_size option.
      
      If you want to create a VDI of 8MB object size,
      you need to specify following command option.
      
       # qemu-img create -o object_size=8M sheepdog:test1 100M
      
      In addition, when you don't specify qemu-img command option,
      a default value of sheepdog cluster is used for creating VDI.
      
       # qemu-img create sheepdog:test2 100M
      Signed-off-by: NTeruaki Ishizaki <ishizaki.teruaki@lab.ntt.co.jp>
      Acked-by: NHitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      876eb1b0
  5. 18 2月, 2015 1 次提交
  6. 16 2月, 2015 2 次提交
  7. 20 10月, 2014 1 次提交
  8. 22 9月, 2014 2 次提交
  9. 12 9月, 2014 1 次提交
  10. 29 8月, 2014 3 次提交
  11. 20 8月, 2014 2 次提交
    • M
      block: Use g_new() & friends to avoid multiplying sizes · 02c4f26b
      Markus Armbruster 提交于
      g_new(T, n) is safer than g_malloc(sizeof(*v) * n) 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.
      
      Perhaps a conversion to g_malloc_n() would be neater in places, but
      that's merely four years old, and we can't use such newfangled stuff.
      
      This commit only touches allocations with size arguments of the form
      sizeof(T), plus two that use 4 instead of sizeof(uint32_t).  We can
      make the others safe by converting to g_malloc_n() when it becomes
      available to us in a couple of years.
      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>
      02c4f26b
    • 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
  12. 23 6月, 2014 1 次提交
  13. 16 6月, 2014 2 次提交
  14. 06 6月, 2014 2 次提交
    • H
      sheepdog: reload only header in a case of live snapshot · 5d039bab
      Hitoshi Mitake 提交于
      sheepdog driver doesn't need to read data_vdi_id[] when a live snapshot is
      created.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Liu Yuan <namei.unix@gmail.com>
      Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      Signed-off-by: NHitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      5d039bab
    • H
      sheepdog: fix vdi object update after live snapshot · b544c1ab
      Hitoshi Mitake 提交于
      sheepdog driver should decide a write request is COW or not based on inode
      object which is active when the write request is issued.
      
      Example of wrong inode update path in the previous driver:
      1. drier issues an ordinal write request to an existing object
      2. user creates a snapshot of the VDI before the write request is completed
      3. the respones for the request is RDONLY, because the VDI is already a snapshot
      4. the driver reload an inode object of the new active VDI, then issues a write
         request again
      5. the second write request can be completed
      6. driver decide the request is COW or not with the below conditional branch:
         	  if (s->inode.data_vdi_id[idx] != s->inode.vdi_id) {
      7. the ID of the written object and VID of the new active VDI is different, so
         the driver updates data_vdi_id[idx] and writes inode object
      8. the existing object cannot be seen by the new active VDI, it results object
         leaking
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Liu Yuan <namei.unix@gmail.com>
      Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      Signed-off-by: NHitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      b544c1ab
  15. 04 6月, 2014 1 次提交
  16. 30 5月, 2014 1 次提交
  17. 28 5月, 2014 8 次提交
  18. 30 4月, 2014 1 次提交
  19. 25 3月, 2014 1 次提交
  20. 22 2月, 2014 1 次提交
  21. 18 2月, 2014 1 次提交
  22. 24 1月, 2014 1 次提交
  23. 22 1月, 2014 2 次提交
  24. 07 1月, 2014 1 次提交