1. 07 11月, 2013 18 次提交
  2. 06 11月, 2013 1 次提交
  3. 31 10月, 2013 1 次提交
  4. 30 10月, 2013 7 次提交
  5. 29 10月, 2013 4 次提交
    • K
      block: Avoid unecessary drv->bdrv_getlength() calls · b94a2610
      Kevin Wolf 提交于
      The block layer generally keeps the size of an image cached in
      bs->total_sectors so that it doesn't have to perform expensive
      operations to get the size whenever it needs it.
      
      This doesn't work however when using a backend that can change its size
      without qemu being aware of it, i.e. passthrough of removable media like
      CD-ROMs or floppy disks. For this reason, the caching is disabled when a
      removable device is used.
      
      It is obvious that checking whether the _guest_ device has removable
      media isn't the right thing to do when we want to know whether the size
      of the host backend can change. To make things worse, non-top-level
      BlockDriverStates never have any device attached, which makes qemu
      assume they are removable, so drv->bdrv_getlength() is always called on
      the protocol layer. In the case of raw-posix, this causes unnecessary
      lseek() system calls, which turned out to be rather expensive.
      
      This patch completely changes the logic and disables bs->total_sectors
      caching only for certain block driver types, for which a size change is
      expected: host_cdrom and host_floppy on POSIX, host_device on win32; also
      the raw format in case it sits on top of one of these protocols, but in
      the common case the nested bdrv_getlength() call on the protocol driver
      will use the cache again and avoid an expensive drv->bdrv_getlength()
      call.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      b94a2610
    • L
      sheepdog: pass copy_policy in the request · 1841f880
      Liu Yuan 提交于
      Currently copy_policy isn't used. Recent sheepdog supports erasure coding, which
      make use of copy_policy internally, but require client explicitly passing
      copy_policy from base inode to newly creately inode for snapshot related
      operations.
      
      If connected sheep daemon doesn't utilize copy_policy, passing it to sheep
      daemon is just one extra null effect operation. So no compatibility problem.
      
      With this patch, sheepdog can provide erasure coded volume for QEMU VM.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NLiu Yuan <namei.unix@gmail.com>
      Acked-by: NMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1841f880
    • L
      sheepdog: explicitly set copies as type uint8_t · 29a67f7e
      Liu Yuan 提交于
      'copies' is actually uint8_t since day one, but request headers and some helper
      functions parameterize it as uint32_t for unknown reasons and effectively
      reserve 24 bytes for possible future use. This patch explicitly set the correct
      for copies and reserve the left bytes.
      
      This is a preparation patch that allow passing copy_policy in request header.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NLiu Yuan <namei.unix@gmail.com>
      Acked-by: NMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      29a67f7e
    • M
      qcow2: Flush image after creation · ba2ab2f2
      Max Reitz 提交于
      Opening the qcow2 image with BDRV_O_NO_FLUSH prevents any flushes during
      the image creation. This means that the image has not yet been flushed
      to disk when qemu-img create exits. This flush is delayed until the next
      operation on the image involving opening it without BDRV_O_NO_FLUSH and
      closing (or directly flushing) it. For large images and/or images with a
      small cluster size and preallocated metadata, this flush may take a
      significant amount of time and may occur unexpectedly.
      
      Reopening the image without BDRV_O_NO_FLUSH right before the end of
      qcow2_create2() results in hoisting the potentially costly flush into
      the image creation, which is expected to take some time (whereas
      successive image operations may be not).
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ba2ab2f2
  6. 26 10月, 2013 1 次提交
  7. 24 10月, 2013 3 次提交
  8. 18 10月, 2013 2 次提交
  9. 17 10月, 2013 1 次提交
  10. 11 10月, 2013 2 次提交