xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libxl: add "downscript=no" to Qemu call
@ 2012-05-10 12:19 Roger Pau Monne
  2012-05-10 12:19 ` [PATCH 2/2] libxl: fix indentation in libxl_dm.c for qemu Roger Pau Monne
  2012-05-10 16:34 ` [PATCH 1/2] libxl: add "downscript=no" to Qemu call Ian Jackson
  0 siblings, 2 replies; 3+ messages in thread
From: Roger Pau Monne @ 2012-05-10 12:19 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

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 v2:

 * Remove non related indentation changes.

Changes since v1:

 * Indentation fixes.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/libxl/libxl_dm.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index ff5f8ad..0d7524c 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -215,9 +215,14 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
                 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",
+                                  GCSPRINTF(
+                                      "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++;
             }
         }
@@ -455,10 +460,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, GCSPRINTF(
+                                          "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++;
             }
         }
-- 
1.7.7.5 (Apple Git-26)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] libxl: fix indentation in libxl_dm.c for qemu
  2012-05-10 12:19 [PATCH 1/2] libxl: add "downscript=no" to Qemu call Roger Pau Monne
@ 2012-05-10 12:19 ` Roger Pau Monne
  2012-05-10 16:34 ` [PATCH 1/2] libxl: add "downscript=no" to Qemu call Ian Jackson
  1 sibling, 0 replies; 3+ messages in thread
From: Roger Pau Monne @ 2012-05-10 12:19 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

Fixed indentation on Qemu argument construction for network devices.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/libxl/libxl_dm.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 0d7524c..c0d7ca1 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -213,8 +213,10 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
                                                 domid, vifs[i].devid,
                                                 LIBXL_NIC_TYPE_IOEMU);
                 flexarray_vappend(dm_args,
-                                "-net", libxl__sprintf(gc, "nic,vlan=%d,macaddr=%s,model=%s",
-                                                       vifs[i].devid, smac, vifs[i].model),
+                                  "-net",
+                                  GCSPRINTF(
+                                      "nic,vlan=%d,macaddr=%s,model=%s",
+                                      vifs[i].devid, smac, vifs[i].model),
                                   "-net",
                                   GCSPRINTF(
                                       "tap,vlan=%d,ifname=%s,bridge=%s,"
-- 
1.7.7.5 (Apple Git-26)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] libxl: add "downscript=no" to Qemu call
  2012-05-10 12:19 [PATCH 1/2] libxl: add "downscript=no" to Qemu call Roger Pau Monne
  2012-05-10 12:19 ` [PATCH 2/2] libxl: fix indentation in libxl_dm.c for qemu Roger Pau Monne
@ 2012-05-10 16:34 ` Ian Jackson
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Jackson @ 2012-05-10 16:34 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[Xen-devel] [PATCH 1/2] libxl: add "downscript=no" to Qemu call"):
> 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:

Acked and applied both, thanks.

Ian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-10 16:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-10 12:19 [PATCH 1/2] libxl: add "downscript=no" to Qemu call Roger Pau Monne
2012-05-10 12:19 ` [PATCH 2/2] libxl: fix indentation in libxl_dm.c for qemu Roger Pau Monne
2012-05-10 16:34 ` [PATCH 1/2] libxl: add "downscript=no" to Qemu call Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).