mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
tests/vm: avoid extra compressed image copy
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> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190613130718.3763-2-crosa@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
parent
57dfc2c4d5
commit
676d1f3e2f
4 changed files with 8 additions and 8 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue