From: Ian Campbell Subject: Re: [PATCH v10 16/19] libxl: call hotplug scripts for nic devices from libxl Date: Fri, 20 Jul 2012 17:01:27 +0100 Message-ID: <1342800087.26734.140.camel@zakaz.uk.xensource.com> References: <1342793548-10239-1-git-send-email-roger.pau@citrix.com> <1342793548-10239-17-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1342793548-10239-17-git-send-email-roger.pau@citrix.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: Roger Pau Monne Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org > + switch (nictype) { > + case LIBXL_NIC_TYPE_VIF_IOEMU: > + env[nr++] = "INTERFACE"; > + env[nr++] = libxl__strdup(gc, libxl__device_nic_devname(gc, > + dev->domid, dev->devid, > + LIBXL_NIC_TYPE_VIF_IOEMU)); Is this fall-through of the case deliberate? If so then a comment would be good. However I'm not sure about this. It seems like the hotplug scripts are only called once in the VIF_IOEMU case? I would expect one call for the PV VIF device and one for the TAP device? Perhaps I'm just missing the location of the other one? Is this "num_exec" variable involved in some way? But you don't propagate that to get_hotplug_env() and therefore include *both* sets of env vars? In any case something related seems to be broken for guests which use a stub domain and use vifname=foo. What I see in that case is the script called three times... 1. For the PV interface of the stub domain (LIBXL_NIC_TYPE_VIF), renames vifX+1.0 -> foo-emu (*) 2. For the PV interface of the real domain (LIBXL_NIC_TYPE_VIF_IOEMU part 1), renames vifX.0 -> foo 3. For the emu interface of the real domain (LIBXL_NIC_TYPE_VIF_IOEMU part 2) renames vifX.0 -> foo-emu The rename in #3 fails, because foo-emu already exists. But in fact this call to the script should never happen for a domain with a stub domain since the emulated device in this case is within the stub domain, not the driver domain. (*) This is with the patch I posted earlier to rename the stub domain's vif with a -emu suffix. Without that then the clash is at #2 instead. Ian.