Commit 5ffbaeed authored by Klaus Jensen's avatar Klaus Jensen
Browse files

hw/nvme: fix controller hot unplugging


Prior to this patch the nvme-ns devices are always children of the
NvmeBus owned by the NvmeCtrl. This causes the namespaces to be
unrealized when the parent device is removed. However, when subsystems
are involved, this is not what we want since the namespaces may be
attached to other controllers as well.

This patch adds an additional NvmeBus on the subsystem device. When
nvme-ns devices are realized, if the parent controller device is linked
to a subsystem, the parent bus is set to the subsystem one instead. This
makes sure that namespaces are kept alive and not unrealized.

Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarKlaus Jensen <k.jensen@samsung.com>
parent 51e90178
Showing with 35 additions and 15 deletions
+35 -15
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment