From patchwork Mon Jun 24 13:43:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 167578 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4257885ilk; Mon, 24 Jun 2019 06:51:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqys29a/Y95hVcTGQCzkloefhzuJ1oHA5NJW2sGqHqkDtWCiKNY5cJUdhrwjatbxaSTB4AQN X-Received: by 2002:a17:906:3953:: with SMTP id g19mr13334559eje.242.1561384280678; Mon, 24 Jun 2019 06:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384280; cv=none; d=google.com; s=arc-20160816; b=ZkpLzNizpyEDibz4WxBiJBVDFXfagEn0S/plVGipaJ5PcV5IlDBYAD6a225pTHCIKW rbrKvt/CiiL5Vu54V9W0oXSz5vDxOxMtj+zEGddhGXrd4WQfMpH2n/Db0n7oD7e4LAhi 4WtIwhCQNDMm6AVo4ZiqyOCHg8EEhonV71Qtrm13x8SQHB7/75fXHuEwUcEBWZKzDNWk AT02rUbD1BXAUARCrJml+6TAm4GOEEsWkJcOJwR4OigbjirUxXqr0OSF8e3Wx85XVX6g llguIQL+f2+d5DqSdzBOyUDb3Ee8Ttcxh/xS4e78hqW7rsyZsdaVyMQboCc4OTjIFlkx uR+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=kG7TibQlzrXHGeVA/kaiY4pLQv/EwI9FVJyG9q9KK+o=; b=LTNUFAtQIvGDHXrJNFWnj1X6Kwv5XbplFIdfaPlAbnxyMxCdFVyH0XA70ycdiv8O6u Ft3UCoeiIQBisCyi8G9jyC6HAq6osVf853ibAcsJT238CTJ80yduauCiC5NvTuQdGMb2 fpvgq6t2Ir32M46RgiVzCY1wXdJrlh1QzDkazcpzHscfWQCNaWlWCSh+soWZX0BEgqfe Td5r+l+yXBPb6Adv5z3YRQwHlsgAbXOVz64kQg8KAN/pgE9zQc4UMaWecOCl0+enQNBn gKQApGNTzZ+vG2w0mtZmXHbzm0lbCj/bhWTPRC88VuQeF+uBw8LhhwU8UQHcqRSmgUQv r9lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kanAamLU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q13si6641915ejr.163.2019.06.24.06.51.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kanAamLU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPNP-0002UJ-Kk for patch@linaro.org; Mon, 24 Jun 2019 09:51:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41479) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGG-0006fm-Cs for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGE-0007d2-E5 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:54118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGC-0007J7-Gu for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:53 -0400 Received: by mail-wm1-x32f.google.com with SMTP id x15so12848967wmj.3 for ; Mon, 24 Jun 2019 06:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kG7TibQlzrXHGeVA/kaiY4pLQv/EwI9FVJyG9q9KK+o=; b=kanAamLUH/KjSYgigeWC3w9zqYxCkDdbhY35YtMRFvB0f5IBXMFZUL2lHxoZMMazOl WboT7gNPfYZ1b5hti25DJpDeo+yaUUHycyALVTzge2nlcpLtlZKbPaNH41fIM8kAPD32 kqhDll7XDffw+UsqOWzCBGQDcCyCgi2RBtU6B+PVRjqTkJfFEXIkcoTMw48yOkyRMssM K20bzQjiF8dDouI43hs4NierTMU317YxQ7jwtIMNO5pm9gSLsJwEOBxd4/YoQLWBHwVM S3GBshIAexk5DEShMhpe1TG7W2cflKBqCzdsriORPyFWBYYn5A/bBsviP0+dwz8Z4ghQ JduA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kG7TibQlzrXHGeVA/kaiY4pLQv/EwI9FVJyG9q9KK+o=; b=QJLiQaDMVyvDBU3WArIjvQC4ZCaVP2IOWzyo+MiQSxkPwoN6n6TTesDP3qr1rptqfx q2G2t2/ON9G44SKJLAHe1nTAk+NZ/of2FmlCL+QGlsSQmz+Y4ZQgbhzrM+8sPoNokffd TcvVFXhkp6DKUaElcYcNiH7MzLmyckSaHv74QDCIfJ5ipG+nz3Nxei6RZj7urwJgu9PQ BWpSBhwy5b3xMp9VYBzRmcFnd5uT2AexhJR07KCxmn5gzKWw88Xix3K3lvMUxMdoOd5V CBuT+SYtQ56gRhKT/u7GimAo7c1CzAzeWNzTANd7V8U3XtikRywrVMlMKhcZQsme0opW aohQ== X-Gm-Message-State: APjAAAVy0N6/IqOLSJrbB/AjE2+p2Km5WFgh0YQvphq/Cy9BWzIU7pIy 7NGmWAqEnAdRPTHS7L/z1b++xfRffvM= X-Received: by 2002:a1c:e356:: with SMTP id a83mr16695414wmh.38.1561383818949; Mon, 24 Jun 2019 06:43:38 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l16sm10803321wrw.42.2019.06.24.06.43.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:37 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8F2A61FF8C; Mon, 24 Jun 2019 14:43:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:19 +0100 Message-Id: <20190624134337.10532-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f Subject: [Qemu-devel] [PULL 01/19] 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Cleber Rosa Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa 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 Tested-by: Philippe Mathieu-Daudé Message-Id: <20190613130718.3763-2-crosa@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/vm/centos b/tests/vm/centos index 7417b50af4..b00b46a8dc 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)