]> xenbits.xensource.com Git - people/aperard/qemu-dm.git/commitdiff
hw/nvme: fix smart aen
authorKlaus Jensen <k.jensen@samsung.com>
Thu, 5 May 2022 22:21:47 +0000 (00:21 +0200)
committerKlaus Jensen <k.jensen@samsung.com>
Fri, 3 Jun 2022 19:48:24 +0000 (21:48 +0200)
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 <pizhenwei@bytedance.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
hw/nvme/ctrl.c

index 08574c4dcbc8209c570b8b261974e9308171ea34..a2f6069f7fe175230e9beefb9f9b7eec7f27a71b 100644 (file)
@@ -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;