OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [virtio-dev] [PATCH] virtio-blk: document VIRTIO_BLK_T_GET_ID


On 02.12.19 11:02, Stefan Hajnoczi wrote:
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}.


Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

Thanks,
Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]