1. 28 4月, 2015 1 次提交
  2. 10 3月, 2015 1 次提交
  3. 10 12月, 2014 1 次提交
  4. 10 11月, 2014 1 次提交
    • M
      block/vdi: Limit maximum size even futher · d20418ee
      Max Reitz 提交于
      The block layer read and write functions do not like requests which are
      bigger than INT_MAX bytes. Since the VDI bmap is read and written in a
      single operation, its size is therefore limited accordingly. This
      reduces the maximum VDI image size supported by QEMU to half of what it
      currently is (down to approximately 512 TB).
      
      The VDI test 084 has to be adapted accordingly. Actually, one could
      clearly see that it was broken from the "Could not open
      'TEST_DIR/t.IMGFMT': Invalid argument" line for an image which was
      supposed to work just fine.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPeter Lieven <pl@kamp.de>
      d20418ee
  5. 02 11月, 2014 1 次提交
  6. 23 10月, 2014 1 次提交
  7. 20 10月, 2014 1 次提交
  8. 12 9月, 2014 1 次提交
  9. 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
  10. 15 8月, 2014 3 次提交
  11. 01 7月, 2014 1 次提交
    • C
      qemu-img create: add 'nocow' option · 4ab15590
      Chunyan Liu 提交于
      Add 'nocow' option so that users could have a chance to set NOCOW flag to
      newly created files. It's useful on btrfs file system to enhance performance.
      
      Btrfs has low performance when hosting VM images, even more when the guest
      in those VM are also using btrfs as file system. One way to mitigate this bad
      performance is to turn off COW attributes on VM files. Generally, there are
      two ways to turn off NOCOW on btrfs: a) by mounting fs with nodatacow, then
      all newly created files will be NOCOW. b) per file. Add the NOCOW file
      attribute. It could only be done to empty or new files.
      
      This patch tries the second way, according to the option, it could add NOCOW
      per file.
      
      For most block drivers, since the create file step is in raw-posix.c, so we
      can do setting NOCOW flag ioctl in raw-posix.c only.
      
      But there are some exceptions, like block/vpc.c and block/vdi.c, they are
      creating file by calling qemu_open directly. For them, do the same setting
      NOCOW flag ioctl work in them separately.
      
      [Fixed up 082.out due to the new 'nocow' creation option
      --Stefan]
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4ab15590
  12. 16 6月, 2014 2 次提交
  13. 10 6月, 2014 1 次提交
  14. 30 4月, 2014 2 次提交
  15. 01 4月, 2014 1 次提交
  16. 25 3月, 2014 1 次提交
  17. 22 2月, 2014 2 次提交
  18. 03 12月, 2013 1 次提交
  19. 26 9月, 2013 1 次提交
  20. 12 9月, 2013 2 次提交
  21. 06 9月, 2013 2 次提交
  22. 28 6月, 2013 1 次提交
    • P
      block: change default of .has_zero_init to 0 · 3ac21627
      Peter Lieven 提交于
      .has_zero_init defaults to 1 for all formats and protocols.
      
      this is a dangerous default since this means that all
      new added drivers need to manually overwrite it to 0 if
      they do not ensure that a device is zero initialized
      after bdrv_create().
      
      if a driver needs to explicitly set this value to
      1 its easier to verify the correctness in the review process.
      
      during review of the existing drivers it turned out
      that ssh and gluster had a wrong default of 1.
      both protocols support host_devices as backend
      which are not by default zero initialized. this
      wrong assumption will lead to possible corruption
      if qemu-img convert is used to write to such a backend.
      
      vpc and vmdk also defaulted to 1 altough they support
      fixed respectively flat extends. this has to be addresses
      in separate patches. both formats as well as the mentioned
      ssh and gluster are turned to the default of 0 with this
      patch for safety.
      
      a similar problem with the wrong default existed for
      iscsi most likely because the driver developer did
      oversee the default value of 1.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      3ac21627
  23. 15 3月, 2013 1 次提交
  24. 30 1月, 2013 1 次提交
  25. 26 1月, 2013 3 次提交
  26. 19 12月, 2012 4 次提交
  27. 21 11月, 2012 1 次提交
    • S
      vdi: don't override libuuid symbols · 8ba2aae3
      Stefan Hajnoczi 提交于
      It's poor symbol hygiene to provide a global symbols that collide with a
      common library like libuuid.  If QEMU links against a shared library
      that depends on uuid_generate() it can end up calling our stub version
      of the function.
      
      This exact scenario happened with GlusterFS libgfapi.so, which depends
      on libglusterfs.so's uuid_generate().
      
      Scope the uuid stubs for vdi.c only and avoid affecting other shared
      objects.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      8ba2aae3
  28. 24 9月, 2012 1 次提交