Received: from eggs.gnu.org ([209.51.188.92]:36569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giwGe-0004kE-D7 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 02:02:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giwGY-0006v3-KG for qemu-devel@nongnu.org; Mon, 14 Jan 2019 02:02:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54688) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giwGX-0006sl-9x for qemu-devel@nongnu.org; Mon, 14 Jan 2019 02:02:34 -0500 From: Markus Armbruster References: <20190113143641.38936-1-lifei1214@126.com> <20190114033130.GE24343@xz-x1> Date: Mon, 14 Jan 2019 08:02:23 +0100 In-Reply-To: <20190114033130.GE24343@xz-x1> (Peter Xu's message of "Mon, 14 Jan 2019 11:31:30 +0800") Message-ID: <87va2rwwlc.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] hw/misc/edu: add msi_uninit() for pci_edu_uninit() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: Fei Li , "Michael S . Tsirkin" , qemu-devel@nongnu.org, shirley17fei@gmail.com Peter Xu writes: > On Sun, Jan 13, 2019 at 10:36:41PM +0800, Fei Li wrote: >> From: Fei Li >> >> Let's supplement the msi_uninit() when failing to realize >> the pci edu device. >> >> Cc: Markus Armbruster >> Cc: Peter Xu >> Cc: Michael S. Tsirkin >> Cc: Marcel Apfelbaum >> Signed-off-by: Fei Li >> --- >> 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 > >> qemu_mutex_lock(&edu->thr_mutex); >> edu->stopping = true; >> qemu_mutex_unlock(&edu->thr_mutex); >> -- >> 2.17.2 (Apple Git-113) >> > > Regards,