hw/block/nvme: support changed namespace asynchronous event
authorMinwoo Im <minwoo.im.dev@gmail.com>
Sun, 28 Feb 2021 08:51:02 +0000 (17:51 +0900)
committerKlaus Jensen <k.jensen@samsung.com>
Tue, 9 Mar 2021 10:00:58 +0000 (11:00 +0100)
commitf432fdfa1215bc3a00468b2e711176be279b0fd2
tree2bcc4ebfdd4fbdebf4c372c2de6ad1979f395a53
parent645ce1a70cb6bedc85a11edb547db091375dea55
hw/block/nvme: support changed namespace asynchronous event

If namespace inventory is changed due to some reasons (e.g., namespace
attachment/detachment), controller can send out event notifier to the
host to manage namespaces.

This patch sends out the AEN to the host after either attach or detach
namespaces from controllers.  To support clear of the event from the
controller, this patch also implemented Get Log Page command for Changed
Namespace List log type.  To return namespace id list through the
command, when namespace inventory is updated, id is added to the
per-controller list (changed_ns_list).

To indicate the support of this async event, this patch set
OAES(Optional Asynchronous Events Supported) in Identify Controller data
structure.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
hw/block/nvme-ns.h
hw/block/nvme.c
hw/block/nvme.h
include/block/nvme.h