From c4a86c1fc0d934d46d79f0124a7e8f84b8bddc58 Mon Sep 17 00:00:00 2001 From: Chuck Tuffli Date: Mon, 24 Aug 2020 01:51:17 +0000 Subject: [PATCH] bhyve: NVMe set nominal health values Some operating systems believe bhyve's emulated NVMe drive is failing based on certain values in the SMART / Health Information log page being zero. Fix is to set the reported temperature and available spare values to reasonable defaults. Submitted by: wanpengqian@gmail.com Reviewed by: grehan MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24202 --- usr.sbin/bhyve/pci_nvme.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 296ac64fd8d..d972ac5ea87 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -604,6 +604,11 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) /* Set read/write remainder to round up according to spec */ sc->read_dunits_remainder = 999; sc->write_dunits_remainder = 999; + + /* Set nominal Health values checked by implementations */ + sc->health_log.temperature = 310; + sc->health_log.available_spare = 100; + sc->health_log.available_spare_threshold = 10; } static void