Skip to content

Add Support for GET LBA STATUS 16 command in scsi emulation

Lin Ma qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/23 patches 5 repliesIn review
  2. v2 posting 1/23 patches 0 repliesSuperseded
  3. v14 patches 3 repliesSuperseded

v2->v1 from the cover letter

Follow Claudio's suggestions and the docker test result, Fix the dereferencing 'void *' pointer issues and the coding style issues.

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: Add bdrv_co_get_lba_statusblock/io.c include/block/block_int.h+48 -01 reply
2/3block: Add GET LBA STATUS supportblock/block-backend.c include/sysemu/block-backend.h+40 -00 replies
3/3scsi-disk: Add support for the GET LBA STATUS 16 commandhw/scsi/scsi-disk.c include/block/accounting.h include/scsi/constants.h+92 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] Add Support for GET LBA STATUS 16 command in scsi emulation

v2->v1:
Follow Claudio's suggestions and the docker test result, Fix the dereferencing 'void *' pointer issues and the coding style issues.

In this current design, The GET LBA STATUS parameter data only contains an eight-byte header + one LBA status descriptor.

How to test:
host:~ # qemu-system-x86_64 \
...
-drive file=/vm0/disk0.raw,format=raw,if=none,id=drive0,discard=unmap \
-device scsi-hd,id=scsi0,drive=drive0 \
...

guest:~ # dd if=/dev/zero of=/dev/sda bs=512 seek=1024 count=256

guest:~ # sg_unmap -l 1024 -n 32 /dev/sda

guest:~ # sg_get_lba_status /dev/sda -l 1024
No indication of the completion condition
RTP=0
descriptor LBA: 0x0000000000000400 blocks: 32 deallocated

Lin Ma (3):
block: Add bdrv_co_get_lba_status
block: Add GET LBA STATUS support
scsi-disk: Add support for the GET LBA STATUS 16 command

 block/block-backend.c          | 38 ++++++++++++++
 block/io.c                     | 43 ++++++++++++++++
 hw/scsi/scsi-disk.c            | 90 ++++++++++++++++++++++++++++++++++
 include/block/accounting.h     |  1 +
 include/block/block_int.h      |  5 ++
 include/scsi/constants.h       |  1 +
 include/sysemu/block-backend.h |  2 +
 7 files changed, 180 insertions(+)
Signature · 1 line
2.26.0