summaryrefslogtreecommitdiffstats
path: root/hw/nvme/ctrl.c
diff options
context:
space:
mode:
authorKlaus Jensen2021-07-06 10:51:36 +0200
committerKlaus Jensen2021-07-26 21:09:38 +0200
commitb0fde9e86133f66c054b31722fa29640f57e975c (patch)
tree98562c6b89b548167bf62b12d13a874a231bfaa4 /hw/nvme/ctrl.c
parenthw/nvme: mark nvme-subsys non-hotpluggable (diff)
downloadqemu-b0fde9e86133f66c054b31722fa29640f57e975c.tar.gz
qemu-b0fde9e86133f66c054b31722fa29640f57e975c.tar.xz
qemu-b0fde9e86133f66c054b31722fa29640f57e975c.zip
hw/nvme: unregister controller with subsystem at exit
Make sure the controller is unregistered from the subsystem when device is removed. Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw/nvme/ctrl.c')
-rw-r--r--hw/nvme/ctrl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index dd18015100..90e3ee2b70 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -6523,6 +6523,10 @@ static void nvme_exit(PCIDevice *pci_dev)
nvme_ns_cleanup(ns);
}
+ if (n->subsys) {
+ nvme_subsys_unregister_ctrl(n->subsys, n);
+ }
+
g_free(n->cq);
g_free(n->sq);
g_free(n->aer_reqs);