From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:59710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gglOU-0004k9-WC for qemu-devel@nongnu.org; Tue, 08 Jan 2019 02:01:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gglOU-0004GN-7U for qemu-devel@nongnu.org; Tue, 08 Jan 2019 02:01:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58922) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gglOT-00046A-W6 for qemu-devel@nongnu.org; Tue, 08 Jan 2019 02:01:46 -0500 Date: Tue, 8 Jan 2019 14:51:59 +0800 From: Peter Xu Message-ID: <20190108065159.GA20511@xz-x1> References: <20181225140449.15786-1-fli@suse.com> <20181225140449.15786-10-fli@suse.com> <87a7kcml5i.fsf@dusky.pond.sub.org> <36097839-654b-6d1f-b79e-f9bc174ec126@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <36097839-654b-6d1f-b79e-f9bc174ec126@suse.cz> Subject: Re: [Qemu-devel] [PATCH for-4.0 v9 09/16] qemu_thread: supplement error handling for pci_edu_realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jiri Slaby Cc: Markus Armbruster , Fei Li , qemu-devel@nongnu.org, shirley17fei@gmail.com, lifei1214@126.com On Tue, Jan 08, 2019 at 07:14:11AM +0100, Jiri Slaby wrote: > On 07. 01. 19, 18:29, Markus Armbruster wrote: > > static void pci_edu_uninit(PCIDevice *pdev) > > { > > EduState *edu = EDU(pdev); > > > > qemu_mutex_lock(&edu->thr_mutex); > > edu->stopping = true; > > qemu_mutex_unlock(&edu->thr_mutex); > > qemu_cond_signal(&edu->thr_cond); > > qemu_thread_join(&edu->thread); > > > > qemu_cond_destroy(&edu->thr_cond); > > qemu_mutex_destroy(&edu->thr_mutex); > > > > timer_del(&edu->dma_timer); > > } > > > > Preexisting: pci_edu_uninit() neglects to call msi_uninit(). Jiri?\ > > I don't know, the MSI support was added in: > commit eabb5782f70b4a10975b24ccd7129929a05ac932 > Author: Peter Xu > Date: Wed Sep 28 21:03:39 2016 +0800 > > hw/misc/edu: support MSI interrupt > > Hence CCing Peter. Hi, Jiri, Markus, Fei, IMHO msi_uninit() is optional since it only operates on the config space of the device to remove the capability or fix up the flags without really doing any real destruction of objects so nothing will be leaked (unlike msix_uninit, which should be required). But I do agree that calling msi_uninit() could be even nicer here. Anyone would like to post a patch? Or should I? Thanks, -- Peter Xu