Skip to content

virtio-blk: Deprecate silent truncation of serial

Kevin Wolf qemu-devel 2 versions – Applied

Status from this message: Thanks, applied to my block tree:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 8 repliesApplied
  2. v15 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Drop truncation of qdev property for now [Stefan]
- Add test case for exactly 20 characters [Stefan]
- Fix missing guest_free() [Stefan]
- Pass pattern_byte to get_id_request() instead of hardcoding it [Stefan]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4virtio-blk: Implement full NUL padding for GET_IDhw/block/virtio-blk.c+8 -40 replies
2/4virtio-blk-test: Add a basic GET_ID test casetests/qtest/virtio-blk-test.c+96 -01 reply
3/4virtio-blk: Deprecate silent truncation of serialdocs/about/deprecated.rst hw/block/virtio-blk.c+19 -00 replies
4/4virtio-blk-test: Test truncated serialtests/qtest/virtio-blk-test.c+23 -01 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchStefan Hajnoczi
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] virtio-blk: Deprecate silent truncation of serial

QEMU has allowed the user to specify serials of arbitrary length for virtio-blk devices, even though the virtio-blk protocol can only communicate 20 characters of the serial to the guest. This means that a longer serial number on the command line is silently truncated to 20 characters from the guest perspective.

As a first step to fix this, deprecate the silent truncation and turn it into a warning; we can later make this a hard error. While touching GET_ID, let's make it more spec compliant and clean up the internal state.

Another part is planned that will actually enable users to use longer serials and additional device identifiers. This will need spec changes and would take more time than we have until the QEMU 11.2 freeze anyway, so I'll address this later. For now, the important thing is to get the deprecation period started.

v2:
- Drop truncation of qdev property for now [Stefan]
- Add test case for exactly 20 characters [Stefan]
- Fix missing guest_free() [Stefan]
- Pass pattern_byte to get_id_request() instead of hardcoding it [Stefan]

Kevin Wolf (4):
virtio-blk: Implement full NUL padding for GET_ID
virtio-blk-test: Add a basic GET_ID test case
virtio-blk: Deprecate silent truncation of serial
virtio-blk-test: Test truncated serial

 docs/about/deprecated.rst     |  13 ++++
 hw/block/virtio-blk.c         |  18 +++--
 tests/qtest/virtio-blk-test.c | 119 ++++++++++++++++++++++++++++++++++
 3 files changed, 146 insertions(+), 4 deletions(-)
Signature · 1 line
2.56.0