All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Cleber Rosa" <crosa@redhat.com>
Subject: [Qemu-devel] [PATCH v1 01/17] tests/vm: avoid extra compressed image copy
Date: Wed, 19 Jun 2019 20:40:05 +0100	[thread overview]
Message-ID: <20190619194021.8240-2-alex.bennee@linaro.org> (raw)
In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org>

From: Cleber Rosa <crosa@redhat.com>

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 <crosa@redhat.com>
Message-Id: <20190613130718.3763-2-crosa@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 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 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)
-- 
2.20.1



  reply	other threads:[~2019-06-19 19:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 19:40 [Qemu-devel] [PATCH v1 00/17] testing/next (Travis fixes, more tests/vm) Alex Bennée
2019-06-19 19:40 ` Alex Bennée [this message]
2019-06-20 11:07   ` [Qemu-devel] [PATCH v1 01/17] tests/vm: avoid extra compressed image copy Philippe Mathieu-Daudé
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 02/17] tests/vm: avoid image presence check and removal Alex Bennée
2019-06-20 10:29   ` Philippe Mathieu-Daudé
2019-06-20 11:07     ` Philippe Mathieu-Daudé
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 03/17] tests/vm: pin ubuntu.i386 image Alex Bennée
2019-06-20 10:31   ` Philippe Mathieu-Daudé
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 04/17] tests/vm: add source repos on ubuntu.i386 Alex Bennée
2019-06-20 11:06   ` Philippe Mathieu-Daudé
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 05/17] tests/vm: send proxy environment variables over ssh Alex Bennée
2019-06-20 10:38   ` Philippe Mathieu-Daudé
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 06/17] tests/vm: use ssh with pty unconditionally Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 07/17] tests/vm: run test builds on snapshot Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 08/17] tests/vm: proper guest shutdown Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 09/17] tests/vm: add vm-boot-{ssh, serial}-<guest> targets Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 10/17] tests/vm: serial console support helpers Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 11/17] tests/vm: openbsd autoinstall, using serial console Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 12/17] tests/vm: freebsd " Alex Bennée
2019-06-20 10:39   ` Philippe Mathieu-Daudé
2019-06-20 11:01     ` Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 13/17] tests/vm: netbsd " Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 14/17] tests/vm: fedora " Alex Bennée
2019-06-20 10:36   ` Philippe Mathieu-Daudé
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 15/17] tests/vm: ubuntu.i386: apt proxy setup Alex Bennée
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 16/17] .travis.yml: default the --disable-system build to --static Alex Bennée
2019-06-20 10:37   ` Philippe Mathieu-Daudé
2019-06-19 19:40 ` [Qemu-devel] [PATCH v1 17/17] .travis.yml: force a brew update for MacOS builds Alex Bennée
2019-06-20 10:37   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190619194021.8240-2-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=crosa@redhat.com \
    --cc=fam@euphon.net \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.