hw/block/nvme: Support allocated CNS command variants
Many CNS commands have "allocated" command variants. These include a namespace as long as it is allocated, that is a namespace is included regardless if it is active (attached) or not. While these commands are optional (they are mandatory for controllers supporting the namespace attachment command), our QEMU implementation is more complete by actually providing support for these CNS values. However, since our QEMU model currently does not support the namespace attachment command, these new allocated CNS commands will return the same result as the active CNS command variants. The reason for not hooking up this command completely is because the NVMe specification requires the namespace management command to be supported if the namespace attachment command is supported. Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
parent
141354d55b
commit
922e6f4ebd
@ -2008,16 +2008,24 @@ static uint16_t nvme_identify(NvmeCtrl *n, NvmeRequest *req)
|
||||
|
||||
switch (le32_to_cpu(c->cns)) {
|
||||
case NVME_ID_CNS_NS:
|
||||
/* fall through */
|
||||
case NVME_ID_CNS_NS_PRESENT:
|
||||
return nvme_identify_ns(n, req);
|
||||
case NVME_ID_CNS_CS_NS:
|
||||
/* fall through */
|
||||
case NVME_ID_CNS_CS_NS_PRESENT:
|
||||
return nvme_identify_ns_csi(n, req);
|
||||
case NVME_ID_CNS_CTRL:
|
||||
return nvme_identify_ctrl(n, req);
|
||||
case NVME_ID_CNS_CS_CTRL:
|
||||
return nvme_identify_ctrl_csi(n, req);
|
||||
case NVME_ID_CNS_NS_ACTIVE_LIST:
|
||||
/* fall through */
|
||||
case NVME_ID_CNS_NS_PRESENT_LIST:
|
||||
return nvme_identify_nslist(n, req);
|
||||
case NVME_ID_CNS_CS_NS_ACTIVE_LIST:
|
||||
/* fall through */
|
||||
case NVME_ID_CNS_CS_NS_PRESENT_LIST:
|
||||
return nvme_identify_nslist_csi(n, req);
|
||||
case NVME_ID_CNS_NS_DESCR_LIST:
|
||||
return nvme_identify_ns_descr_list(n, req);
|
||||
|
@ -813,14 +813,18 @@ typedef struct QEMU_PACKED NvmePSD {
|
||||
#define NVME_IDENTIFY_DATA_SIZE 4096
|
||||
|
||||
enum NvmeIdCns {
|
||||
NVME_ID_CNS_NS = 0x00,
|
||||
NVME_ID_CNS_CTRL = 0x01,
|
||||
NVME_ID_CNS_NS_ACTIVE_LIST = 0x02,
|
||||
NVME_ID_CNS_NS_DESCR_LIST = 0x03,
|
||||
NVME_ID_CNS_CS_NS = 0x05,
|
||||
NVME_ID_CNS_CS_CTRL = 0x06,
|
||||
NVME_ID_CNS_CS_NS_ACTIVE_LIST = 0x07,
|
||||
NVME_ID_CNS_IO_COMMAND_SET = 0x1c,
|
||||
NVME_ID_CNS_NS = 0x00,
|
||||
NVME_ID_CNS_CTRL = 0x01,
|
||||
NVME_ID_CNS_NS_ACTIVE_LIST = 0x02,
|
||||
NVME_ID_CNS_NS_DESCR_LIST = 0x03,
|
||||
NVME_ID_CNS_CS_NS = 0x05,
|
||||
NVME_ID_CNS_CS_CTRL = 0x06,
|
||||
NVME_ID_CNS_CS_NS_ACTIVE_LIST = 0x07,
|
||||
NVME_ID_CNS_NS_PRESENT_LIST = 0x10,
|
||||
NVME_ID_CNS_NS_PRESENT = 0x11,
|
||||
NVME_ID_CNS_CS_NS_PRESENT_LIST = 0x1a,
|
||||
NVME_ID_CNS_CS_NS_PRESENT = 0x1b,
|
||||
NVME_ID_CNS_IO_COMMAND_SET = 0x1c,
|
||||
};
|
||||
|
||||
typedef struct QEMU_PACKED NvmeIdCtrl {
|
||||
|
Loading…
Reference in New Issue
Block a user