1. 20 2月, 2010 1 次提交
  2. 11 2月, 2010 1 次提交
    • C
      block: add topology qdev properties · 428c149b
      Christoph Hellwig 提交于
      Add three new qdev properties to export block topology information to
      the guest.  This is needed to get optimal I/O alignment for RAID arrays
      or SSDs.
      
      The options are:
      
       - physical_block_size to specify the physical block size of the device,
         this is going to increase from 512 bytes to 4096 kilobytes for many
         modern storage devices
       - min_io_size to specify the minimal I/O size without performance impact,
         this is typically set to the RAID chunk size for arrays.
       - opt_io_size to specify the optimal sustained I/O size, this is
         typically the RAID stripe width for arrays.
      
      I decided to not auto-probe these values from blkid which might easily
      be possible as I don't know how to deal with these issues on migration.
      
      Note that we specificly only set the physical_block_size, and not the
      logial one which is the unit all I/O is described in.  The reason for
      that is that IDE does not support increasing the logical block size and
      at last for now I want to stick to one meachnisms in queue and allow
      for easy switching of transports for a given backing image which would
      not be possible if scsi and virtio use real 4k sectors, while ide only
      uses the physical block exponent.
      
      To make this more common for the different block drivers introduce a
      new BlockConf structure holding all common block properties and a
      DEFINE_BLOCK_PROPERTIES macro to add them all together, mirroring
      what is done for network drivers.  Also switch over all block drivers
      to use it, except for the floppy driver which has weird driveA/driveB
      properties and probably won't require any advanced block options ever.
      
      Example usage for a virtio device with 4k physical block size and
      8k optimal I/O size:
      
        -drive file=scratch.img,media=disk,cache=none,id=scratch \
        -device virtio-blk-pci,drive=scratch,physical_block_size=4096,opt_io_size=8192
      
      aliguori: updated patch to take into account BLOCK events
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      428c149b
  3. 10 2月, 2010 1 次提交
  4. 14 1月, 2010 1 次提交
  5. 04 12月, 2009 2 次提交
  6. 17 11月, 2009 1 次提交
    • L
      Expose a mechanism to trace block writes · 7cd1e32a
      lirans@il.ibm.com 提交于
      To support live migration without shared storage we need to be able to trace
      writes to disk while migrating. This Patch expose dirty block tracking per
      device to be polled from upper layer.
      
      Changes from v4:
      - Register dirty tracking for each block device.
      - Minor coding style issues.
      - Block.c will now manage a dirty bitmap per device once
        bdrv_set_dirty_tracking() is called. Bitmap is polled by the upper
        layer (block-migration.c).
      Signed-off-by: NLiran Schour <lirans@il.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      7cd1e32a
  7. 11 9月, 2009 3 次提交
    • C
      block: add aio_flush operation · b2e12bc6
      Christoph Hellwig 提交于
      Instead stalling the VCPU while serving a cache flush try to do it
      asynchronously.  Use our good old helper thread pool to issue an
      asynchronous fdatasync for raw-posix.  Note that while Linux AIO
      implements a fdatasync operation it is not useful for us because
      it isn't actually implement in asynchronous fashion.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      b2e12bc6
    • C
      block: add enable_write_cache flag · e900a7b7
      Christoph Hellwig 提交于
      Add a enable_write_cache flag in the block driver state, and use it to
      decide if we claim to have a volatile write cache that needs controlled
      flushing from the guest.  The flag is off if cache=writethrough is
      defined because O_DSYNC guarantees that every write goes to stable
      storage, and it is on for cache=none and cache=writeback.
      
      Both scsi-disk and ide now use the new flage, changing from their
      defaults of always off (ide) or always on (scsi-disk).
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      e900a7b7
    • K
      Add bdrv_aio_multiwrite · 40b4f539
      Kevin Wolf 提交于
      One performance problem of qcow2 during the initial image growth are
      sequential writes that are not cluster aligned. In this case, when a first
      requests requires to allocate a new cluster but writes only to the first
      couple of sectors in that cluster, the rest of the cluster is zeroed - just
      to be overwritten by the following second request that fills up the cluster.
      
      Let's try to merge sequential write requests to the same cluster, so we can
      avoid to write the zero padding to the disk in the first place.
      
      As a nice side effect, also other formats take advantage of dealing with less
      and larger requests.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      40b4f539
  8. 28 8月, 2009 1 次提交
    • K
      qcow2: Metadata preallocation · a35e1c17
      Kevin Wolf 提交于
      This introduces a qemu-img create option for qcow2 which allows the metadata to
      be preallocated, i.e. clusters are reserved in the refcount table and L1/L2
      tables, but no data is written to them. Metadata is quite small, so this
      happens in almost no time.
      
      Especially with qcow2 on virtio this helps to gain a bit of performance during
      the initial writes. However, as soon as create a snapshot, we're back to the
      normal slow speed, obviously. So this isn't the real fix, but kind of a cheat
      while we're still having trouble with qcow2 on virtio.
      
      Note that the option is disabled by default and needs to be specified
      explicitly using qemu-img create -f qcow2 -o preallocation=metadata.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a35e1c17
  9. 16 7月, 2009 1 次提交
  10. 15 6月, 2009 1 次提交
    • C
      block: add bdrv_probe_device method · 508c7cb3
      Christoph Hellwig 提交于
      Add a bdrv_probe_device method to all BlockDriver instances implementing
      host devices to move matching of host device types into the actual drivers.
      For now we keep exacly the old matching behaviour based on the devices names,
      although we really should have better detetion methods based on device
      information in the future.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      508c7cb3
  11. 27 5月, 2009 1 次提交
  12. 22 5月, 2009 2 次提交
  13. 23 4月, 2009 1 次提交
    • A
      implement qemu_blockalign (Stefano Stabellini) · e268ca52
      aliguori 提交于
      this patch adds a buffer_alignment field to BlockDriverState and
      implements a qemu_blockalign function that uses that field to allocate a
      memory aligned buffer to be used by the block driver.
      buffer_alignment is initialized to 512 but each block driver can set
      a different value (at the moment none of them do).
      This patch modifies ide.c, block-qcow.c, block-qcow2.c and block.c to
      use qemu_blockalign instead of qemu_memalign.
      There is only one place left that still uses qemu_memalign to allocate
      buffers used by block drivers that is posix-aio-compat:handle_aiocb_rw
      because it is not possible to get the BlockDriverState from that
      function. However I think it is not important because posix-aio-compat
      already deals with driver specific code so it is supposed to know its
      own needs.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7229 c046a42c-6fe2-441c-8c8c-71466251a162
      e268ca52
  14. 22 4月, 2009 1 次提交
  15. 08 4月, 2009 1 次提交
  16. 06 4月, 2009 1 次提交
  17. 29 3月, 2009 2 次提交
  18. 21 3月, 2009 1 次提交
  19. 13 3月, 2009 2 次提交
  20. 06 3月, 2009 1 次提交
    • A
      monitor: Rework early disk password inquiry (Jan Kiszka) · c0f4ce77
      aliguori 提交于
      Reading the passwords for encrypted hard disks during early startup is
      broken (I guess for quiet a while now):
       - No monitor terminal is ready for input at this point
       - Forcing all mux'ed terminals into monitor mode can confuse other
         users of that channels
      
      To overcome these issues and to lay the ground for a clean decoupling of
      monitor terminals, this patch changes the initial password inquiry as
      follows:
       - Prevent autostart if there is some encrypted disk
       - Once the user tries to resume the VM, prompt for all missing
         passwords
       - Only resume if all passwords were accepted
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6707 c046a42c-6fe2-441c-8c8c-71466251a162
      c0f4ce77
  21. 04 3月, 2009 1 次提交
    • A
      Fix CVE-2008-0928 - insufficient block device address range checking (Anthony Liguori) · 71d0770c
      aliguori 提交于
      Introduce a growable flag that's set by bdrv_file_open().  Block devices should
      never be growable, only files that are being used by block devices.
      
      I went through Fabrice's early comments about the patch that was first applied.
      While I disagree with that patch, I also disagree with Fabrice's suggestion.
      
      There's no good reason to do the checks in the block drivers themselves.  It
      just increases the possibility that this bug could show up again.  Since we're
      calling bdrv_getlength() to determine the length, we're giving the block drivers
      a chance to chime in and let us know what range is valid.
      
      Basically, this patch makes the BlockDriver API guarantee that all requests are
      within 0..bdrv_getlength() which to me seems like a Good Thing.
      
      What do others think?
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6677 c046a42c-6fe2-441c-8c8c-71466251a162
      71d0770c
  22. 11 2月, 2009 1 次提交
  23. 09 11月, 2008 1 次提交
  24. 18 9月, 2008 1 次提交
  25. 12 3月, 2008 2 次提交
  26. 25 12月, 2007 1 次提交
  27. 02 12月, 2007 1 次提交
  28. 11 11月, 2007 1 次提交
  29. 17 9月, 2007 3 次提交
  30. 19 8月, 2006 1 次提交
  31. 07 8月, 2006 1 次提交