From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mr5YV-0008Ge-AC for qemu-devel@nongnu.org; Fri, 25 Sep 2009 03:49:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mr5YQ-0008GQ-Sq for qemu-devel@nongnu.org; Fri, 25 Sep 2009 03:49:26 -0400 Received: from [199.232.76.173] (port=39060 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mr5YQ-0008GN-O2 for qemu-devel@nongnu.org; Fri, 25 Sep 2009 03:49:22 -0400 Received: from mx20.gnu.org ([199.232.41.8]:30324) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mr5YP-0001G8-Nc for qemu-devel@nongnu.org; Fri, 25 Sep 2009 03:49:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mr5YO-0007kO-Fs for qemu-devel@nongnu.org; Fri, 25 Sep 2009 03:49:20 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8P7nJDx031436 for ; Fri, 25 Sep 2009 03:49:19 -0400 Message-ID: <4ABC75FC.6030408@redhat.com> Date: Fri, 25 Sep 2009 09:49:16 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 12/13] pci: move unregister from PCIDevice to PCIDeviceInfo References: <1253611767-6483-1-git-send-email-kraxel@redhat.com> <1253611767-6483-13-git-send-email-kraxel@redhat.com> <20090923155844.GB18203@redhat.com> In-Reply-To: <20090923155844.GB18203@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org Hi, >> static int pci_unregister_device(DeviceState *dev) >> + msix_uninit(pci_dev); > Since devices call msix_add, I think it is cleaner to have them > uninit it as well in their exit routines. Would work too. But this way you can't miss the msix_uninit() call by accident. It also saves a few lines of code. msix_uninit() carefully checks whenever msix is actually enabled and it is slow path, so calling it on non-msix devices isn't a big deal IMHO. cheers, Gerd