From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:59431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1git75-0000Ij-NM for qemu-devel@nongnu.org; Sun, 13 Jan 2019 22:40:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1git74-0003P2-Gg for qemu-devel@nongnu.org; Sun, 13 Jan 2019 22:40:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47086) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1git72-0003Ej-5o for qemu-devel@nongnu.org; Sun, 13 Jan 2019 22:40:32 -0500 Date: Mon, 14 Jan 2019 11:31:30 +0800 From: Peter Xu Message-ID: <20190114033130.GE24343@xz-x1> References: <20190113143641.38936-1-lifei1214@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190113143641.38936-1-lifei1214@126.com> 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: Fei Li Cc: qemu-devel@nongnu.org, shirley17fei@gmail.com, Markus Armbruster , "Michael S . Tsirkin" , Marcel Apfelbaum 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. 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, -- Peter Xu