From: Ian Campbell Subject: Re: [PATCH V4 24/24] xl: update configuration when we unplug a device Date: Wed, 7 May 2014 11:20:29 +0100 Message-ID: <1399458029.3014.256.camel@kazak.uk.xensource.com> References: <1398949101-23320-1-git-send-email-wei.liu2@citrix.com> <1398949101-23320-25-git-send-email-wei.liu2@citrix.com> <1399391733.3014.191.camel@kazak.uk.xensource.com> <20140506161239.GV17067@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140506161239.GV17067@zion.uk.xensource.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: Wei Liu Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 2014-05-06 at 17:12 +0100, Wei Liu wrote: > > > + do { \ > > > + libxl_domain_config d_config; \ > > > + libxl_device_ ## devtype *p = NULL, *x; \ > > > + int num; \ > > > + int j, k; \ > > > + \ > > > + libxl_domain_config_init(&d_config); \ > > > + load_domain_config((domid), &d_config); \ > > > + \ > > > + k = 0; \ > > > + for (j = 0; j < d_config.cnt; j++) { \ > > > + x = d_config.ptr + j; \ > > > + if (compare(x, &(dev))) \ > > > > Are you concerned with the possibility that two entries in the array > > might match dev? Wouldn't that equate to e.g. two xvda devices? Should > > we not reject such things elsewhere? > > > > Yes. And it's not just concern, I've seen this already! > The current xl block-attach doesn't complain if you add same CD images > twice. Urk. That sounds like a bug, probably in libxl_device_disk_add rather than xl. Perhaps that is one yak too many for now though. Ian.