On Thu, Jan 14, 2021 at 03:22:51PM +0800, zhenwei pi wrote:
> @@ -2860,6 +2887,12 @@ static void nvme_set_smart_warning(Object *obj,
> Visitor *v, const char *name,
> }
>
> s->smart_critical_warning = value;
> +
> + /* test each bit of uint8_t for smart.critical_warning */
> + for (event = 0; event < 8; event++) {
> + if (value & (1 << event))
> + nvme_enqueue_smart_event(s, 1 << event);
I think you need to save the events that have already been raised with
the host so that you don't send duplicate responses everytime a new
event is added to the 'critical_warning'.