qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] efc6de: block/iscsi: handle BUSY condition


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] efc6de: block/iscsi: handle BUSY condition
Date: Thu, 19 Jun 2014 09:30:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: efc6de0d0eb21bbd8fbc90da1faf7dd8ed9f5321
      
https://github.com/qemu/qemu/commit/efc6de0d0eb21bbd8fbc90da1faf7dd8ed9f5321
  Author: Peter Lieven <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: handle BUSY condition

this patch adds handling of BUSY status reponse from an iSCSI target.
Currently, we fail with -EIO in case of SCSI_STATUS_BUSY while the
obvious reaction would be to retry the operation after some time.
The retry time is randomly choosen from a range with exponential
growth increasing with each retry.

This patch includes most of the changes by a an upcoming patch
from Stefan Hajnoczi:

 iscsi: implement .bdrv_detach/attach_aio_context()

because I also need the reference to the aio_context for
the retry timer to work. I included the changes to maintain
better mergeability.

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: fcd470d857a02ad76cd5a351a80bc0bb46588314
      
https://github.com/qemu/qemu/commit/fcd470d857a02ad76cd5a351a80bc0bb46588314
  Author: Peter Lieven <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: fix potential segfault on early callback

it might happen in the future that a function directly invokes its callback.
In this case we end up in a segfault because the iTask is gone when the BH
is scheduled.

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 9281fe9eea5c9e5037fbf4fb75c5dc8f6e1a24a3
      
https://github.com/qemu/qemu/commit/9281fe9eea5c9e5037fbf4fb75c5dc8f6e1a24a3
  Author: Peter Lieven <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: use 16 byte CDBs only when necessary

this patch changes the driver to uses 16 Byte CDBs for
READ/WRITE only if the target requires 64bit lba addressing.

On one hand this saves 6 bytes in each PDU on the other
hand it seems that 10 Byte CDBs seems to be much better
supported and tested as a recent issue I had with a
major storage supplier lined out.

For WRITESAME the logic is a bit more tricky as WRITESAME10
with UNMAP was added really late. Thus a fallback to WRITESAME16
is possible if it supports UNMAP and WRITESAME10 not.

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 4525c1337f2a5fc99570ce392e552b8905e36c9a
      
https://github.com/qemu/qemu/commit/4525c1337f2a5fc99570ce392e552b8905e36c9a
  Author: Paul Janzen <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/scsi-disk.c

  Log Message:
  -----------
  scsi-disk.c: Fix compilation with -DDEBUG_SCSI

In scsi-disk.c, if you #define DEBUG_SCSI=1, you get:
hw/scsi/scsi-disk.c: In function 'scsi_disk_emulate_command':
hw/scsi/scsi-disk.c:2018: error: 'SCSIRequest' has no member named 'buf'

Change the debugging statement to match the actual value tested.

Signed-off-by: Paul Janzen <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 2fe5a9f73b3446690db2cae8a58473b0b4beaa32
      
https://github.com/qemu/qemu/commit/2fe5a9f73b3446690db2cae8a58473b0b4beaa32
  Author: Ulrich Obergfell <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/scsi-disk.c

  Log Message:
  -----------
  scsi-disk: fix bug in scsi_block_new_request() introduced by commit 137745c

This patch fixes a bug in scsi_block_new_request() that was introduced
by commit 137745c5c60f083ec982fe9e861e8c16ebca1ba8. If the host cache
is used - i.e. if BDRV_O_NOCACHE is _not_ set - the 'break' statement
needs to be executed to 'fall back' to SG_IO.

Cc: address@hidden
Signed-off-by: Ulrich Obergfell <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: b9e77bc718db3593ffbb56f3a51488cdce4d5af3
      
https://github.com/qemu/qemu/commit/b9e77bc718db3593ffbb56f3a51488cdce4d5af3
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/scsi-bus.c
    M hw/scsi/scsi-disk.c
    M hw/scsi/spapr_vscsi.c
    M include/block/scsi.h

  Log Message:
  -----------
  scsi: Print command name in debug

This makes scsi_command_name() public.

