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

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio message

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


Subject: Re: [virtio] [OASIS Issue Tracker] Created: (VIRTIO-18) Remove VIRTIO_BLK_F_SCSI


OASIS Issues Tracker <workgroup_mailer@lists.oasis-open.org> writes:

> Remove VIRTIO_BLK_F_SCSI
> ------------------------
>
>                  Key: VIRTIO-18
>                  URL: http://tools.oasis-open.org/issues/browse/VIRTIO-18
>              Project: OASIS Virtual I/O Device (VIRTIO) TC
>           Issue Type: Improvement
>             Reporter: Rusty Russell
>
>
> VIRTIO_BLK_F_SCSI was supposed to be a catch-all for various operations (like eject), but it hasn't turned out that way.  Perhaps we'd be better with explicit commands (like eject, trim) and feature bits?

The removal looks like this:

commit a31797835c998ce4a062f31318097b20b37c6be6
Author: Rusty Russell <rusty@au1.ibm.com>
Date:   Mon Sep 9 17:33:38 2013 +0930

    Relegate the VIRTIO_BLK_F_SCSI feature to legacy
    
    As per issue virtio-18.
    
    Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

diff --git a/virtio-v1.0-wd01-part1-specification.txt b/virtio-v1.0-wd01-part1-specification.txt
index aea3b3f..f1988c9 100644
--- a/virtio-v1.0-wd01-part1-specification.txt
+++ b/virtio-v1.0-wd01-part1-specification.txt
@@ -1595,8 +1595,6 @@ device except where noted.
 
   VIRTIO_BLK_F_BLK_SIZE (6) Block size of disk is in “blk_size”.
 
-  VIRTIO_BLK_F_SCSI (7) Device supports scsi packet commands.
-
   VIRTIO_BLK_F_FLUSH (9) Cache flush command support.
 
   Device configuration layout The capacity of the device
@@ -1616,6 +1614,11 @@ device except where noted.
 		u32 blk_size;
 	};
 
+2.4.2.3.1 Legacy Interface: Feature bits
+--------------------
+  VIRTIO_BLK_F_SCSI (7) Device supports scsi packet commands.
+
+
 2.4.2.3. Device Initialization
 -----------------------------
 
@@ -1646,27 +1649,8 @@ the device (not necessarily in order). Each request is of form:
 		u8 status;
 	};
 
-If the device has VIRTIO_BLK_F_SCSI feature, it can also support
-scsi packet command requests, each of these requests is of form:
-
-	struct virtio_scsi_pc_req {
-		u32 type;
-		u32 ioprio;
-		u64 sector;
-		char cmd[];
-		char data[][512];
-#define SCSI_SENSE_BUFFERSIZE   96
-		u8 sense[SCSI_SENSE_BUFFERSIZE];
-		u32 errors;
-		u32 data_len;
-		u32 sense_len;
-		u32 residual;
-		u8 status;
-	};
-
 The type of the request is either a read (VIRTIO_BLK_T_IN), a write
