1. 12 10月, 2010 18 次提交
  2. 13 9月, 2010 13 次提交
  3. 31 8月, 2010 7 次提交
  4. 03 8月, 2010 2 次提交
    • A
      ide: Avoid canceling IDE DMA · 96638e70
      Andrea Arcangeli 提交于
      The reason for not actually canceling the I/O is because with
      virtualization and lots of VM running, a guest fs may mistake a
      overload of the host, as an IDE timeout. So rather than canceling the
      I/O, it's safer to wait I/O completion and simulate that the I/O has
      completed just before the io cancellation was requested by the
      guest. This way if ntfs or an app writes data without checking for
      -EIO retval, and it thinks the write has succeeded, it's less likely
      to run into troubles. Similar issues for reads.
      
      Furthermore because the DMA operation is splitted into many synchronous
      aio_read/write if there's more than one entry in the SG table, without this
      patch the DMA would be cancelled in the middle, something we've no idea if it
      happens on real hardware too or not. Overall this seems a great risk for zero
      gain.
      
      This approach is sure safer than previous code given we can't pretend all guest
      fs code out there to check for errors and reply the DMA if it was completed
      partially, given a timeout would never materialize on a real harddisk unless
      there are defective blocks (and defective blocks are practically only an issue
      for reads never for writes in any recent hardware as writing to blocks is the
      way to fix them) or the harddisk breaks as a whole.
      Signed-off-by: NIzik Eidus <ieidus@redhat.com>
      Signed-off-by: NAndrea Arcangeli <aarcange@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      (cherry picked from commit 953844d1)
      96638e70
    • M
      block: Change bdrv_eject() not to drop the image · 08e90b3c
      Markus Armbruster 提交于
      bdrv_eject() gets called when a device model opens or closes the tray.
      
      If the block driver implements method bdrv_eject(), that method gets
      called.  Drivers host_cdrom implements it, and it opens and closes the
      physical tray, and nothing else.  When a device model opens, then
      closes the tray, media changes only if the user actively changes the
      physical media while the tray is open.  This is matches how physical
      hardware behaves.
      
      If the block driver doesn't implement method bdrv_eject(), we do
      something quite different: opening the tray severs the connection to
      the image by calling bdrv_close(), and closing the tray does nothing.
      When the device model opens, then closes the tray, media is gone,
      unless the user actively inserts another one while the tray is open,
      with a suitable change command in the monitor.  This isn't how
      physical hardware behaves.  Rather inconvenient when programs
      "helpfully" eject media to give you a chance to change it.  The way
      bdrv_eject() behaves here turns that chance into a must, which is not
      what these programs or their users expect.
      
      Change the default action not to call bdrv_close().  Instead, note the
      tray status in new BlockDriverState member tray_open.  Use it in
      bdrv_is_inserted().
      
      Arguably, the device models should keep track of tray status
      themselves.  But this is less invasive.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      (cherry picked from commit 4be9762a)
      08e90b3c