From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwcTv-0006sR-7C for qemu-devel@nongnu.org; Wed, 11 Nov 2015 15:59:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwcTh-0000CV-4v for qemu-devel@nongnu.org; Wed, 11 Nov 2015 15:59:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwcTg-0000CC-Pj for qemu-devel@nongnu.org; Wed, 11 Nov 2015 15:58:49 -0500 Message-ID: <1447275527.3946.24.camel@redhat.com> From: Alex Williamson Date: Wed, 11 Nov 2015 13:58:47 -0700 In-Reply-To: <4c3082e57fbcc6c2a0ebf032f7eabea273d7e935.1447231392.git.chen.fan.fnst@cn.fujitsu.com> References: <4c3082e57fbcc6c2a0ebf032f7eabea273d7e935.1447231392.git.chen.fan.fnst@cn.fujitsu.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v13 10/13] pci: add pci device pre-post reset callbacks for host bus reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cao jin Cc: Chen Fan , qemu-devel@nongnu.org, mst@redhat.com On Wed, 2015-11-11 at 18:34 +0800, Cao jin wrote: > From: Chen Fan > > Particularly, For vfio devices, Once need to recovery devices > by bus reset such as AER, we always need to reset the host bus > to recovery the devices under the bus, so we need to add pci device > callbacks to specify to do host bus reset. > > Signed-off-by: Chen Fan > --- > hw/pci/pci.c | 18 ++++++++++++++++++ > hw/pci/pci_bridge.c | 9 +++++++++ > hw/vfio/pci.c | 26 ++++++++++++++++++++++++++ > hw/vfio/pci.h | 2 ++ > include/hw/pci/pci.h | 7 +++++++ > 5 files changed, 62 insertions(+) ... > diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h > index b385f07..1b89b83 100644 > --- a/hw/vfio/pci.h > +++ b/hw/vfio/pci.h > @@ -144,6 +144,8 @@ typedef struct VFIOPCIDevice { > bool no_kvm_msix; > > NotifierWithReturn hotplug_notifier; > + bool aer_reset; > + bool single_depend_dev; > } VFIOPCIDevice; Add these to with the rest of the bools above hotplug_notifier so the structure isn't larger than it needs to be.