1. 05 3月, 2014 1 次提交
    • N
      spapr_vscsi: Fix REPORT_LUNS handling · 3052f0d5
      Nathan Whitehorn 提交于
      Intercept REPORT_LUNS commands addressed either to SRP LUN 0 or the well-known
      LUN for REPORT_LUNS commands. This is required to implement the SAM and SPC
      specifications.
      
      Since SRP implements only a single SCSI target port per connection, the SRP
      target is required to report all available LUNs in response to a REPORT_LUNS
      command addressed either to LUN 0 or the well-known LUN. Instead, QEMU was
      forwarding such requests to the first QEMU SCSI target, with the result that
      initiators that relied on this feature would only see LUNs on the first QEMU
      SCSI target.
      
      Behavior for REPORT_LUNS commands addressed to any other LUN is not specified
      by the standard and so is left unchanged. This preserves behavior under Linux
      and SLOF, which enumerate possible LUNs by hand and so address no commands
      either to LUN 0 or the well-known REPORT_LUNS LUN.
      Signed-off-by: NNathan Whitehorn <nwhitehorn@freebsd.org>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      [agraf: define constant as ULL for 32bit hosts]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3052f0d5
  2. 22 2月, 2014 1 次提交
    • F
      scsi: Change scsi sense buf size to 252 · c5f52875
      Fam Zheng 提交于
      Current buffer size fails the assersion check in like
      
          hw/scsi/scsi-bus.c:1655:    assert(req->sense_len <= sizeof(req->sense));
      
      when backend (block/iscsi.c) returns more data then 96.
      
      Exercise the core dump path by booting an Gentoo ISO with scsi-generic
      device backed with iscsi (built with libiscsi 1.7.0):
      
          x86_64-softmmu/qemu-system-x86_64 \
          -drive file=iscsi://localhost:3260/iqn.foobar/0,if=none,id=drive-disk \
          -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x6 \
          -device scsi-generic,drive=drive-disk,bus=scsi1.0,id=iscsi-disk \
          -boot d \
          -cdrom gentoo.iso
      
          qemu-system-x86_64: hw/scsi/scsi-bus.c:1655: scsi_req_complete:
          Assertion `req->sense_len <= sizeof(req->sense)' failed.
      
      According to SPC-4, section 4.5.2.1, 252 is the limit of sense data. So
      increase the value to fix it.
      
      Also remove duplicated define for the macro.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c5f52875
  3. 08 11月, 2013 1 次提交
  4. 12 9月, 2013 3 次提交
  5. 31 8月, 2013 1 次提交
  6. 30 7月, 2013 1 次提交
  7. 29 7月, 2013 3 次提交
    • A
      spapr-vscsi: fix SOLNT bit in SRP_RSP · dbd94f8e
      Alexey Kardashevskiy 提交于
      The driver calculates SOLNT bit from UCSOLNT and  SCSOLNT bits from
      the request. The iu pointer has a type of srp_iu* which points to a union,
      so cmd and rsp overlap. As the vscsi_send_rsp function calls
      memset(iu, 0, sizeof(rsp)), it clears first 36 bytes of both cmd and rsp
      so cmd.sol_not is always zero at the moment of calculating rsp.sol_not.
      
      This fixes the bug.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Message-id: 1375073319-17488-1-git-send-email-aik@ozlabs.ru
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      dbd94f8e
    • D
      pseries: savevm support for PAPR virtual SCSI · 1168ec7d
      David Gibson 提交于
      This patch adds the necessary support for saving the state of the PAPR VIO
      virtual SCSI device. This also saves and restores active SCSI requests.
      
      [aik: implemented vscsi_req save/restore]
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Message-id: 1374175984-8930-8-git-send-email-aliguori@us.ibm.com
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      1168ec7d
    • A
      pseries: rework PAPR virtual SCSI · 8ca8a17c
      Alexey Kardashevskiy 提交于
      The patch reimplements handling of indirect requests in order to
      simplify upcoming live migration support.
      - all pointers (except SCSIRequest*) were replaces with integer
      indexes and offsets;
      - DMA'ed srp_direct_buf kept untouched (ie. BE format);
      - vscsi_fetch_desc() is added, now it is the only place where
      descriptors are fetched and byteswapped;
      - vscsi_req struct fields converted to migration-friendly types;
      - many dprintf()'s fixed.
      
      This also removed an unused field 'lun' from the spapr_vscsi device
      which is assigned, but never used.  So, remove it.
      
      [David Gibson: removed unused 'lun']
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Message-id: 1374175984-8930-7-git-send-email-aliguori@us.ibm.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8ca8a17c
  8. 23 7月, 2013 1 次提交
  9. 04 5月, 2013 1 次提交
  10. 27 4月, 2013 1 次提交
  11. 09 4月, 2013 3 次提交
  12. 01 3月, 2013 1 次提交
    • P
      hw: include hw header files with full paths · 83c9f4ca
      Paolo Bonzini 提交于
      Done with this script:
      
      cd hw
      for i in `find . -name '*.h' | sed 's/^..//'`; do
        echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
      done | sed -i -f - `find . -type f`
      
      This is so that paths remain valid as files are moved.
      
      Instead, files in hw/dataplane are referenced with the relative path.
      We know they are not going to move to include/, and they are the only
      include files that are in subdirectories _and_ move.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83c9f4ca
  13. 11 1月, 2013 1 次提交
    • A
      Make all static TypeInfos const · 8c43a6f0
      Andreas Färber 提交于
      Since 39bffca2 (qdev: register all
      types natively through QEMU Object Model), TypeInfo as used in
      the common, non-iterative pattern is no longer amended with information
      and should therefore be const.
      
      Fix the documented QOM examples:
      
       sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h
      
      Since frequently the wrong examples are being copied by contributors of
      new devices, fix all types in the tree:
      
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c
      
      This also avoids to piggy-back these changes onto real functional
      changes or other refactorings.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8c43a6f0
  14. 19 12月, 2012 1 次提交
  15. 05 10月, 2012 1 次提交
  16. 28 6月, 2012 1 次提交
  17. 24 6月, 2012 1 次提交
  18. 02 5月, 2012 1 次提交
    • D
      pseries: Implement automatic PAPR VIO address allocation · d601fac4
      David Gibson 提交于
      PAPR virtual IO (VIO) devices require a unique, but otherwise arbitrary,
      "address" used as a token to the hypercalls which manipulate them.
      
      Currently the pseries machine code does an ok job of allocating these
      addresses when the legacy -net nic / -serial and so forth options are used
      but will fail to allocate them properly when using -device.
      
      Specifically, you can use -device if all addresses are explicitly assigned.
      Without explicit assignment, only one VIO device of each type (network,
      console, SCSI) will be assigned properly, any further ones will attempt
      to take the same address leading to a fatal error.
      
      This patch fixes the situation by adding a proper address allocator to the
      VIO "bus" code.  This is used both by -device and the legacy options and
      default devices.  Addresses can still be explicitly assigned with -device
      options if desired.
      
      This patch changes the (guest visible) numbering of VIO devices, but since
      their addresses are discovered using the device tree and already differ
      from the numbering found on existing PowerVM systems, this does not break
      compatibility.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      d601fac4
  19. 16 4月, 2012 2 次提交
  20. 22 2月, 2012 1 次提交
  21. 15 2月, 2012 1 次提交
  22. 04 2月, 2012 1 次提交
    • A
      qdev: register all types natively through QEMU Object Model · 39bffca2
      Anthony Liguori 提交于
      This was done in a mostly automated fashion.  I did it in three steps and then
      rebased it into a single step which avoids repeatedly touching every file in
      the tree.
      
      The first step was a sed-based addition of the parent type to the subclass
      registration functions.
      
      The second step was another sed-based removal of subclass registration functions
      while also adding virtual functions from the base class into a class_init
      function as appropriate.
      
      Finally, a python script was used to convert the DeviceInfo structures and
      qdev_register_subclass functions to TypeInfo structures, class_init functions,
      and type_register_static calls.
      
      We are almost fully converted to QOM after this commit.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      39bffca2
  23. 28 1月, 2012 2 次提交
  24. 29 10月, 2011 4 次提交
  25. 06 10月, 2011 3 次提交
  26. 21 8月, 2011 1 次提交
  27. 12 8月, 2011 1 次提交