-(VIRTIO_BLK_T_OUT), a scsi packet command (VIRTIO_BLK_T_SCSI_CMD or
-VIRTIO_BLK_T_SCSI_CMD_OUT[22]) or a flush (VIRTIO_BLK_T_FLUSH or
+(VIRTIO_BLK_T_OUT), or a flush (VIRTIO_BLK_T_FLUSH or
 VIRTIO_BLK_T_FLUSH_OUT[23]). If the device has VIRTIO_BLK_F_BARRIER
 feature the high bit (VIRTIO_BLK_T_BARRIER) indicates that this
 request acts as a barrier and that all preceeding requests must be
@@ -1678,8 +1662,6 @@ flush the host cache.
 
 	#define VIRTIO_BLK_T_IN           0
 	#define VIRTIO_BLK_T_OUT          1
-	#define VIRTIO_BLK_T_SCSI_CMD     2
-	#define VIRTIO_BLK_T_SCSI_CMD_OUT 3
 	#define VIRTIO_BLK_T_FLUSH        4
 	#define VIRTIO_BLK_T_FLUSH_OUT    5
 	#define VIRTIO_BLK_T_BARRIER	 0x80000000
@@ -1692,6 +1674,45 @@ The sector number indicates the offset (multiplied by 512) where
 the read or write is to occur. This field is unused and set to 0
 for scsi packet commands and for flush commands.
 
+The final status byte is written by the device: either
+VIRTIO_BLK_S_OK for success, VIRTIO_BLK_S_IOERR for host or guest
+error or VIRTIO_BLK_S_UNSUPP for a request unsupported by host:
+
+	#define VIRTIO_BLK_S_OK        0
+	#define VIRTIO_BLK_S_IOERR     1
+	#define VIRTIO_BLK_S_UNSUPP    2
+
+Historically, devices assumed that the fields type, ioprio and sector
+reside in a single, separate read-only buffer and the status field is
+a separate read-only buffer of size 1 byte, by itself.
+
+2.4.2.5.1 Legacy Interface: Device Operation
+------------------------
+If the device has VIRTIO_BLK_F_SCSI feature, it can also support
+scsi packet command requests, each of these requests is of form:
+
+	struct virtio_scsi_pc_req {
+		u32 type;
+		u32 ioprio;
+		u64 sector;
+		char cmd[];
+		char data[][512];
+#define SCSI_SENSE_BUFFERSIZE   96
+		u8 sense[SCSI_SENSE_BUFFERSIZE];
+		u32 errors;
+		u32 data_len;
+		u32 sense_len;
+		u32 residual;
+		u8 status;
+	};
+
+A request type can also be a scsi packet command (VIRTIO_BLK_T_SCSI_CMD or
+VIRTIO_BLK_T_SCSI_CMD_OUT).  The two types are equivalent, the device
+does not distinguish between them:
+
+	#define VIRTIO_BLK_T_SCSI_CMD     2
+	#define VIRTIO_BLK_T_SCSI_CMD_OUT 3
+
 The cmd field is only present for scsi packet command requests,
 and indicates the command to perform. This field must reside in a
 single, separate read-only buffer; command length can be derived
@@ -1717,22 +1738,11 @@ The residual field is only present for scsi packet command
 requests and indicates the residual size, calculated as data
 length - number of bytes actually transferred.
 
-The final status byte is written by the device: either
-VIRTIO_BLK_S_OK for success, VIRTIO_BLK_S_IOERR for host or guest
-error or VIRTIO_BLK_S_UNSUPP for a request unsupported by host:
-
-	#define VIRTIO_BLK_S_OK        0
-	#define VIRTIO_BLK_S_IOERR     1
-	#define VIRTIO_BLK_S_UNSUPP    2
-
-Historically, devices assumed that the fields type, ioprio and
-sector reside in a single, separate read-only buffer; the fields
-errors, data_len, sense_len and residual reside in a single,
-separate write-only buffer; the sense field in a separate
-write-only buffer of size 96 bytes, by itself; the fields errors,
-data_len, sense_len and residual in a single write-only buffer;
-and the status field is a separate read-only buffer of size 1
-byte, by itself.
+Devices assume the fields errors, data_len, sense_len and residual
+reside in a single, separate write-only buffer; the sense field in a
+separate write-only buffer of size 96 bytes, by itself; and the fields
+errors, data_len, sense_len and residual in a single write-only
+buffer.
 
 
 2.4.3. Console Device
@@ -2937,9 +2947,6 @@ elements.
 silently switch to allmulti or promiscuous mode if it is given too
 many addresses.
 
-[22] The SCSI_CMD and SCSI_CMD_OUT types are equivalent, the device
-does not distinguish between them.
-
 [23] The FLUSH and FLUSH_OUT types are equivalent, the device does not
 distinguish between them
 



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