mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
hw/nvme: Add support for the Virtualization Management command
With the new command one can: - assign flexible resources (queues, interrupts) to primary and secondary controllers, - toggle the online/offline state of given controller. Signed-off-by: Łukasz Gieryk <lukasz.gieryk@linux.intel.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
parent
746d42b133
commit
11871f53ef
4 changed files with 295 additions and 2 deletions
|
@ -340,6 +340,7 @@ static inline const char *nvme_adm_opc_str(uint8_t opc)
|
|||
case NVME_ADM_CMD_GET_FEATURES: return "NVME_ADM_CMD_GET_FEATURES";
|
||||
case NVME_ADM_CMD_ASYNC_EV_REQ: return "NVME_ADM_CMD_ASYNC_EV_REQ";
|
||||
case NVME_ADM_CMD_NS_ATTACHMENT: return "NVME_ADM_CMD_NS_ATTACHMENT";
|
||||
case NVME_ADM_CMD_VIRT_MNGMT: return "NVME_ADM_CMD_VIRT_MNGMT";
|
||||
case NVME_ADM_CMD_FORMAT_NVM: return "NVME_ADM_CMD_FORMAT_NVM";
|
||||
default: return "NVME_ADM_CMD_UNKNOWN";
|
||||
}
|
||||
|
@ -491,6 +492,10 @@ typedef struct NvmeCtrl {
|
|||
|
||||
NvmePriCtrlCap pri_ctrl_cap;
|
||||
NvmeSecCtrlList sec_ctrl_list;
|
||||
struct {
|
||||
uint16_t vqrfap;
|
||||
uint16_t virfap;
|
||||
} next_pri_ctrl_cap; /* These override pri_ctrl_cap after reset */
|
||||
} NvmeCtrl;
|
||||
|
||||
typedef enum NvmeResetType {
|
||||
|
@ -542,6 +547,21 @@ static inline NvmeSecCtrlEntry *nvme_sctrl(NvmeCtrl *n)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static inline NvmeSecCtrlEntry *nvme_sctrl_for_cntlid(NvmeCtrl *n,
|
||||
uint16_t cntlid)
|
||||
{
|
||||
NvmeSecCtrlList *list = &n->sec_ctrl_list;
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < list->numcntl; i++) {
|
||||
if (le16_to_cpu(list->sec[i].scid) == cntlid) {
|
||||
return &list->sec[i];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void nvme_attach_ns(NvmeCtrl *n, NvmeNamespace *ns);
|
||||
uint16_t nvme_bounce_data(NvmeCtrl *n, void *ptr, uint32_t len,
|
||||
NvmeTxDirection dir, NvmeRequest *req);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue