Re: [Xen-devel] [PATCH v3 07/15] libxl: disallow attaching the same device more than once

2014-11-17 Thread Wei Liu
On Mon, Nov 17, 2014 at 10:55:34AM +, Li, Liang Z wrote: > > > The libxl__device_exists will return 1 if more than one PCI devices are > > > attached to the guest, no matter the BDFs are identical or not. > > > > That means this check is problematic. I think the original intention was to > >

Re: [Xen-devel] [PATCH v3 07/15] libxl: disallow attaching the same device more than once

2014-11-17 Thread Li, Liang Z
> > The libxl__device_exists will return 1 if more than one PCI devices are > > attached to the guest, no matter the BDFs are identical or not. > > That means this check is problematic. I think the original intention was to > check on BDFs, however it wasn't thoroughly tested. Sorry. > > > I don'

Re: [Xen-devel] [PATCH v3 07/15] libxl: disallow attaching the same device more than once

2014-11-17 Thread Wei Liu
On Mon, Nov 17, 2014 at 07:53:44AM +, Li, Liang Z wrote: > > Originally the code allowed users to attach the same device more than > > once. It just stupidly overwrites xenstore entries. This is bogus as > > frontend will be very confused. > > > > Introduce a helper function to check if the dev

Re: [Xen-devel] [PATCH v3 07/15] libxl: disallow attaching the same device more than once

2014-11-16 Thread Li, Liang Z
> Originally the code allowed users to attach the same device more than > once. It just stupidly overwrites xenstore entries. This is bogus as > frontend will be very confused. > > Introduce a helper function to check if the device to be written to > xenstore already exists. A new error code is als