From patchwork Tue Oct 31 13:51:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10034581 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 F3F06602B9 for ; Tue, 31 Oct 2017 13:54:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E846F28AE2 for ; Tue, 31 Oct 2017 13:54:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6EE928AF2; Tue, 31 Oct 2017 13:54:59 +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 6939D28AE2 for ; Tue, 31 Oct 2017 13:54:58 +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 1e9Wxk-00025d-Jp; Tue, 31 Oct 2017 13:52:16 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9Wxi-00025C-K9 for xen-devel@lists.xenproject.org; Tue, 31 Oct 2017 13:52:14 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id D0/AC-15886-D0088F95; Tue, 31 Oct 2017 13:52:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsXitHSDvS5nw49 Ig9ezmC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1owFX+ewFzxkr5h9+R1LA+NNti5GTg4JAX+J T39XgdlsAsoSPzt7wWwRAT2JpgPPGUFsZgE7ieZHH1hAbGGBNIm73x4xg9gsAqoSt1etZwWxe QUsJBrbf7BDzJSX2NV2ESzOKWApsf5pE1hcCKjm3rLvjBC2gkTH9GNMEL2CEidnPmGB2CUhcf DFC+YJjLyzkKRmIUktYGRaxahenFpUllqka6iXVJSZnlGSm5iZo2toYKyXm1pcnJiempOYVKy XnJ+7iREYOgxAsINx+UenQ4ySHExKorw7Hb9HCvEl5adUZiQWZ8QXleakFh9ilOHgUJLg9ar/ ESkkWJSanlqRlpkDDGKYtAQHj5IIryxImre4IDG3ODMdInWK0ZLjxsPrf5g4Om7eBZLPZr5uY BZiycvPS5US560EaRAAacgozYMbB4u0S4yyUsK8jEAHCvEUpBblZpagyr9iFOdgVBLmFQeZwp OZVwK39RXQQUxAB3lJgB1UkoiQkmpgVDgvGzbR5LUMyw6RrDKWU3Wvg66XHnH6sW3yF+9Hu6V lvZq1XoedzJui+jPJrya+fmF9hEz7HROhe8dv886q9NrsWRC2dRfDbI3NRmsWVkycF19UNm35 StdE6/ydm2QrZmZburdwmGj9ZI+drLRa80HZmqJFbnOCVsY9XNsasWjaM72vJ8v1lViKMxINt ZiLihMB/CoeHq8CAAA= X-Env-Sender: prvs=470789eaf=wei.liu2@citrix.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1509457927!105234389!1 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: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1762 invoked from network); 31 Oct 2017 13:52:08 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 31 Oct 2017 13:52:08 -0000 X-IronPort-AV: E=Sophos;i="5.44,324,1505779200"; d="scan'208";a="457035228" From: Wei Liu To: Xen-devel Date: Tue, 31 Oct 2017 13:51:52 +0000 Message-ID: <20171031135203.11537-9-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171031135203.11537-1-wei.liu2@citrix.com> References: <20171031135203.11537-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: ian.jackson@eu.citrix.com, Wei Liu Subject: [Xen-devel] [OSSTEST PATCH v2 08/19] ts-guests-nbd-mirror: use target_{get, put}file_root to transfter cfg 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 The original code used target_cmd_output_root which caused a trailing new line to be deleted, which caused libvirt converter to fail. It wasn't discovered until now because we appended too many "\n". Use target_{get,put}file_root to do the job. Signed-off-by: Wei Liu --- ts-guests-nbd-mirror | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ts-guests-nbd-mirror b/ts-guests-nbd-mirror index ca8300d..3032204 100755 --- a/ts-guests-nbd-mirror +++ b/ts-guests-nbd-mirror @@ -115,8 +115,11 @@ sub shuffleconfigs () { my $gn= $gns[$i]; my $gho= $ghos[$i]; my $cfgpath= $r{ "$gho->{Guest}_cfgpath" }; - my $cfgdata= target_cmd_output_root($sho,"cat $cfgpath"); - target_putfilecontents_root_stash($cho,10,$cfgdata,$cfgpath); + my $file= $cfgpath; + $file=~ s,/,-,g; + $file= "$stash/".hostnamepath($cho)."--$file"; + target_getfile_root($sho, 60, $cfgpath, $file); + target_putfile_root($cho, 60, $file, $cfgpath); } }