From patchwork Mon Jun 6 10:52:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9157839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 95F0C60467 for ; Mon, 6 Jun 2016 10:54:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 867502665D for ; Mon, 6 Jun 2016 10:54:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ADBF26E82; Mon, 6 Jun 2016 10:54:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C5D22665D for ; Mon, 6 Jun 2016 10:54:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9s9X-0004m7-CA; Mon, 06 Jun 2016 10:53:03 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9s9W-0004lc-Mt for xen-devel@lists.xenproject.org; Mon, 06 Jun 2016 10:53:02 +0000 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id D7/61-02817-E0655575; Mon, 06 Jun 2016 10:53:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHSDvS5vWGi 4wd6Luhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bpiXdYC9ZwVPQ9e8vWwHiXtYuRg0NCwF9i 3m/NLkZODjYBZYmfnb1sILaIgJ5E04HnjCA2s4CXxI8VPewgtrBAmMSGA21gNSwCKhI3unqZQ GxeAWeJdwf3gdkSAnIS54//ZAaxOQVcJN5t28EKYgsB1XzofsICYStIdEw/BtUrKHFyJkScWU BC4uCLF8wQc7glbp+eyjyBkW8WkrJZSMoWMDKtYtQoTi0qSy3SNTTXSyrKTM8oyU3MzNE1NDT Ry00tLk5MT81JTCrWS87P3cQIDKl6BgbGHYw/T3seYpTkYFIS5ZX9GhIuxJeUn1KZkVicEV9U mpNafIhRhoNDSYJXPzQ0XEiwKDU9tSItMwcY3DBpCQ4eJRHeDJA0b3FBYm5xZjpE6hSjopQ4r yhIQgAkkVGaB9cGi6hLjLJSwryMDAwMQjwFqUW5mSWo8q8YxTkYlYR5n4cATeHJzCuBm/4KaD ET0OJl14JBFpckIqSkGhjT181SP8Vd23TijueXM7I8WUmHZDTjbyQX28w+vMuFZ8ZU43qd40Y nk0556n6Y1m+zSX/63w1hK4xYdu7/f2vm/NlhLdISS2vnP5ux8Jub4Rdeh5Be16k+t64e2vpn Xob99QNfhDjz/a+94pnKs/OfQv3GvcIlSbJhsv8/ufXXlKz2Wl3lM/GgEktxRqKhFnNRcSIAM uQ+H6MCAAA= X-Env-Sender: prvs=9584f9c1d=wei.liu2@citrix.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1465210376!45691042!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9683 invoked from network); 6 Jun 2016 10:53:01 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 6 Jun 2016 10:53:01 -0000 X-IronPort-AV: E=Sophos;i="5.26,426,1459814400"; d="scan'208";a="365458268" From: Wei Liu To: Xen-devel Date: Mon, 6 Jun 2016 11:52:10 +0100 Message-ID: <1465210332-25440-5-git-send-email-wei.liu2@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465210332-25440-1-git-send-email-wei.liu2@citrix.com> References: <1465210332-25440-1-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Wei Liu , Ian Jackson Subject: [Xen-devel] [PATCH 4/6] libxl: debug output for args and env when invoking hotplug script X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Wei Liu --- tools/libxl/libxl_device.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index 4717027..b922a94 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -1167,6 +1167,31 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev) } LOG(DEBUG, "calling hotplug script: %s %s", args[0], args[1]); + LOG(DEBUG, "extra args:"); + { + const char *arg; + unsigned int x = 2; + + arg = args[x]; + while (arg) { + LOG(DEBUG, "\t%s", arg); + x++; + arg = args[x]; + } + } + LOG(DEBUG, "env:"); + { + const char *k, *v; + unsigned int x = 0; + + k = env[x]; + while (k) { + v = env[x+1]; + LOG(DEBUG, "\t%s: %s", k, v); + x += 2; + k = env[x]; + } + } nullfd = open("/dev/null", O_RDONLY); if (nullfd < 0) {