From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9TV5-0000vU-Mr for qemu-devel@nongnu.org; Thu, 17 Dec 2015 03:01:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9TUz-0002lJ-OW for qemu-devel@nongnu.org; Thu, 17 Dec 2015 03:01:23 -0500 References: <1450176195-9066-1-git-send-email-caoj.fnst@cn.fujitsu.com> From: Cao jin Message-ID: <56726C1B.50706@cn.fujitsu.com> Date: Thu, 17 Dec 2015 16:02:35 +0800 MIME-Version: 1.0 In-Reply-To: <1450176195-9066-1-git-send-email-caoj.fnst@cn.fujitsu.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC v2 0/2] MSI/MSIX: fix to catch and report errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, jiri@resnulli.us, qemu-block@nongnu.org, mst@redhat.com, jasowang@redhat.com, armbru@redhat.com, keith.busch@intel.com, alex.williamson@redhat.com, sfeldma@gmail.com, kraxel@redhat.com, dmitry@daynix.com, pbonzini@redhat.com, jsnow@redhat.com, hare@suse.de Ping. About cleanup: 1. When realize()/init() fail, PCI device will free the config space memory, so the necessary cleanup I can find until now is: MemoryRegion object. Maybe I missed something to cleanup, hope for comments. 2. certain instance: move the msi/msxi init func to the beginning of the realize()/init() func, to avoid cleanup work. @Markus: hope I didn`t miss anything you mentioned in last review;) On 12/15/2015 06:43 PM, Cao jin wrote: > msi_init() & msix_init() are supporting functions for PCI devices. catch the > errors they produced and report. > > V2 changelog: > 1. Modify as per Markus`s review > a. Try to cleanup on function fail, as possible as I can. > b. For .init() function, use error_report_err() and return non-zero value. > c. For .realize(), propagate the error. > d. Special case: TYPE_ICH9_AHCI, it is a on-board device initialized with > machine init, so don`t bother to cleanup on failure, as process will exit > anyway. > > Cao jin (2): > Add param Error** to msi_init() & modify the callers > Add param Error** to msix_init() & modify the callers > > hw/audio/intel-hda.c | 10 ++++- > hw/block/nvme.c | 32 +++++++++----- > hw/ide/ich.c | 2 +- > hw/misc/ivshmem.c | 7 ++- > hw/net/rocker/rocker.c | 10 +++-- > hw/net/vmxnet3.c | 39 +++++++++++------ > hw/pci-bridge/ioh3420.c | 7 ++- > hw/pci-bridge/pci_bridge_dev.c | 8 +++- > hw/pci-bridge/xio3130_downstream.c | 8 +++- > hw/pci-bridge/xio3130_upstream.c | 8 +++- > hw/pci/msi.c | 18 ++++++-- > hw/pci/msix.c | 20 ++++++--- > hw/scsi/megasas.c | 35 +++++++++++---- > hw/scsi/vmw_pvscsi.c | 13 ++++-- > hw/usb/hcd-xhci.c | 88 +++++++++++++++++++++----------------- > hw/vfio/pci.c | 28 ++++++------ > hw/virtio/virtio-bus.c | 3 ++ > hw/virtio/virtio-pci.c | 64 +++++++++++++-------------- > include/hw/pci/msi.h | 4 +- > include/hw/pci/msix.h | 5 ++- > 20 files changed, 264 insertions(+), 145 deletions(-) > -- Yours Sincerely, Cao Jin