This makes use of scsi_command_name() in debug output for scsi-disk and
spapr-vscsi host bus adapter. Before this, SCSI used to print hex numbers
instead of human-friendly strings.

This adds GET_EVENT_STATUS_NOTIFICATION and READ_DISC_INFORMATION to
the list of SCSI commands supported by scsi_command_name().

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 1016b239c5c7b54a02fbd3121f68fb264a42d0a1
      
https://github.com/qemu/qemu/commit/1016b239c5c7b54a02fbd3121f68fb264a42d0a1
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/megasas.c

  Log Message:
  -----------
  megasas: use PCI DMA API

MegaSAS emulation is not IOMMU-friendly.  Fix this by switching to
pci_dma_* functions.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 519661ee6514f22b1e289b1c4c8c076378bc4202
      
https://github.com/qemu/qemu/commit/519661ee6514f22b1e289b1c4c8c076378bc4202
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M include/qemu-common.h
    M util/iov.c

  Log Message:
  -----------
  util: add return value to qemu_iovec_concat_iov

This will be necessary later to recognize the case where a
request has both dataout and datain.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 36b15c79aa1bef5fe7543f9f2629b6413720bbfb
      
https://github.com/qemu/qemu/commit/36b15c79aa1bef5fe7543f9f2629b6413720bbfb
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: start preparing for any_layout

- Introduce virtio_scsi_init_req and virtio_scsi_free_req

- rename qemu_sgl_init_external to qemu_sgl_concat

- move virtio_scsi_parse_req from virtio_scsi_pop_req to callers
  and add header length checks to virtio_scsi_parse_req.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: b0b4ea17dc7572ca79b2bb54447de5333dada5b2
      
https://github.com/qemu/qemu/commit/b0b4ea17dc7572ca79b2bb54447de5333dada5b2
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: add target swap for VirtIOSCSICtrlTMFReq fields

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 57fbae6e2cbbea037196a9ad67487c3fe78217f0
      
https://github.com/qemu/qemu/commit/57fbae6e2cbbea037196a9ad67487c3fe78217f0
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: add extra argument and return type to qemu_sgl_concat

Will be used for anylayout support.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 489c7901a6e92d65afab333d498b3790b73f7153
      
https://github.com/qemu/qemu/commit/489c7901a6e92d65afab333d498b3790b73f7153
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: prepare sense data handling for any_layout

Retrieve sense and copy it to guest memory, to prepare for when we will use
qemu_iovec_from_buf.

Swap response and request, since we'll use the tail of VirtIOSCSIReq
for the CDB.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: a3de269ccc6f724e40702d8a9adcc3d41d0db369
      
https://github.com/qemu/qemu/commit/a3de269ccc6f724e40702d8a9adcc3d41d0db369
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: introduce virtio_scsi_complete_cmd_req

This is also related to sense handling, and will be used
by anylayout.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 3eff1f46f08a360a4ae9f834ce9fef4c45bf6f0f
      
https://github.com/qemu/qemu/commit/3eff1f46f08a360a4ae9f834ce9fef4c45bf6f0f
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/i386/pc.h
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: add support for the any_layout feature

Store the request and response headers by value, and let
virtio_scsi_parse_req check that there is only one of datain
and dataout.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: e49ab19fcaa617ad6cdfe1ac401327326b6a2552
      
https://github.com/qemu/qemu/commit/e49ab19fcaa617ad6cdfe1ac401327326b6a2552
  Author: Peter Lieven <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M block/iscsi.c
    M configure

  Log Message:
  -----------
  block/iscsi: bump libiscsi requirement to 1.9.0

This patch lifts the minimum supported libiscsi version from 1.4.0 to
1.9.0 since the BUSY patch required that change.

On one this allows us to remove all #ifdefs from the code which
makes the code easier to maintain and read. On the other hand
I would not recommend libiscsi prior to 1.8.0 for production use
because the following important libiscsi fixes for deadlocks and
protocol errors are missing prior to 1.8.0:

