Skip to content

Commit 7c89526

Browse files
Weiping Zhangkevmw
Weiping Zhang
authored andcommitted
hw/block/nvme: add optional parameter num_queues for nvme device
Add an optional paramter num_queues for device, and set it to 64 by default. Signed-off-by: Weiping Zhang <[email protected]> Acked-by: Keith Busch <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
1 parent b8efb36 commit 7c89526

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hw/block/nvme.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
* Usage: add options:
1919
* -drive file=<file>,if=none,id=<drive_id>
2020
* -device nvme,drive=<drive_id>,serial=<serial>,id=<id[optional]>, \
21-
* cmb_size_mb=<cmb_size_mb[optional]>
21+
* cmb_size_mb=<cmb_size_mb[optional]>, \
22+
* num_queues=<N[optional]>
2223
*
2324
* Note cmb_size_mb denotes size of CMB in MB. CMB is assumed to be at
2425
* offset 0 in BAR2 and supports only WDS, RDS and SQS for now.
@@ -1232,7 +1233,6 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp)
12321233
pcie_endpoint_cap_init(&n->parent_obj, 0x80);
12331234

12341235
n->num_namespaces = 1;
1235-
n->num_queues = 64;
12361236
n->reg_size = pow2ceil(0x1004 + 2 * (n->num_queues + 1) * 4);
12371237
n->ns_size = bs_size / (uint64_t)n->num_namespaces;
12381238

@@ -1341,6 +1341,7 @@ static Property nvme_props[] = {
13411341
DEFINE_BLOCK_PROPERTIES(NvmeCtrl, conf),
13421342
DEFINE_PROP_STRING("serial", NvmeCtrl, serial),
13431343
DEFINE_PROP_UINT32("cmb_size_mb", NvmeCtrl, cmb_size_mb, 0),
1344+
DEFINE_PROP_UINT32("num_queues", NvmeCtrl, num_queues, 64),
13441345
DEFINE_PROP_END_OF_LIST(),
13451346
};
13461347

0 commit comments

Comments
 (0)