From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: [PATCH v2 13/15] libxl: call hotplug scripts for nic devices from libxl Date: Wed, 23 May 2012 16:14:39 +0100 Message-ID: <4FBCFEDF.3040706@citrix.com> References: <1337695365-5142-1-git-send-email-roger.pau@citrix.com> <1337695365-5142-14-git-send-email-roger.pau@citrix.com> <20411.53450.122270.834784@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20411.53450.122270.834784@mariner.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: Ian Jackson Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Jackson wrote: >> + !aodev->vif_executed) { >> + aodev->vif_executed = 1; >> + device_hotplug(egc, aodev); >> + return; >> + } > > This logic surrounding vif_executed is rather opaque. Are you trying > to run this whole lot twice so that you can run two lots of scripts ? > > If so then perhaps the hotplug helper should simply take a counter, so > that we don't expose this vif abstraction thing ? And it would be > applicable to everything, not just vifs. Yes, it's kind of a counter, but first and second calls have different arguments/env. The fact is that from my point of view they should be two different devices (vif and tap), but that will require major changes in libxl. I could change vif_executed to something like exec_num, but it won't make much sense anyway I think, and we will have to pass it to the hotplug helper the same way we are passing vif_executed.