dbe9a1e SOCKET queue cmd PDUs directly in waitpdu queue
30df192 DATA-OUT set pdu->cmdsn appropriately
548bd22 ISCSI fix broken send logic in iscsi_scsi_async_command
14bee10 RECONNECT do not increase CmdSN for immediate PDUs
1f4a66a PDU queue out PDUs in order of itt.
562dd46 PDU avoid incrementing itt to 0xffffffff
cd09c0f PDU use serial32 arithmetic for cmdsn, maxcmdsn and expcmdsn.
89e918e SOCKET validate data_size in in_pdu header
91267f5 Limit immediate and unsolicited data to FirstBurstLength

Note that libiscsi 1.9.0 was released on Feb 24th, 2013, about
one month after 1.8.0.

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 9d2e256e62738f17d067258012f9a32e74bb9a8e
      
https://github.com/qemu/qemu/commit/9d2e256e62738f17d067258012f9a32e74bb9a8e
  Author: Peter Lieven <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: fix init value for iTask->retries

during rebasing the changed init value for the
retry counter was missed. This resulted in no retries
being performed at all.

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 8c215a9fbdfe9476dd8b907681fc38d0bae78854
      
https://github.com/qemu/qemu/commit/8c215a9fbdfe9476dd8b907681fc38d0bae78854
  Author: Peter Lieven <address@hidden>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: drop obsolete pointers from iscsi_co_writev

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 91d670fbf9945ca4ecbd123affb36889e7fe8a5d
      
https://github.com/qemu/qemu/commit/91d670fbf9945ca4ecbd123affb36889e7fe8a5d
  Author: Ming Lei <address@hidden>
  Date:   2014-06-19 (Thu, 19 Jun 2014)

  Changed paths:
    M hw/scsi/vhost-scsi.c
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: define dummy handle_output for vhost-scsi vqs

vhost userspace needn't to handle vq's notification from guest,
so define dummy handle_output callback for all vqs of vhost-scsi.

In some corner cases(such as when handling vq's reset from VM), virtio-pci
still trys to handle pending virtio-scsi events, then object check failure
inside virtio_scsi_handle_event() for vhost-scsi can be triggered.

The issue can be reproduced by 'rmmod virtio-scsi', 'system sleep' or reboot
inside VM.

Cc: address@hidden
Cc: Anthony Liguori <address@hidden>
Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Ming Lei <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 6baa963f4dcc211801608ebe1e0482b51653350c
      
https://github.com/qemu/qemu/commit/6baa963f4dcc211801608ebe1e0482b51653350c
  Author: Peter Maydell <address@hidden>
  Date:   2014-06-19 (Thu, 19 Jun 2014)

  Changed paths:
    M block/iscsi.c
    M configure
    M hw/scsi/megasas.c
    M hw/scsi/scsi-bus.c
    M hw/scsi/scsi-disk.c
    M hw/scsi/spapr_vscsi.c
    M hw/scsi/vhost-scsi.c
    M hw/scsi/virtio-scsi.c
    M include/block/scsi.h
    M include/hw/i386/pc.h
    M include/hw/virtio/virtio-scsi.h
    M include/qemu-common.h
    M util/iov.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/scsi-next' into staging

* remotes/bonzini/scsi-next:
  virtio-scsi: define dummy handle_output for vhost-scsi vqs
  block/iscsi: drop obsolete pointers from iscsi_co_writev
  block/iscsi: fix init value for iTask->retries
  block/iscsi: bump libiscsi requirement to 1.9.0
  virtio-scsi: add support for the any_layout feature
  virtio-scsi: introduce virtio_scsi_complete_cmd_req
  virtio-scsi: prepare sense data handling for any_layout
  virtio-scsi: add extra argument and return type to qemu_sgl_concat
  virtio-scsi: add target swap for VirtIOSCSICtrlTMFReq fields
  virtio-scsi: start preparing for any_layout
  util: add return value to qemu_iovec_concat_iov
  megasas: use PCI DMA API
  scsi: Print command name in debug
  scsi-disk: fix bug in scsi_block_new_request() introduced by commit 137745c
  scsi-disk.c: Fix compilation with -DDEBUG_SCSI
  block/iscsi: use 16 byte CDBs only when necessary
  block/iscsi: fix potential segfault on early callback
  block/iscsi: handle BUSY condition

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/9f6f7f1a85b1...6baa963f4dcc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]