From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= Subject: Re: [PATCH 1/2] xl/libxl: add netdev to vif specification Date: Tue, 5 Feb 2013 12:39:12 +0100 Message-ID: <5110EF60.8010207@citrix.com> References: <1359127583-32490-1-git-send-email-roger.pau@citrix.com> <1359127583-32490-2-git-send-email-roger.pau@citrix.com> <1360060806.17017.25.camel@zakaz.uk.xensource.com> <5110E563.8030604@citrix.com> <1360062659.17017.43.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1360062659.17017.43.camel@zakaz.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 Campbell Cc: Ulf Kreutzberg , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 05/02/13 12:10, Ian Campbell wrote: > On Tue, 2013-02-05 at 10:56 +0000, Roger Pau Monne wrote: >>>> @@ -98,6 +103,8 @@ static char **get_hotplug_env(libxl__gc *gc, >>>> env[nr++] = GCSPRINTF("backend/%s/%u/%d", type, dev->domid, dev->devid); >>>> env[nr++] = "XENBUS_BASE_PATH"; >>>> env[nr++] = "backend"; >>>> + env[nr++] = "netdev"; >>>> + env[nr++] = netdev; >>> >>> Mightn't this be NULL? >> >> Yes, if we are using the vif-bridge script this will be NULL, but I >> prefer adding this NULL here rather than having a conditional and a >> variable array size (because we also have an assert(nr == arraysize) at >> the end of the code block). > > Doesn't NULL terminate the env list? That might work right now while > this option is last but it will confuse the hell out of whoever adds the > next variable... Indeed, good catch. Also we are enforcing this (not passing NULL values in env variables) in libxl__exec. > env[nr++] = netdev ? : "" might suffice? Yes. > Ian. >