Received: from eggs.gnu.org ([2001:4830:134:3::10]:44276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baUeV-0005XB-6J for qemu-devel@nongnu.org; Thu, 18 Aug 2016 17:15:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1baUeQ-00045H-SW for qemu-devel@nongnu.org; Thu, 18 Aug 2016 17:15:02 -0400 Received: from mail.gbdj.ru ([87.237.113.216]:43020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baUeQ-0003uq-K9 for qemu-devel@nongnu.org; Thu, 18 Aug 2016 17:14:58 -0400 Date: Fri, 19 Aug 2016 01:13:17 +0400 From: Anton Worshevsky Message-ID: <20160819011317.6520f195@beer.gbdj.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] net/tap: Add qemu_name to ifup/ifdown callback script parameters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jason Wang Add additional parameter to network configuration callback script calls in launch_script(). External script can provide any exotic network configuration for VM instance based on qemu_name as new param. It's convenient to have only one ifup script without tricks with symlinks to it for each VM instance on large VDS hosts. Signed-off-by: Anton Worshevsky --- net/tap.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/net/tap.c b/net/tap.c index 6abb962..64a31fe 100644 --- a/net/tap.c +++ b/net/tap.c @@ -421,6 +421,9 @@ static void launch_script(const char *setup_script, const char *ifname, parg = args; *parg++ = (char *)setup_script; *parg++ = (char *)ifname; + if (qemu_name) { + *parg++ = (char *)qemu_name; + } *parg = NULL; execv(setup_script, args); _exit(1); -- 1.7.4.4