From patchwork Tue Aug 1 14:19:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Liang X-Patchwork-Id: 9874749 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 EA01E60361 for ; Tue, 1 Aug 2017 14:22:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9D1E228C9 for ; Tue, 1 Aug 2017 14:22:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE67728695; Tue, 1 Aug 2017 14:22:05 +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,HTML_MESSAGE, 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 C4B242864F for ; Tue, 1 Aug 2017 14:22:04 +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 1dcY1S-0006H7-Nu; Tue, 01 Aug 2017 14:19:46 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcY1R-0006H1-Nf for xen-devel@lists.xen.org; Tue, 01 Aug 2017 14:19:45 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 01/7C-03937-10E80895; Tue, 01 Aug 2017 14:19:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFKsWRWlGSWpSXmKPExsVysWW7jC5DX0O kwbK5PBZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bfOTEFS9Urfja+ZmxgvCbfxcjFISQwh0li 7+825i5GTg4WAQeJOctPM4HYjAJlEt1tu5gh7ByJb9Ofs4HYQgJrGCX+7y8BsdkEVCUWLfvGC GILCyRKTNzZzw5iiwh4S5x7fAisl1fAVmLy7m52iPkqEpfXPwCLiwqES+z/fg2qRlDi5MwnLC A2s4C/xIrtG5kgbHGJW0/mg9kSAtoSl4+2M4EcLSHQxyixq+ki+wRGgVlI+mch6Z+FpH8WIwe QHSpxagYnRNhMYt7mh8wQtrzE9rdzmCFK1CSWtSrBhJu3zoYKJ0vMuOiAqhrErpN4eH0l8wJG 7lWM6sWpRWWpRbqWeklFmekZJbmJmTm6hgZmermpxcWJ6ak5iUnFesn5uZsYgXHFAAQ7GO9uC jjEKMnBpCTKq9hTHynEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgndhT0OkkGBRanpqRVpmDjDCYd ISHDxKIrxqIGne4oLE3OLMdIjUKUZLjg2r139h4jj0+8R3Jo5jIFKIJS8/L1VKnHdrN1CDAEh DRmke3DhYErrEKCslzMsIdKAQT0FqUW5mCar8K0ZxDkYlYV4mkLU8mXklcFtfAR3EBHSQZGkt yEEliQgpqQbG2A1vTJvPNgh4KazcaMT1pJBhyeaJ6fesnu1ZzDLxPM9p0a+Pz4XH7Vh1ZWWvL o/rxI2tfOlR6x29P/DFuErPsWGzffK46d1v7sf7t5jlvLp/QvdZlepuq8J792S51HXOPXp0vY Vrq8AT29gV3Q8fnkldtPvW4tinffMvHNi+2+ig2J0oW3GhP0osxRmJhlrMRcWJAObcF2I9AwA A X-Env-Sender: xiliang@redhat.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1501597182!109953241!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44490 invoked from network); 1 Aug 2017 14:19:43 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 1 Aug 2017 14:19:43 -0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0617A186873; Tue, 1 Aug 2017 14:19:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0617A186873 Received: from [10.72.12.90] (ovpn-12-90.pek2.redhat.com [10.72.12.90]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88D9F6D29D; Tue, 1 Aug 2017 14:19:39 +0000 (UTC) From: Xiao Liang To: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, xen-devel@lists.xen.org Message-ID: Date: Tue, 1 Aug 2017 22:19:35 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 01 Aug 2017 14:19:42 +0000 (UTC) Subject: [Xen-devel] [PATCH]tools: updated "xl_info.c" to accept "--clear" as parameter following "xl dmesg" 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 Hello, Today I found a minor problem that "xl dmesg --clear" failed to clear Xen's message buffer. From manual page, it should accept "-c" or "--clear". I proposed a fix and please help review. I also attached the path in the mail in case mail client format problem. Thanks Fail log: # xl dmesg --clear option `' not supported. Author: xiliang Date: Tue Aug 1 17:33:02 2017 +0800 tools: updated "xl_info.c" to accept "--clear" as parameter following "xl dmesg" In xl man page, adding "-c" or "--clear" following "xl dmesg" can clear Xen's message buffer. It works in old "xm", so added support to xl. Signed-off-by: xiliang Thanks, Xiao Liang From 85c4bb378cb456fba96bbe6cdc8734f493daeb0c Mon Sep 17 00:00:00 2001 From: xiliang Date: Tue, 1 Aug 2017 17:33:02 +0800 Subject: [PATCH] tools: updated "xl_info.c" to accept "--clear" as parameter following "xl dmesg" In xl man page, adding "-c" or "--clear" following "xl dmesg" can clear Xen's message buffer. It works in old "xm", so added support to xl. Signed-off-by: xiliang --- tools/xl/xl_info.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c index 94bd1fd9ab..d6f723b4ad 100644 --- a/tools/xl/xl_info.c +++ b/tools/xl/xl_info.c @@ -884,8 +884,11 @@ int main_dmesg(int argc, char **argv) libxl_xen_console_reader *cr; char *line; int opt, ret = 1; + static struct option opts[] = { + {"clear", 0, 0, 'c'} + }; - SWITCH_FOREACH_OPT(opt, "c", NULL, "dmesg", 0) { + SWITCH_FOREACH_OPT(opt, "c", opts, "dmesg", 0) { case 'c': clear = 1; break; -- 2.13.3