bhyve: Fix cli regression with NVMe ram
The configuration management refactoring inadvertently removed support
for a RAM-backed NVMe Namespace (i.e. -s X,nvme,ram=16384). This adds it
back.
Reported by: andy@omniosce.org
Reviewed by: jhb, andy@omniosce.org
Fixes: 621b509048
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30717
This commit is contained in:
parent
7b8622fa22
commit
3a4ab18377
@ -2800,11 +2800,32 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
pci_nvme_legacy_config(nvlist_t *nvl, const char *opts)
|
||||||
|
{
|
||||||
|
char *cp, *ram;
|
||||||
|
|
||||||
|
if (opts == NULL)
|
||||||
|
return (0);
|
||||||
|
|
||||||
|
if (strncmp(opts, "ram=", 4) == 0) {
|
||||||
|
cp = strchr(opts, ',');
|
||||||
|
if (cp == NULL) {
|
||||||
|
set_config_value_node(nvl, "ram", opts + 4);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
ram = strndup(opts + 4, cp - opts - 4);
|
||||||
|
set_config_value_node(nvl, "ram", ram);
|
||||||
|
free(ram);
|
||||||
|
return (pci_parse_legacy_config(nvl, cp + 1));
|
||||||
|
} else
|
||||||
|
return (blockif_legacy_config(nvl, opts));
|
||||||
|
}
|
||||||
|
|
||||||
struct pci_devemu pci_de_nvme = {
|
struct pci_devemu pci_de_nvme = {
|
||||||
.pe_emu = "nvme",
|
.pe_emu = "nvme",
|
||||||
.pe_init = pci_nvme_init,
|
.pe_init = pci_nvme_init,
|
||||||
.pe_legacy_config = blockif_legacy_config,
|
.pe_legacy_config = pci_nvme_legacy_config,
|
||||||
.pe_barwrite = pci_nvme_write,
|
.pe_barwrite = pci_nvme_write,
|
||||||
.pe_barread = pci_nvme_read
|
.pe_barread = pci_nvme_read
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user