1. 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
  2. 13 7月, 2010 1 次提交
  3. 06 7月, 2010 1 次提交
    • M
      scsi: Reject unimplemented error actions · 620f862e
      Markus Armbruster 提交于
      drive_init() doesn't permit rerror for if=scsi, but that's worthless:
      we get it via if=none and -device.
      
      Moreover, scsi-generic doesn't support werror.  Since drive_init()
      doesn't catch that, option werror was silently ignored even with
      if=scsi.
      
      Wart: unlike drive_init(), we don't reject the default action when
      it's explicitly specified.  That's because we can't distinguish "no
      rerror option" from "rerror=report", or "no werror" from
      "rerror=enospc".  Left for another day.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      620f862e
  4. 02 7月, 2010 3 次提交
    • M
      block: Fix virtual media change for if=none · 7d0d6950
      Markus Armbruster 提交于
      BlockDriverState member removable controls whether virtual media
      change (monitor commands change, eject) is allowed.  It is set when
      the "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.
      
      The type hint is only set by drive_init().  It sets BDRV_TYPE_FLOPPY
      for if=floppy.  It sets BDRV_TYPE_CDROM for media=cdrom and if=ide,
      scsi, xen, or none.
      
      if=ide and if=scsi work, because the type hint makes it a CD-ROM.
      if=xen likewise, I think.
      
      For the same reason, if=none works when it's used by ide-drive or
      scsi-disk.  For other guest devices, there are problems:
      
      * fdc: you can't change virtual media
      
          $ qemu [...] -drive if=none,id=foo,... -global isa-fdc.driveA=foo
          QEMU 0.12.50 monitor - type 'help' for more information
          (qemu) eject foo
          Device 'foo' is not removable
      
        unless you add media=cdrom, but that makes it readonly.
      
      * virtio: if you add media=cdrom, you can change virtual media.  If
        you eject, the guest gets I/O errors.  If you change, the guest sees
        the drive's contents suddenly change.
      
      * scsi-generic: if you add media=cdrom, you can change virtual media.
        I didn't test what that does to the guest or the physical device,
        but it can't be pretty.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      7d0d6950
    • 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
      blockdev: Clean up automatic drive deletion · 14bafc54
      Markus Armbruster 提交于
      We automatically delete blockdev host parts on unplug of the guest
      device.  Too much magic, but we can't change that now.
      
      The delete happens early in the guest device teardown, before the
      connection to the host part is severed.  Thus, the guest part's
      pointer to the host part dangles for a brief time.  No actual harm
      comes from this, but we'll catch such dangling pointers a few commits
      down the road.  Clean up the dangling pointers by delaying the
      automatic deletion until the guest part's pointer is gone.
      
      Device usb-storage deliberately makes two qdev properties refer to the
      same drive, because it automatically creates a second device.  Again,
      too much magic we can't change now.  Multiple references worked okay
      before, but now free_drive() dies for the second one.  Zap the extra
      reference.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      14bafc54
  5. 15 6月, 2010 1 次提交
  6. 04 6月, 2010 3 次提交
  7. 11 5月, 2010 2 次提交
  8. 18 3月, 2010 2 次提交
  9. 17 3月, 2010 1 次提交
    • C
      block: add logical_block_size property · 8cfacf07
      Christoph Hellwig 提交于
      Add a logical block size attribute as various guest side tools only
      increase the filesystem sector size based on it, not the advisory
      physical block size.
      
      For scsi we already have support for a different logical block size
      in place for CDROMs that we can built upon.  Only my recent block
      device characteristics VPD page needs some fixups.  Note that we
      leave the logial block size for CDROMs hardcoded as the 2k value
      is expected for it in general.
      
      For virtio-blk we already have a feature flag claiming to support
      a variable logical block size that was added for the s390 kuli
      hypervisor.  Interestingly it does not actually change the units
      in which the protocol works, which is still fixed at 512 bytes,
      but only communicates a different minimum I/O granularity.  So
      all we need to do in virtio is to add a trap for unaligned I/O
      and round down the device size to the next multiple of the logical
      block size.
      
      IDE does not support any other logical block size than 512 bytes.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8cfacf07
  10. 16 3月, 2010 2 次提交
  11. 09 3月, 2010 2 次提交
  12. 07 3月, 2010 1 次提交
  13. 11 2月, 2010 3 次提交
    • C
      scsi: add topology support · ee3659e3
      Christoph Hellwig 提交于
      Export the physical block size in the READ CAPACITY (16) command,
      and add the new block limits VPD page to export the minimum and
      optiomal I/O sizes.
      
      Note that we also need to bump the scsi revision level to SPC-2
      as that is the minimum requirement by at least the Linux kernel
      to try READ CAPACITY (16) first and look at the block limits VPD
      page.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ee3659e3
    • 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
    • L
      scsi: Generate BLOCK_IO_ERROR QMP event · 380f640f
      Luiz Capitulino 提交于
      Just call bdrv_mon_event() in the right place.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      380f640f
  14. 27 1月, 2010 1 次提交
  15. 20 1月, 2010 1 次提交
    • G
      scsi: device version property · 383b4d9b
      Gerd Hoffmann 提交于
      This patch adds a new property named 'ver' to scsi-disk which allows to
      specify the version which the virtual disk/cdrom should report to the
      guest.  By default this is the qemu version (i.e. 0.12).  usage:
      
        -drive if=none,id=disk,file=...
        -device lsi
        -device scsi-disk,drive=disk,bus=scsi.0,unit=0,ver=42
      
      You can also switch the version for all scsi drives using:
      
        -global scsi-disk.ver=42
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      383b4d9b
  16. 13 12月, 2009 1 次提交
  17. 05 12月, 2009 1 次提交
  18. 04 12月, 2009 2 次提交
  19. 03 12月, 2009 11 次提交