summaryrefslogtreecommitdiff
path: root/usr/src/cmd/bhyve
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2021-06-09 12:38:33 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2021-06-10 14:24:06 +0000
commit76e6cd87e3c5c67bcf83c6a51c5fc85ce41e031a (patch)
tree39e4b18d7610978706e15c4e0f79b847efec678f /usr/src/cmd/bhyve
parent6027b8601527b83fd174dc857073dfd37e9a3de8 (diff)
downloadillumos-joyent-76e6cd87e3c5c67bcf83c6a51c5fc85ce41e031a.tar.gz
13860 bhyve nvme with ramdisk backing store no longer works after 13674
Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src/cmd/bhyve')
-rw-r--r--usr/src/cmd/bhyve/pci_nvme.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/usr/src/cmd/bhyve/pci_nvme.c b/usr/src/cmd/bhyve/pci_nvme.c
index c8fd44aa52..175ebe55e2 100644
--- a/usr/src/cmd/bhyve/pci_nvme.c
+++ b/usr/src/cmd/bhyve/pci_nvme.c
@@ -2843,11 +2843,35 @@ done:
return (error);
}
+#ifndef __FreeBSD__
+static int
+nvme_legacy_config(nvlist_t *nvl, const char *opts)
+{
+ const char *path;
+ int ret;
+
+ ret = blockif_legacy_config(nvl, opts);
+
+ if (ret != 0)
+ return (ret);
+
+ path = get_config_value_node(nvl, "path");
+
+ if (path != NULL && strncmp(path, "ram=", 4) == 0)
+ set_config_value_node(nvl, "ram", path + 4);
+
+ return (ret);
+}
+#endif
struct pci_devemu pci_de_nvme = {
.pe_emu = "nvme",
.pe_init = pci_nvme_init,
+#ifndef __FreeBSD__
+ .pe_legacy_config = nvme_legacy_config,
+#else
.pe_legacy_config = blockif_legacy_config,
+#endif
.pe_barwrite = pci_nvme_write,
.pe_barread = pci_nvme_read
};