From: Klaus Jensen Date: Thu, 5 May 2022 22:21:47 +0000 (+0200) Subject: hw/nvme: fix smart aen X-Git-Tag: v7.1.0-rc0~77^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9235a72a5df0fae1ede89f02717b597ef91cf6ad;p=thirdparty%2Fqemu.git hw/nvme: fix smart aen Pass the right constant to nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be in nvme_smart_event(). Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning") Acked-by: zhenwei pi Signed-off-by: Klaus Jensen --- diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 08574c4dcbc..a2f6069f7fe 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -5325,7 +5325,7 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeRequest *req) if ((n->temperature >= n->features.temp_thresh_hi) || (n->temperature <= n->features.temp_thresh_low)) { - nvme_smart_event(n, NVME_AER_INFO_SMART_TEMP_THRESH); + nvme_smart_event(n, NVME_SMART_TEMPERATURE); } break;