All of lore.kernel.org
 help / color / mirror / Atom feed
* [virtio-dev] [PATCH] virtio-blk: document VIRTIO_BLK_T_GET_ID
@ 2019-12-02 10:02 Stefan Hajnoczi
  2019-12-02 10:14 ` Jan Kiszka
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2019-12-02 10:02 UTC (permalink / raw)
  To: virtio-dev; +Cc: Jan Kiszka, Stefan Hajnoczi

The VIRTIO_BLK_T_GET_ID request type was implemented in Linux and QEMU
in 2010.  It does not have a feature bit but devices respond with
VIRTIO_BLK_S_UNSUPP if a request type is unimplemented.

This patch documents the VIRTIO_BLK_T_GET_ID request type as currently
implemented in Linux and QEMU.

Suggested-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 content.tex | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/content.tex b/content.tex
index d68cfaf..b8baaad 100644
--- a/content.tex
+++ b/content.tex
@@ -4094,12 +4094,14 @@ \subsection{Device Operation}\label{sec:Device Types / Block Device / Device Ope
 
 The type of the request is either a read (VIRTIO_BLK_T_IN), a write
 (VIRTIO_BLK_T_OUT), a discard (VIRTIO_BLK_T_DISCARD), a write zeroes
-(VIRTIO_BLK_T_WRITE_ZEROES) or a flush (VIRTIO_BLK_T_FLUSH).
+(VIRTIO_BLK_T_WRITE_ZEROES), a flush (VIRTIO_BLK_T_FLUSH), or a get device ID
+string command (VIRTIO_BLK_T_GET_ID).
 
 \begin{lstlisting}
 #define VIRTIO_BLK_T_IN           0
 #define VIRTIO_BLK_T_OUT          1
 #define VIRTIO_BLK_T_FLUSH        4
+#define VIRTIO_BLK_T_GET_ID       8
 #define VIRTIO_BLK_T_DISCARD      11
 #define VIRTIO_BLK_T_WRITE_ZEROES 13
 \end{lstlisting}
@@ -4135,6 +4137,10 @@ \subsection{Device Operation}\label{sec:Device Types / Block Device / Device Ope
 the device to discard the specified range, provided that following reads return
 zeroes.
 
+VIRTIO_BLK_T_GET_ID requests fetch the device ID string from the device into
+\field{data}.  The device ID string is a NUL-padded ASCII string up to 20 bytes
+long.  If the string is 20 bytes long then there is no NUL terminator.
+
 The final \field{status} byte is written by the device: either
 VIRTIO_BLK_S_OK for success, VIRTIO_BLK_S_IOERR for device or driver
 error or VIRTIO_BLK_S_UNSUPP for a request unsupported by device:
@@ -4166,6 +4172,8 @@ \subsection{Device Operation}\label{sec:Device Types / Block Device / Device Ope
 virtio_blk_discard_write_zeroes for VIRTIO_BLK_T_DISCARD and
 VIRTIO_BLK_T_WRITE_ZEROES requests.
 
+The length of \field{data} MUST be 20 bytes for VIRTIO_BLK_T_GET_ID requests.
+
 VIRTIO_BLK_T_DISCARD requests MUST NOT contain more than
 \field{max_discard_seg} struct virtio_blk_discard_write_zeroes segments in
 \field{data}.
-- 
2.23.0


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-02 16:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-02 10:02 [virtio-dev] [PATCH] virtio-blk: document VIRTIO_BLK_T_GET_ID Stefan Hajnoczi
2019-12-02 10:14 ` Jan Kiszka
2019-12-02 10:25 ` Matti Moell
2019-12-02 12:40 ` Cornelia Huck
2019-12-02 16:29 ` [virtio-dev] " Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.