mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
hw/nvme: Allocate sec-ctrl-list as a dynamic array
To prevent further bumping up the number of maximum VF te support, this patch allocates a dynamic array (NvmeCtrl *)->sec_ctrl_list based on number of VF supported by sriov_max_vfs property. Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Minwoo Im <minwoo.im@samsung.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
parent
1a494d119a
commit
c6159d0e38
3 changed files with 5 additions and 10 deletions
|
@ -61,6 +61,8 @@ int nvme_subsys_register_ctrl(NvmeCtrl *n, Error **errp)
|
|||
if (pci_is_vf(&n->parent_obj)) {
|
||||
cntlid = le16_to_cpu(sctrl->scid);
|
||||
} else {
|
||||
n->sec_ctrl_list = g_new0(NvmeSecCtrlEntry, num_vfs);
|
||||
|
||||
for (cntlid = 0; cntlid < ARRAY_SIZE(subsys->ctrls); cntlid++) {
|
||||
if (!subsys->ctrls[cntlid]) {
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue