From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v2 5/5] libxl: add "downscript=no" to Qemu call Date: Wed, 18 Apr 2012 10:56:08 +0100 Message-ID: <1334742968.23948.181.camel@zakaz.uk.xensource.com> References: <1334677876-17704-1-git-send-email-roger.pau@citrix.com> <1334677876-17704-6-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: <1334677876-17704-6-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: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2012-04-17 at 16:51 +0100, Roger Pau Monne wrote: > Currently we only pass script=no to Qemu, to avoid calling any scripts when > attaching a tap interface, but we should also pass downscript=no to avoid Qemu > trying to execute a script when disconnecting the interface. This prevents the > following harmless error message: > > /etc/qemu-ifdown: could not launch network script > > Changes since v1: > > * Indentation fixes. > > Signed-off-by: Roger Pau Monne Acked-by: Ian Campbell > --- > tools/libxl/libxl_dm.c | 27 ++++++++++++++++++--------- > 1 files changed, 18 insertions(+), 9 deletions(-) > > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index 04f76c2..d9c1786 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -216,11 +216,18 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, > else > ifname = libxl__sprintf(gc, "xentap-%s", vifs[i].ifname); > flexarray_vappend(dm_args, > - "-net", libxl__sprintf(gc, "nic,vlan=%d,macaddr=%s,model=%s", > - vifs[i].devid, smac, vifs[i].model), > - "-net", libxl__sprintf(gc, "tap,vlan=%d,ifname=%s,bridge=%s,script=%s", > - vifs[i].devid, ifname, vifs[i].bridge, libxl_tapif_script(gc)), > - NULL); > + "-net", > + libxl__sprintf(gc, > + "nic,vlan=%d,macaddr=%s,model=%s", > + vifs[i].devid, smac, vifs[i].model), > + "-net", > + libxl__sprintf(gc, > + "tap,vlan=%d,ifname=%s,bridge=%s," > + "script=%s,downscript=%s", > + vifs[i].devid, ifname, vifs[i].bridge, > + libxl_tapif_script(gc), > + libxl_tapif_script(gc)), > + NULL); > ioemu_vifs++; > } > } > @@ -461,10 +468,12 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, > vifs[i].model, vifs[i].devid, > vifs[i].devid, smac)); > flexarray_append(dm_args, "-netdev"); > - flexarray_append(dm_args, > - libxl__sprintf(gc, "type=tap,id=net%d,ifname=%s,script=%s", > - vifs[i].devid, ifname, > - libxl_tapif_script(gc))); > + flexarray_append(dm_args, libxl__sprintf(gc, > + "type=tap,id=net%d,ifname=%s," > + "script=%s,downscript=%s", > + vifs[i].devid, ifname, > + libxl_tapif_script(gc), > + libxl_tapif_script(gc))); > ioemu_vifs++; > } > }