1. 26 5月, 2011 5 次提交
    • H
      scsi: Use 'SCSIRequest' directly · 5c6c0e51
      Hannes Reinecke 提交于
      Currently the SCSIRequest structure is abstracted away and cannot accessed
      directly from the driver. This requires the handler to do a lookup on
      an abstract 'tag' which identifies the SCSIRequest structure.
      
      With this patch the SCSIRequest structure is exposed to the driver. This
      allows use to use it directly as an argument to the SCSIDeviceInfo
      callback functions and remove the lookup.
      
      A new callback function 'alloc_req' is introduced matching 'free
      req'; unref'ing to free up resources after use is moved into the
      scsi_command_complete callbacks.
      
      This temporarily introduces a leak of requests that are cancelled,
      when they are removed from the queue and not from the driver.  This
      is fixed later by introducing scsi_req_cancel.  That patch in turn
      depends on this one, because the argument to scsi_req_cancel is a
      SCSIRequest.
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      5c6c0e51
    • P
      scsi: reference-count requests · ad2d30f7
      Paolo Bonzini 提交于
      With the next patch, a device may hold SCSIRequest for an indefinite
      time.  Split a rather big patch, and protect against access errors,
      by reference counting them.
      
      There is some ugliness in scsi_send_command implementation due to
      the need to unref the request when it fails.  This will go away
      with the next patches, which move the unref'ing to the devices.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      ad2d30f7
    • P
      scsi: introduce SCSIBusOps · cfdc1bb0
      Paolo Bonzini 提交于
      There are more operations than a SCSI bus can handle, besides completing
      commands.  One example, which this series will introduce, is cleaning up
      after a request is cancelled.
      
      More long term, a "SCSI bus" can represent the LUNs attached to a
      target; in this case, while all commands will ultimately reach a logical
      unit, it is the target who is in charge of answering REPORT LUNs.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      cfdc1bb0
    • P
      scsi: introduce scsi_req_data · ab9adc88
      Paolo Bonzini 提交于
      This abstracts calling the command_complete callback, reducing churn
      in the following patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      ab9adc88
    • P
      scsi: add tracing of scsi requests · 5138efec
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      5138efec
  2. 25 1月, 2011 1 次提交
  3. 12 12月, 2010 1 次提交
  4. 25 11月, 2010 2 次提交
  5. 21 9月, 2010 1 次提交
  6. 24 8月, 2010 1 次提交
    • B
      Rearrange block headers · 2446333c
      Blue Swirl 提交于
      Changing block.h or blockdev.h resulted in recompiling most objects.
      
      Move DriveInfo typedef and BlockInterfaceType enum definitions
      to qemu-common.h and rearrange blockdev.h use to decrease churn.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      2446333c
  7. 22 7月, 2010 1 次提交
  8. 06 7月, 2010 1 次提交
  9. 02 7月, 2010 3 次提交
    • M
      block: Catch attempt to attach multiple devices to a blockdev · 18846dee
      Markus Armbruster 提交于
      For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foo
      happily creates two SCSI disks connected to the same block device.
      It's all downhill from there.
      
      Device usb-storage deliberately attaches twice to the same blockdev,
      which fails with the fix in place.  Detach before the second attach
      there.
      
      Also catch attempt to delete while a guest device model is attached.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      18846dee
    • M
      qdev: Decouple qdev_prop_drive from DriveInfo · f8b6cc00
      Markus Armbruster 提交于
      Make the property point to BlockDriverState, cutting out the DriveInfo
      middleman.  This prepares the ground for block devices that don't have
      a DriveInfo.
      
      Currently all user-defined ones have a DriveInfo, because the only way
      to define one is -drive & friends (they go through drive_init()).
      DriveInfo is closely tied to -drive, and like -drive, it mixes
      information about host and guest part of the block device.  I'm
      working towards a new way to define block devices, with clean
      host/guest separation, and I need to get DriveInfo out of the way for
      that.
      
      Fortunately, the device models are perfectly happy with
      BlockDriverState, except for two places: ide_drive_initfn() and
      scsi_disk_initfn() need to check the DriveInfo for a serial number set
      with legacy -drive serial=...  Use drive_get_by_blockdev() there.
      
      Device model code should now use DriveInfo only when explicitly
      dealing with drives defined the old way, i.e. without -device.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f8b6cc00
    • M
      scsi: scsi_bus_legacy_handle_cmdline() can fail, fix callers · fa66b909
      Markus Armbruster 提交于
      None of its callers checks for failure.  scsi_hot_add() can crash
      because of that:
      
      (qemu) drive_add 4 if=scsi,format=host_device,file=/dev/sg1
      scsi-generic: scsi generic interface too old
      Segmentation fault (core dumped)
      
      Fix all callers, not just scsi_hot_add().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      fa66b909
  10. 22 6月, 2010 2 次提交
  11. 04 6月, 2010 1 次提交
  12. 16 3月, 2010 2 次提交
  13. 26 12月, 2009 1 次提交
  14. 03 12月, 2009 11 次提交
  15. 09 11月, 2009 1 次提交
  16. 07 10月, 2009 1 次提交
  17. 05 10月, 2009 3 次提交
  18. 10 9月, 2009 1 次提交