[Qemu-devel] [PATCH v2] hw/misc/edu: add msi_uninit() for pci_edu_uninit()

Fei Li posted 1 patch 5 years, 3 months ago
Test asan passed
Test checkpatch passed
Test docker-clang@ubuntu passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190114131015.52967-1-lifei1214@126.com
hw/misc/edu.c | 1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [PATCH v2] hw/misc/edu: add msi_uninit() for pci_edu_uninit()
Posted by Fei Li 5 years, 3 months ago
From: Fei Li <shirley17fei@gmail.com>

Let's supplement the msi_uninit() when failing to realize
the pci edu device.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Fei Li <shirley17fei@gmail.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
---
 hw/misc/edu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index cdcf550dd7..ceaf688bfb 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -377,6 +377,7 @@ static void pci_edu_uninit(PCIDevice *pdev)
     qemu_mutex_destroy(&edu->thr_mutex);
 
     timer_del(&edu->dma_timer);
+    msi_uninit(pdev);
 }
 
 static void edu_obj_uint64(Object *obj, Visitor *v, const char *name,
-- 
2.17.2 (Apple Git-113)


Re: [Qemu-devel] [PATCH v2] hw/misc/edu: add msi_uninit() for pci_edu_uninit()
Posted by Philippe Mathieu-Daudé 5 years, 3 months ago
Cc'ing qemu-trivial

On 1/14/19 2:10 PM, Fei Li wrote:
> From: Fei Li <shirley17fei@gmail.com>
> 
> Let's supplement the msi_uninit() when failing to realize
> the pci edu device.
> 
> Reported-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Fei Li <shirley17fei@gmail.com>
> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Peter Xu <peterx@redhat.com>
> ---
>  hw/misc/edu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/misc/edu.c b/hw/misc/edu.c
> index cdcf550dd7..ceaf688bfb 100644
> --- a/hw/misc/edu.c
> +++ b/hw/misc/edu.c
> @@ -377,6 +377,7 @@ static void pci_edu_uninit(PCIDevice *pdev)
>      qemu_mutex_destroy(&edu->thr_mutex);
>  
>      timer_del(&edu->dma_timer);
> +    msi_uninit(pdev);
>  }
>  
>  static void edu_obj_uint64(Object *obj, Visitor *v, const char *name,
> 

Re: [Qemu-devel] [PATCH v2] hw/misc/edu: add msi_uninit() for pci_edu_uninit()
Posted by Michael S. Tsirkin 5 years, 3 months ago
On Mon, Jan 14, 2019 at 02:28:39PM +0100, Philippe Mathieu-Daudé wrote:
> Cc'ing qemu-trivial
> 
> On 1/14/19 2:10 PM, Fei Li wrote:
> > From: Fei Li <shirley17fei@gmail.com>
> > 
> > Let's supplement the msi_uninit() when failing to realize
> > the pci edu device.
> > 
> > Reported-by: Markus Armbruster <armbru@redhat.com>
> > Signed-off-by: Fei Li <shirley17fei@gmail.com>
> > Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > Reviewed-by: Peter Xu <peterx@redhat.com>
> > ---
> >  hw/misc/edu.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/hw/misc/edu.c b/hw/misc/edu.c
> > index cdcf550dd7..ceaf688bfb 100644
> > --- a/hw/misc/edu.c
> > +++ b/hw/misc/edu.c
> > @@ -377,6 +377,7 @@ static void pci_edu_uninit(PCIDevice *pdev)
> >      qemu_mutex_destroy(&edu->thr_mutex);
> >  
> >      timer_del(&edu->dma_timer);
> > +    msi_uninit(pdev);
> >  }
> >  
> >  static void edu_obj_uint64(Object *obj, Visitor *v, const char *name,
> > 

That's not trivial material IMHO. I put it in my tree for now.

-- 
MST

Re: [Qemu-devel] [PATCH v2] hw/misc/edu: add msi_uninit() for pci_edu_uninit()
Posted by Philippe Mathieu-Daudé 5 years, 3 months ago
On 1/14/19 4:51 PM, Michael S. Tsirkin wrote:
> On Mon, Jan 14, 2019 at 02:28:39PM +0100, Philippe Mathieu-Daudé wrote:
>> Cc'ing qemu-trivial
>>
>> On 1/14/19 2:10 PM, Fei Li wrote:
>>> From: Fei Li <shirley17fei@gmail.com>
>>>
>>> Let's supplement the msi_uninit() when failing to realize
>>> the pci edu device.
>>>
>>> Reported-by: Markus Armbruster <armbru@redhat.com>
>>> Signed-off-by: Fei Li <shirley17fei@gmail.com>
>>> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> Reviewed-by: Peter Xu <peterx@redhat.com>
>>> ---
>>>  hw/misc/edu.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/hw/misc/edu.c b/hw/misc/edu.c
>>> index cdcf550dd7..ceaf688bfb 100644
>>> --- a/hw/misc/edu.c
>>> +++ b/hw/misc/edu.c
>>> @@ -377,6 +377,7 @@ static void pci_edu_uninit(PCIDevice *pdev)
>>>      qemu_mutex_destroy(&edu->thr_mutex);
>>>  
>>>      timer_del(&edu->dma_timer);
>>> +    msi_uninit(pdev);
>>>  }
>>>  
>>>  static void edu_obj_uint64(Object *obj, Visitor *v, const char *name,
>>>
> 
> That's not trivial material IMHO. I put it in my tree for now.

Hmm it is releasing ressources on deinit... Anyway it is better placed
in your tree, no doubt. Thanks!

Phil.