All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: Fei Li <lifei1214@126.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, shirley17fei@gmail.com
Subject: Re: [Qemu-devel] [PATCH] hw/misc/edu: add msi_uninit() for pci_edu_uninit()
Date: Mon, 14 Jan 2019 08:02:23 +0100	[thread overview]
Message-ID: <87va2rwwlc.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20190114033130.GE24343@xz-x1> (Peter Xu's message of "Mon, 14 Jan 2019 11:31:30 +0800")

Peter Xu <peterx@redhat.com> writes:

> On Sun, Jan 13, 2019 at 10:36:41PM +0800, Fei Li wrote:
>> From: Fei Li <shirley17fei@gmail.com>
>> 
>> Let's supplement the msi_uninit() when failing to realize
>> the pci edu device.
>> 
>> Cc: Markus Armbruster <armbru@redhat.com>
>> Cc: Peter Xu <peterx@redhat.com>
>> Cc: Michael S. Tsirkin <mst@redhat.com>
>> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>> Signed-off-by: Fei Li <shirley17fei@gmail.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..4feb7503de 100644
>> --- a/hw/misc/edu.c
>> +++ b/hw/misc/edu.c
>> @@ -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.

Destruction in reverse creation order is good practice.

This being the "QEMU educational PCI device", good practice is even more
desirable.

> Reviewed-by: Peter Xu <peterx@redhat.com>
>
>>      qemu_mutex_lock(&edu->thr_mutex);
>>      edu->stopping = true;
>>      qemu_mutex_unlock(&edu->thr_mutex);
>> -- 
>> 2.17.2 (Apple Git-113)
>> 
>
> Regards,

  reply	other threads:[~2019-01-14  7:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-13 14:36 [Qemu-devel] [PATCH] hw/misc/edu: add msi_uninit() for pci_edu_uninit() Fei Li
2019-01-13 16:54 ` Marcel Apfelbaum
2019-01-14  3:31 ` Peter Xu
2019-01-14  7:02   ` Markus Armbruster [this message]
2019-01-14  7:18     ` Peter Xu
2019-01-14 10:40       ` Philippe Mathieu-Daudé
2019-01-14 12:45         ` Fei Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87va2rwwlc.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=lifei1214@126.com \
    --cc=mst@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shirley17fei@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.