1. 14 9月, 2016 1 次提交
    • R
      scsi-disk: change disk serial length from 20 to 36 · 48b62063
      Rony Weng 提交于
      Openstack Cinder assigns volume a 36 characters uuid as serial.
      QEMU will shrinks the uuid to 20 characters, which does not match
      the original uuid.
      
      Note that there is no limit to the length of the serial number in
      the SCSI spec.  20 was copy-pasted from virtio-blk which in turn was
      copy-pasted from ATA; 36 is even more arbitrary.  However, bumping it
      up too much might cause issues (e.g. 252 seems to make sense because
      then the maximum amount of returned data is 256; but who knows there's
      no off-by-one somewhere for such a nicely rounded number).
      Signed-off-by: NRony Weng <ronyweng@synology.com>
      Message-Id: <1472457138-23386-1-git-send-email-ronyweng@synology.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      48b62063
  2. 06 9月, 2016 1 次提交
  3. 20 7月, 2016 1 次提交
  4. 13 7月, 2016 2 次提交
  5. 17 6月, 2016 1 次提交
  6. 07 6月, 2016 2 次提交
  7. 06 6月, 2016 1 次提交
  8. 29 5月, 2016 5 次提交
    • P
      scsi-block: always use SG_IO · 8fdc7839
      Paolo Bonzini 提交于
      Using pread/pwrite or io_submit has the advantage of eliminating the
      bounce buffer, but drops the SCSI status.  This keeps the guest from
      seeing unit attention codes, as well as statuses such as RESERVATION
      CONFLICT.  Because we know scsi-block operates on an SBC device we can
      still use the DMA helpers with SG_IO; just remember to patch the CDBs
      if the transfer is split into multiple segments.
      
      This means that scsi-block will always use the thread-pool unfortunately,
      instead of respecting aio=native.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8fdc7839
    • P
      scsi-disk: introduce scsi_disk_req_check_error · 5b956f41
      Paolo Bonzini 提交于
      Commonize all the checks for canceled requests and errors.  The next patch
      will add another case to check for, in order to handle passthrough commands.
      
      There is no semantic change here; the only nontrivial modification is in
      scsi_write_do_fua, where cancellation has been checked earlier by both
      callers.  Thus, the check is replaced with an assertion.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5b956f41
    • P
      scsi-disk: add need_fua_emulation to SCSIDiskClass · 94f8ba11
      Paolo Bonzini 提交于
      scsi-block will be able to do FUA just by passing the request through
      to the LUN (which is also more efficient); there is no need to emulate
      it like we do for scsi-disk.
      
      Add a new method to distinguish this.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      94f8ba11
    • P
      scsi-disk: introduce dma_readv and dma_writev · fcaafb10
      Paolo Bonzini 提交于
      These are replacements for blk_aio_readv and blk_aio_writev that allow
      customization of the data path.  They reuse the DMA helpers' DMAIOFunc
      callback type, so that the same function can be used in either the
      QEMUSGList or the bounce-buffered case.
      
      This customization will be needed in the next patch to do zero-copy
      SG_IO on scsi-block.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fcaafb10
    • P
      scsi-disk: introduce a common base class · 993935f3
      Paolo Bonzini 提交于
      This will be the place to add DMAIOFuncs in the next patch.  There
      are also a couple DeviceClass members that can be moved to the
      abstract class's initialization function.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      993935f3
  9. 26 5月, 2016 2 次提交
  10. 12 5月, 2016 2 次提交
  11. 23 3月, 2016 2 次提交
    • V
      util: move declarations out of qemu-common.h · f348b6d1
      Veronia Bahaa 提交于
      Move declarations out of qemu-common.h for functions declared in
      utils/ files: e.g. include/qemu/path.h for utils/path.c.
      Move inline functions out of qemu-common.h and into new files (e.g.
      include/qemu/bcd.h)
      Signed-off-by: NVeronia Bahaa <veroniabahaa@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f348b6d1
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  12. 09 2月, 2016 2 次提交
  13. 29 1月, 2016 1 次提交
  14. 12 11月, 2015 1 次提交
  15. 04 11月, 2015 1 次提交
  16. 15 8月, 2015 1 次提交
  17. 30 7月, 2015 2 次提交
  18. 24 7月, 2015 1 次提交
    • M
      scsi: Handle no media case for scsi_get_configuration · 7d99f4c1
      Matthew Rosato 提交于
      Currently, scsi_get_configuration always returns a current
      profile (DVD or CD), even when there is actually no media present.
      By comparison, ide/atapi uses a default profile of 0 (MMC_PROFILE_NONE)
      for this case and checks for tray_open, so let's do the same for scsi.
      
      This fixes a problem I'm seeing with Fedora 22 guests where systemd
      cdrom_id fails to unmount after a QEMU-initiated eject against a
      scsi cdrom device because it believes the media is still present
      (but unreadable).
      Signed-off-by: NMatthew Rosato <mjrosato@linux.vnet.ibm.com>
      Message-Id: <1436986352-10695-1-git-send-email-mjrosato@linux.vnet.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7d99f4c1
  19. 10 3月, 2015 2 次提交
  20. 15 12月, 2014 1 次提交
  21. 31 10月, 2014 2 次提交
  22. 20 10月, 2014 2 次提交
    • M
      blockdev: Fix blockdev-add not to create DriveInfo · 26f8b3a8
      Markus Armbruster 提交于
      blockdev_init() always creates a DriveInfo, but only drive_new() fills
      it in.  qmp_blockdev_add() leaves it blank.  This results in a drive
      with type = IF_IDE, bus = 0, unit = 0.  Screwed up in commit ee13ed1c.
      
      Board initialization code looking for IDE drive (0,0) can pick up one
      of these bogus drives.  The QMP command has to execute really early to
      be visible.  Not sure how likely that is in practice.
      
      Fix by creating DriveInfo in drive_new().  Block backends created by
      blockdev-add don't get one.
      
      Breaks the test for "has been created by qmp_blockdev_add()" in
      blockdev_mark_auto_del() and do_drive_del(), because it changes the
      value of dinfo && !dinfo->enable_auto_del from true to false.  Simply
      test !dinfo instead.
      
      Leaves DriveInfo member enable_auto_del unused.  Drop it.
      
      A few places assume a block backend always has a DriveInfo.  Fix them
      up.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      26f8b3a8
    • M
      hw: Convert from BlockDriverState to BlockBackend, mostly · 4be74634
      Markus Armbruster 提交于
      Device models should access their block backends only through the
      block-backend.h API.  Convert them, and drop direct includes of
      inappropriate headers.
      
      Just four uses of BlockDriverState are left:
      
      * The Xen paravirtual block device backend (xen_disk.c) opens images
        itself when set up via xenbus, bypassing blockdev.c.  I figure it
        should go through qmp_blockdev_add() instead.
      
      * Device model "usb-storage" prompts for keys.  No other device model
        does, and this one probably shouldn't do it, either.
      
      * ide_issue_trim_cb() uses bdrv_aio_discard() instead of
        blk_aio_discard() because it fishes its backend out of a BlockAIOCB,
        which has only the BlockDriverState.
      
      * PC87312State has an unused BlockDriverState[] member.
      
      The next two commits take care of the latter two.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4be74634
  23. 15 10月, 2014 2 次提交
  24. 30 9月, 2014 2 次提交