hw/misc/edu: add msi_uninit() for pci_edu_uninit()
PATCH 1/1 hw/misc/edu: add msi_uninit() for pci_edu_uninit()
From: Fei Li <[email protected]>
Let's supplement the msi_uninit() when failing to realize the pci edu device.
--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)
hw/misc/edu.c +1 -0
@@ -367,6 +367,7 @@ static void pci_edu_uninit(PCIDevice *pdev) {EduState *edu =EDU (pdev); +msi_uninit (pdev);qemu_mutex_lock (&edu->thr_mutex); edu->stopping = true;qemu_mutex_unlock (&edu->thr_mutex);
Signature · 1 line
2.17.2 (Apple Git-113)
Quoted 19 lines · Fei Li
From: Fei Li <[email protected]>
Let's supplement the
msi_uninit()when failing to realize the pci edu device.Cc Markus Armbruster <[email protected]>Cc Peter Xu <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Fei Li <[email protected]>--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)hw/misc/edu.c +0
-0
hw/misc/edu.c static void pci_edu_uninit(PCIDevice *pdev) · line 373
Quoted 7 lines
hw/misc/edu.c +1
-0@@ -367,6 +367,7 @@ static void pci_edu_uninit(PCIDevice *pdev) {EduState *edu =EDU (pdev); +msi_uninit (pdev);qemu_mutex_lock (&edu->thr_mutex); edu->stopping = true;qemu_mutex_unlock (&edu->thr_mutex);
Thanks,
Marcel
Quoted 19 lines · Fei Li
From: Fei Li <[email protected]>
Let's supplement the
msi_uninit()when failing to realize the pci edu device.Cc Markus Armbruster <[email protected]>Cc Peter Xu <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Fei Li <[email protected]>--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)hw/misc/edu.c +0
-0
hw/misc/edu.c static void pci_edu_uninit(PCIDevice *pdev) · line 370
Quoted 4 lines
hw/misc/edu.c +1
-0@@ -367,6 +367,7 @@ static void pci_edu_uninit(PCIDevice *pdev) {EduState *edu =EDU (pdev); +msi_uninit (pdev);
It would be cleaner to me to call this after the join() since edu_fact_thread() could potentially use msi_*() helpers then the destructions follow the reverse order of init.
Quoted 6 lines
hw/misc/edu.c +0
-0qemu_mutex_lock (&edu->thr_mutex); edu->stopping = true;qemu_mutex_unlock (&edu->thr_mutex);Signature · 1 line
2.17.2 (Apple Git-113)
Regards,
Signature · 1 line
Peter Xu
Quoted 23 lines · Peter Xu
Quoted 22 lines · Fei Li
From: Fei Li <[email protected]>
Let's supplement the
msi_uninit()when failing to realize the pci edu device.Cc Markus Armbruster <[email protected]>Cc Peter Xu <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Fei Li <[email protected]>--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)hw/misc/edu.c +0
-0@@ -367,6 +367,7 @@ static void pci_edu_uninit(PCIDevice *pdev) {EduState *edu =EDU (pdev);
Quoted 5 lines
hw/misc/edu.c static void pci_edu_uninit(PCIDevice *pdev) · line 370
Quoted 1 line
hw/misc/edu.c +1
-0+msi_uninit (pdev);It would be cleaner to me to call this after the
join()sinceedu_fact_thread()could potentially use msi_*() helpers then the destructions follow the reverse order of init.
Destruction in reverse creation order is good practice.
This being the "QEMU educational PCI device", good practice is even more desirable.
Quoted 10 lines
Reviewed-by Peter Xu <[email protected]>Quoted 6 lines
hw/misc/edu.c +0
-0qemu_mutex_lock (&edu->thr_mutex); edu->stopping = true;qemu_mutex_unlock (&edu->thr_mutex);Signature · 1 line
2.17.2 (Apple Git-113)Regards,
Quoted 31 lines · Markus Armbruster
Quoted 23 lines · Peter Xu
Quoted 22 lines · Fei Li
From: Fei Li <[email protected]>
Let's supplement the
msi_uninit()when failing to realize the pci edu device.Cc Markus Armbruster <[email protected]>Cc Peter Xu <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Fei Li <[email protected]>--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)hw/misc/edu.c +0
-0@@ -367,6 +367,7 @@ static void pci_edu_uninit(PCIDevice *pdev) {EduState *edu =EDU (pdev);Quoted 5 lines
hw/misc/edu.c static void pci_edu_uninit(PCIDevice *pdev) · line 370
Quoted 1 line
hw/misc/edu.c +1
-0+msi_uninit (pdev);It would be cleaner to me to call this after the
join()sinceedu_fact_thread()could potentially use msi_*() helpers then the destructions follow the reverse order of init.
Quoted 4 lines
Destruction in reverse creation order is good practice.
This being the "QEMU educational PCI device", good practice is even more desirable.
Very persuasive. With that, I'd like to withdraw my excuse of "msi_uninit() is optional" too. :)
Fei, please feel free to pick my r-b if you want to repost, and IMHO you can also add:
Thanks,
Signature · 1 line
Peter Xu
Philippe Mathieu-Daudé
Reviewed-byQuoted 40 lines · Peter Xu
Quoted 31 lines · Markus Armbruster
Quoted 23 lines · Peter Xu
Quoted 22 lines · Fei Li
From: Fei Li <[email protected]>
Let's supplement the
msi_uninit()when failing to realize the pci edu device.Cc Markus Armbruster <[email protected]>Cc Peter Xu <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Fei Li <[email protected]>--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)hw/misc/edu.c +0
-0@@ -367,6 +367,7 @@ static void pci_edu_uninit(PCIDevice *pdev) {EduState *edu =EDU (pdev);Quoted 5 lines
hw/misc/edu.c static void pci_edu_uninit(PCIDevice *pdev) · line 370
Quoted 1 line
hw/misc/edu.c +1
-0+msi_uninit (pdev);It would be cleaner to me to call this after the
join()sinceedu_fact_thread()could potentially use msi_*() helpers then the destructions follow the reverse order of init.Quoted 4 lines
Destruction in reverse creation order is good practice.
This being the "QEMU educational PCI device", good practice is even more desirable.
Very persuasive. With that, I'd like to withdraw my excuse of "
msi_uninit()is optional" too. :)
Quoted 7 lines
Fei, please feel free to pick my r-b if you want to repost, and IMHO you can also add:
Reported-by Markus Armbruster <[email protected]>Thanks,
Moving msi_uninit() after timer_del():
Quoted 41 lines · Philippe Mathieu-Daudé
Quoted 40 lines · Peter Xu
Quoted 25 lines · Markus Armbruster
Quoted 23 lines · Peter Xu
Quoted 22 lines · Fei Li
From: Fei Li <[email protected]>
Let's supplement the
msi_uninit()when failing to realize the pci edu device.Cc Markus Armbruster <[email protected]>Cc Peter Xu <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Marcel Apfelbaum <[email protected]>Signed-off-by Fei Li <[email protected]>--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)hw/misc/edu.c +0
-0@@ -367,6 +367,7 @@ static void pci_edu_uninit(PCIDevice *pdev) {EduState *edu =EDU (pdev);Quoted 8 lines
Quoted 4 lines
hw/misc/edu.c static void pci_edu_uninit(PCIDevice *pdev) · line 370
Quoted 1 line
hw/misc/edu.c +1
-0+msi_uninit (pdev);It would be cleaner to me to call this after the
join()sinceedu_fact_thread()could potentially use msi_*() helpers then the destructions follow the reverse order of init.Destruction in reverse creation order is good practice.
This being the "QEMU educational PCI device", good practice is even more desirable.
Very persuasive. With that, I'd like to withdraw my excuse of "
msi_uninit()is optional" too. :)Fei, please feel free to pick my r-b if you want to repost, and IMHO you can also add:
Quoted 6 lines
Quoted 4 lines
Reported-by Markus Armbruster <[email protected]>Thanks,
Moving
msi_uninit()aftertimer_del():Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Ok, thanks all!
Will do the update and send a new version soon.
Have a nice day
Fei