> #define VIRTIO_SCSI_T_BARRIER 0x80000000 > > The type identifies the remaining fields. The value > VIRTIO_SCSI_T_BARRIER can be ORed in the type as well. This bit > indicates that this request acts as a barrier and that all preceding > requests must be complete before this one, and all following requests > must not be started until this is complete. Note that a barrier > does not flush caches in the underlying backend device in host, > and thus does not serve as data consistency guarantee. The driver > must send a SYNCHRONIZE CACHE command to flush the host cache.
Please don't repeat the barrier mistake done in the Xen and virtio-blk/lguest protocols. It really doesn't make sense to put this kind of strict odering in. If we really want ordering let's do it using SCSI ordered tags at least to use a standard implementation. And SCSI already supports the FUA bit to force a write to be writethrough, even if the QEMU SCSI code doesn't implement. Let's just make virtio-scsi purely a transport and not added magic features into it.