From patchwork Thu Jun 13 13:07:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1115106 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Pmcq44w5z9s9y for ; Fri, 14 Jun 2019 00:40:43 +1000 (AEST) Received: from localhost ([::1]:40482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbQu9-000499-LA for incoming@patchwork.ozlabs.org; Thu, 13 Jun 2019 10:40:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46277) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbPSH-0003XT-EI for qemu-devel@nongnu.org; Thu, 13 Jun 2019 09:07:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbPSF-0006Go-UF for qemu-devel@nongnu.org; Thu, 13 Jun 2019 09:07:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31127) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbPSF-0006G0-J0 for qemu-devel@nongnu.org; Thu, 13 Jun 2019 09:07:47 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCEA580B3F; Thu, 13 Jun 2019 13:07:31 +0000 (UTC) Received: from dhcp-17-47.bos.redhat.com (dhcp-17-47.bos.redhat.com [10.18.17.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09C9F4128; Thu, 13 Jun 2019 13:07:29 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 13 Jun 2019 09:07:15 -0400 Message-Id: <20190613130718.3763-2-crosa@redhat.com> In-Reply-To: <20190613130718.3763-1-crosa@redhat.com> References: <20190613130718.3763-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 13 Jun 2019 13:07:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] tests/vm: avoid extra compressed image copy X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The image copy is only really needed because xz doesn't know to properly decompress a file not named properly. Instead of decompressing to stdout, and having to rely on a shell, let's just create a link instead of copying the file. Signed-off-by: Cleber Rosa --- tests/vm/centos | 4 ++-- tests/vm/freebsd | 4 ++-- tests/vm/netbsd | 4 ++-- tests/vm/openbsd | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/vm/centos b/tests/vm/centos index ba133ea429..466fa59fec 100755 --- a/tests/vm/centos +++ b/tests/vm/centos @@ -66,8 +66,8 @@ class CentosVM(basevm.BaseVM): cimg = self._download_with_cache("https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1802.qcow2.xz") img_tmp = img + ".tmp" sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["cp", "-f", cimg, img_tmp + ".xz"]) - subprocess.check_call(["xz", "-dvf", img_tmp + ".xz"]) + subprocess.check_call(["ln", "-f", cimg, img_tmp + ".xz"]) + subprocess.check_call(["xz", "--keep", "-dvf", img_tmp + ".xz"]) subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"]) self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()]) self.wait_ssh() diff --git a/tests/vm/freebsd b/tests/vm/freebsd index b0066017a6..5575c23a6f 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -34,8 +34,8 @@ class FreeBSDVM(basevm.BaseVM): img_tmp_xz = img + ".tmp.xz" img_tmp = img + ".tmp" sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["cp", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "-dvf", img_tmp_xz]) + subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) + subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) if os.path.exists(img): os.remove(img) os.rename(img_tmp, img) diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 4c6624ea5e..d0508f4465 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -34,8 +34,8 @@ class NetBSDVM(basevm.BaseVM): img_tmp_xz = img + ".tmp.xz" img_tmp = img + ".tmp" sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["cp", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "-dvf", img_tmp_xz]) + subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) + subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) if os.path.exists(img): os.remove(img) os.rename(img_tmp, img) diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 2105c01a26..87ec982489 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -36,8 +36,8 @@ class OpenBSDVM(basevm.BaseVM): img_tmp_xz = img + ".tmp.xz" img_tmp = img + ".tmp" sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["cp", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "-dvf", img_tmp_xz]) + subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) + subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) if os.path.exists(img): os.remove(img) os.rename(img_tmp, img)