From: Wei Liu Subject: Re: [PATCH for-4.5] libxl: remove existence check for PCI device hotplug Date: Wed, 19 Nov 2014 21:21:23 +0000 Message-ID: <20141119212123.GA27349@zion.uk.xensource.com> References: <1416226234-30743-1-git-send-email-wei.liu2@citrix.com> <20141119210154.GB20440@laptop.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20141119210154.GB20440@laptop.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: Ian Jackson , liang.z.li@intel.com, Wei Liu , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Nov 19, 2014 at 04:01:54PM -0500, Konrad Rzeszutek Wilk wrote: > On Mon, Nov 17, 2014 at 12:10:34PM +0000, Wei Liu wrote: > > The existence check is to make sure a device is not added to a guest > > multiple times. > > > > PCI device backend path has different rules from vif, disk etc. For > > example: > > /local/domain/0/backend/pci/9/0/dev-1/0000:03:10.1 > > /local/domain/0/backend/pci/9/0/key-1/0000:03:10.1 > > /local/domain/0/backend/pci/9/0/dev-2/0000:03:10.2 > > /local/domain/0/backend/pci/9/0/key-2/0000:03:10.2 > > > > The devid for PCI devices is hardcoded 0. libxl__device_exists only > > checks up to /local/.../9/0 so it always returns true even the device is > > assignable. > > > > Remove invocation of libxl__device_exists. We're sure at this point that > > the PCI device is assignable (hence no xenstore entry or JSON entry). > > The check is done before hand. For HVM guest it's done by calling > > xc_test_assign_device and for PV guest it's done by calling > > pciback_dev_is_assigned. > > > > Reported-by: Li, Liang Z > > Signed-off-by: Wei Liu > > Cc: Ian Campbell > > Cc: Ian Jackson > > Cc: Konrad Wilk > > --- > > This patch fixes a regression in 4.5. > > Ouch! That needs then to be fixed. > > Is the version you would want to commit? I did test it - and it Yes. > looked to do the right thing - thought the xen-pciback is stuck in the > 7 state. However that is a seperate issue that I believe is due to > Xen pciback not your patches. > Thanks for testing. Wei.