← Prev in month
← Prev in thread
Re: [virtio-dev] [PATCH v2] Add lifetime metrics to virtio-blk
On Thu, Feb 25, 2021 at 04:41:41PM -0700, Enrico Granata wrote:
> @@ -4611,6 +4615,7 @@ \subsection{Device Operation}\label{sec:Device
> Types / Block Device / Device Ope
> #define VIRTIO_BLK_T_GET_ID 8
> #define VIRTIO_BLK_T_DISCARD 11
> #define VIRTIO_BLK_T_WRITE_ZEROES 13
> +#define VIRTIO_BLK_T_GET_LIFETIME 15
Sorry I missed this in the previous revision:
There is some funny business in the Linux drivers/block/virtio_blk.c
driver and QEMU hw/block/virtio-blk.c device implementations where the
least significant bit indicates a driver-to-device DMA transfer when
set and a device-to-driver DMA transfer when clear. That's why
DISCARD/WRITE_ZEROES have odd-numbered request types but GET_ID has an
even-numbered request type.
The implementations should probably be overhauled to stop doing this.
There doesn't seem to be a good reason for it! :P
To make life easy, please choose an even-numbered request type. That way
these implementations will treat VIRTIO_BLK_T_GET_LIFETIME as a "read"
instead of a "write". 10, 12, or 14 would work.
Otherwise:
Reviewed-by: Stefan Hajnoczi <>
← Prev in month
← Prev in thread