From: Ian Campbell Subject: Re: [PATCH 2/2] tools/hotplug, Use udev rules instead of qemu script to setup the bridge. Date: Tue, 10 Aug 2010 11:52:39 +0100 Message-ID: <1281437559.24292.3891.camel@zakaz.uk.xensource.com> References: <1280938265-12107-1-git-send-email-anthony.perard@citrix.com> <1280938265-12107-3-git-send-email-anthony.perard@citrix.com> <4C5C2EF8.1000309@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C5C2EF8.1000309@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony PERARD Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 2010-08-06 at 16:49 +0100, Anthony PERARD wrote: > > > Can we limit the amount of "if" introduced by this patch somehow? > > If we use a different command (add instead of online), why do we > need > > the "if" under the online and offline cases? > > If add is only used with tap devices, why do we need an if under > add? > > The command come directly from the $ACTION in udev, and for some > reason, this event is different in both cases. Here, I just check if > we really want to setup a vif or a tap. This is too much? It could be that just handling one of online or add would be sufficient. I don't really remember but when I made the patch for XCP which you are basing this patch on I may just have been trying to avoid a large change in behaviour and/or other knockon effects. It's equally possible that one or the other type of device actually generates both types of event or that I was being overly/unnecessarily conservative. I think I'd recommend confirming the actual behaviour WRT event names of both vif and tap devices on a few "important/interesting" kernel versions before removing the extra if statements. I wonder if we should be looking to begin transitioning the hotplug events generated by netback to be consistent with those generated by other network devices? (assuming there is consistency in general and the the tun/tap driver is the correct one in this case) Ian