QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/1] tests/vm: Allow to set path to qemu-img
@ 2019-11-14 13:42 Wainer dos Santos Moschetta
  2019-11-14 13:42 ` [PATCH 1/1] tests/vm: Allow to set qemu-img path Wainer dos Santos Moschetta
  0 siblings, 1 reply; 4+ messages in thread
From: Wainer dos Santos Moschetta @ 2019-11-14 13:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: fam, philmd, alex.bennee

Usually I build QEMU in a system which doesn't have any qemu
package installed. When I need to `make vm-build-something`
it fails due system-qemu-<arch> and qemu-img not found
system-wide (and I want to use the built binaries). The
formed can be set with QEMU env var, but the later can't. So
this patch allows to set the path to qemu-img using yet another
env var.

Git:
 - Tree: https://github.com/wainersm/qemu
 - Branch: https://github.com/wainersm/qemu/tree/test_vm_qemu-img

Travis:
  - (FAIL) https://travis-ci.org/wainersm/qemu/builds/611563267
    Two build jobs reached timeout. Not related with this change though.

Bug found: I realized that when I export QEMU it is always overwritten
           with <BUILD>/qemu/xtensa-linux-user/qemu-xtensa
           See the error below.
---
[root@localhost qemu]# export QEMU_IMG=$PWD/qemu-img
[root@localhost qemu]# export QEMU=$PWD/x86_64-softmmu/qemu-system-x86_64
[root@localhost qemu]# make vm-build-fedora
    VM-IMAGE fedora 
### Downloading install iso ...
### Preparing iso and disk image ...
Formatting '/root/.cache/qemu-vm/images/fedora.img.tmp', fmt=qcow2 size=21474836480 cluster_size=65536 lazy_refcounts=off refcount_bits=16
### Booting installer ...
ERROR:root:Failed to launch QEMU, command line:
ERROR:root:/root/build/qemu/xtensa-linux-user/qemu-xtensa -nodefaults -m 4G -cpu max -netdev user,id=vnet,hostfwd=:127.0.0.1:0-:22 -device virtio-net-pci,netdev=vnet -vnc 127.0.0.1:0,to=20 -smp 8 -enable-kvm -device VGA -drive file=/root/.cache/qemu-vm/images/fedora.img.tmp,if=none,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 -bios pc-bios/bios-256k.bin -machine graphics=off -cdrom /root/.cache/qemu-vm/images/fedora.img.install.iso
ERROR:root:Log:
ERROR:root:qemu: unknown option 'chardev'
---

Wainer dos Santos Moschetta (1):
  tests/vm: Allow to set qemu-img path

 docs/devel/testing.rst    | 6 ++++--
 tests/vm/Makefile.include | 1 +
 tests/vm/basevm.py        | 5 +++++
 tests/vm/centos           | 2 +-
 tests/vm/fedora           | 4 +---
 tests/vm/freebsd          | 3 +--
 tests/vm/netbsd           | 3 +--
 tests/vm/openbsd          | 3 +--
 tests/vm/ubuntu.i386      | 2 +-
 9 files changed, 16 insertions(+), 13 deletions(-)

-- 
2.18.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] tests/vm: Allow to set qemu-img path
  2019-11-14 13:42 [PATCH 0/1] tests/vm: Allow to set path to qemu-img Wainer dos Santos Moschetta
@ 2019-11-14 13:42 ` Wainer dos Santos Moschetta
  2019-12-03 11:35   ` Alex Bennée
  2019-12-03 16:17   ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 4+ messages in thread
From: Wainer dos Santos Moschetta @ 2019-11-14 13:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: fam, philmd, alex.bennee

By default VM build test use qemu-img from system's PATH to
create the image disk. Due the lack of qemu-img on the system
or the desire to simply use a version built with QEMU, it would
be nice to allow one to set its path. So this patch makes that
possible by reading the path to qemu-img from QEMU_IMG if set,
otherwise it fallback to default behavior.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
---
 docs/devel/testing.rst    | 6 ++++--
 tests/vm/Makefile.include | 1 +
 tests/vm/basevm.py        | 5 +++++
 tests/vm/centos           | 2 +-
 tests/vm/fedora           | 4 +---
 tests/vm/freebsd          | 3 +--
 tests/vm/netbsd           | 3 +--
 tests/vm/openbsd          | 3 +--
 tests/vm/ubuntu.i386      | 2 +-
 9 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 8e981e062d..9be6cd4410 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -418,13 +418,15 @@ access, so they SHOULD NOT be exposed to external interfaces if you are
 concerned about attackers taking control of the guest and potentially
 exploiting a QEMU security bug to compromise the host.
 
-QEMU binary
------------
+QEMU binaries
+-------------
 
 By default, qemu-system-x86_64 is searched in $PATH to run the guest. If there
 isn't one, or if it is older than 2.10, the test won't work. In this case,
 provide the QEMU binary in env var: ``QEMU=/path/to/qemu-2.10+``.
 
+Likewise the path to qemu-img can be set in QEMU_IMG environment variable.
+
 Make jobs
 ---------
 
diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index fea348e845..9e7c46a473 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -34,6 +34,7 @@ vm-help vm-test:
 	@echo "    DEBUG=1              	 - Enable verbose output on host and interactive debugging"
 	@echo "    V=1				 - Enable verbose ouput on host and guest commands"
 	@echo "    QEMU=/path/to/qemu		 - Change path to QEMU binary"
+	@echo "    QEMU_IMG=/path/to/qemu-img	 - Change path to qemu-img tool"
 
 vm-build-all: $(addprefix vm-build-, $(IMAGES))
 
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 91a9226026..d1efeb3646 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -152,6 +152,11 @@ class BaseVM(object):
     def build_image(self, img):
         raise NotImplementedError
 
+    def exec_qemu_img(self, *args):
+        cmd = [os.environ.get("QEMU_IMG", "qemu-img")]
+        cmd.extend(list(args))
+        subprocess.check_call(cmd)
+
     def add_source_dir(self, src_dir):
         name = "data-" + hashlib.sha1(src_dir.encode("utf-8")).hexdigest()[:5]
         tarfile = os.path.join(self._tmpdir, name + ".tar")
diff --git a/tests/vm/centos b/tests/vm/centos
index 53976f1c4c..eac07dacd6 100755
--- a/tests/vm/centos
+++ b/tests/vm/centos
@@ -68,7 +68,7 @@ class CentosVM(basevm.BaseVM):
         sys.stderr.write("Extracting the image...\n")
         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.exec_qemu_img("resize", img_tmp, "50G")
         self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
         self.wait_ssh()
         self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
diff --git a/tests/vm/fedora b/tests/vm/fedora
index 7fec1479fb..8e270fc0f0 100755
--- a/tests/vm/fedora
+++ b/tests/vm/fedora
@@ -74,9 +74,7 @@ class FedoraVM(basevm.BaseVM):
 
         self.print_step("Preparing iso and disk image")
         subprocess.check_call(["cp", "-f", cimg, iso])
-        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
-                               img_tmp, self.size])
-
+        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
         self.print_step("Booting installer")
         self.boot(img_tmp, extra_args = [
             "-bios", "pc-bios/bios-256k.bin",
diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index 2a19461a90..1825cc5821 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -82,8 +82,7 @@ class FreeBSDVM(basevm.BaseVM):
         self.print_step("Preparing iso and disk image")
         subprocess.check_call(["cp", "-f", cimg, iso_xz])
         subprocess.check_call(["xz", "-dvf", iso_xz])
-        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
-                               img_tmp, self.size])
+        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
 
         self.print_step("Booting installer")
         self.boot(img_tmp, extra_args = [
diff --git a/tests/vm/netbsd b/tests/vm/netbsd
index 611e6cc5b5..ec6f3563b2 100755
--- a/tests/vm/netbsd
+++ b/tests/vm/netbsd
@@ -77,8 +77,7 @@ class NetBSDVM(basevm.BaseVM):
 
         self.print_step("Preparing iso and disk image")
         subprocess.check_call(["ln", "-f", cimg, iso])
-        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
-                               img_tmp, self.size])
+        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
 
         self.print_step("Booting installer")
         self.boot(img_tmp, extra_args = [
diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index b92c39f89a..6df5162dbf 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -73,8 +73,7 @@ class OpenBSDVM(basevm.BaseVM):
 
         self.print_step("Preparing iso and disk image")
         subprocess.check_call(["cp", "-f", cimg, iso])
-        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
-                               img_tmp, self.size])
+        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
 
         self.print_step("Booting installer")
         self.boot(img_tmp, extra_args = [
diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
index 38f740eabf..39bbe9cc21 100755
--- a/tests/vm/ubuntu.i386
+++ b/tests/vm/ubuntu.i386
@@ -70,7 +70,7 @@ class UbuntuX86VM(basevm.BaseVM):
             sha256sum="e30091144c73483822b7c27193e9d47346dd1064229da577c3fedcf943f7cfcc")
         img_tmp = img + ".tmp"
         subprocess.check_call(["cp", "-f", cimg, img_tmp])
-        subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"])
+        self.exec_qemu_img("resize", img_tmp, "50G")
         self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
         self.wait_ssh()
         self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
-- 
2.18.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] tests/vm: Allow to set qemu-img path
  2019-11-14 13:42 ` [PATCH 1/1] tests/vm: Allow to set qemu-img path Wainer dos Santos Moschetta
@ 2019-12-03 11:35   ` Alex Bennée
  2019-12-03 16:17   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2019-12-03 11:35 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta; +Cc: fam, philmd, qemu-devel


Wainer dos Santos Moschetta <wainersm@redhat.com> writes:

> By default VM build test use qemu-img from system's PATH to
> create the image disk. Due the lack of qemu-img on the system
> or the desire to simply use a version built with QEMU, it would
> be nice to allow one to set its path. So this patch makes that
> possible by reading the path to qemu-img from QEMU_IMG if set,
> otherwise it fallback to default behavior.
>
> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

Queued to testing/next, thanks.

> ---
>  docs/devel/testing.rst    | 6 ++++--
>  tests/vm/Makefile.include | 1 +
>  tests/vm/basevm.py        | 5 +++++
>  tests/vm/centos           | 2 +-
>  tests/vm/fedora           | 4 +---
>  tests/vm/freebsd          | 3 +--
>  tests/vm/netbsd           | 3 +--
>  tests/vm/openbsd          | 3 +--
>  tests/vm/ubuntu.i386      | 2 +-
>  9 files changed, 16 insertions(+), 13 deletions(-)
>
> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
> index 8e981e062d..9be6cd4410 100644
> --- a/docs/devel/testing.rst
> +++ b/docs/devel/testing.rst
> @@ -418,13 +418,15 @@ access, so they SHOULD NOT be exposed to external interfaces if you are
>  concerned about attackers taking control of the guest and potentially
>  exploiting a QEMU security bug to compromise the host.
>  
> -QEMU binary
> ------------
> +QEMU binaries
> +-------------
>  
>  By default, qemu-system-x86_64 is searched in $PATH to run the guest. If there
>  isn't one, or if it is older than 2.10, the test won't work. In this case,
>  provide the QEMU binary in env var: ``QEMU=/path/to/qemu-2.10+``.
>  
> +Likewise the path to qemu-img can be set in QEMU_IMG environment variable.
> +
>  Make jobs
>  ---------
>  
> diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
> index fea348e845..9e7c46a473 100644
> --- a/tests/vm/Makefile.include
> +++ b/tests/vm/Makefile.include
> @@ -34,6 +34,7 @@ vm-help vm-test:
>  	@echo "    DEBUG=1              	 - Enable verbose output on host and interactive debugging"
>  	@echo "    V=1				 - Enable verbose ouput on host and guest commands"
>  	@echo "    QEMU=/path/to/qemu		 - Change path to QEMU binary"
> +	@echo "    QEMU_IMG=/path/to/qemu-img	 - Change path to qemu-img tool"
>  
>  vm-build-all: $(addprefix vm-build-, $(IMAGES))
>  
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index 91a9226026..d1efeb3646 100755
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -152,6 +152,11 @@ class BaseVM(object):
>      def build_image(self, img):
>          raise NotImplementedError
>  
> +    def exec_qemu_img(self, *args):
> +        cmd = [os.environ.get("QEMU_IMG", "qemu-img")]
> +        cmd.extend(list(args))
> +        subprocess.check_call(cmd)
> +
>      def add_source_dir(self, src_dir):
>          name = "data-" + hashlib.sha1(src_dir.encode("utf-8")).hexdigest()[:5]
>          tarfile = os.path.join(self._tmpdir, name + ".tar")
> diff --git a/tests/vm/centos b/tests/vm/centos
> index 53976f1c4c..eac07dacd6 100755
> --- a/tests/vm/centos
> +++ b/tests/vm/centos
> @@ -68,7 +68,7 @@ class CentosVM(basevm.BaseVM):
>          sys.stderr.write("Extracting the image...\n")
>          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.exec_qemu_img("resize", img_tmp, "50G")
>          self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
>          self.wait_ssh()
>          self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
> diff --git a/tests/vm/fedora b/tests/vm/fedora
> index 7fec1479fb..8e270fc0f0 100755
> --- a/tests/vm/fedora
> +++ b/tests/vm/fedora
> @@ -74,9 +74,7 @@ class FedoraVM(basevm.BaseVM):
>  
>          self.print_step("Preparing iso and disk image")
>          subprocess.check_call(["cp", "-f", cimg, iso])
> -        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
> -                               img_tmp, self.size])
> -
> +        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
>          self.print_step("Booting installer")
>          self.boot(img_tmp, extra_args = [
>              "-bios", "pc-bios/bios-256k.bin",
> diff --git a/tests/vm/freebsd b/tests/vm/freebsd
> index 2a19461a90..1825cc5821 100755
> --- a/tests/vm/freebsd
> +++ b/tests/vm/freebsd
> @@ -82,8 +82,7 @@ class FreeBSDVM(basevm.BaseVM):
>          self.print_step("Preparing iso and disk image")
>          subprocess.check_call(["cp", "-f", cimg, iso_xz])
>          subprocess.check_call(["xz", "-dvf", iso_xz])
> -        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
> -                               img_tmp, self.size])
> +        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
>  
>          self.print_step("Booting installer")
>          self.boot(img_tmp, extra_args = [
> diff --git a/tests/vm/netbsd b/tests/vm/netbsd
> index 611e6cc5b5..ec6f3563b2 100755
> --- a/tests/vm/netbsd
> +++ b/tests/vm/netbsd
> @@ -77,8 +77,7 @@ class NetBSDVM(basevm.BaseVM):
>  
>          self.print_step("Preparing iso and disk image")
>          subprocess.check_call(["ln", "-f", cimg, iso])
> -        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
> -                               img_tmp, self.size])
> +        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
>  
>          self.print_step("Booting installer")
>          self.boot(img_tmp, extra_args = [
> diff --git a/tests/vm/openbsd b/tests/vm/openbsd
> index b92c39f89a..6df5162dbf 100755
> --- a/tests/vm/openbsd
> +++ b/tests/vm/openbsd
> @@ -73,8 +73,7 @@ class OpenBSDVM(basevm.BaseVM):
>  
>          self.print_step("Preparing iso and disk image")
>          subprocess.check_call(["cp", "-f", cimg, iso])
> -        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
> -                               img_tmp, self.size])
> +        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
>  
>          self.print_step("Booting installer")
>          self.boot(img_tmp, extra_args = [
> diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
> index 38f740eabf..39bbe9cc21 100755
> --- a/tests/vm/ubuntu.i386
> +++ b/tests/vm/ubuntu.i386
> @@ -70,7 +70,7 @@ class UbuntuX86VM(basevm.BaseVM):
>              sha256sum="e30091144c73483822b7c27193e9d47346dd1064229da577c3fedcf943f7cfcc")
>          img_tmp = img + ".tmp"
>          subprocess.check_call(["cp", "-f", cimg, img_tmp])
> -        subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"])
> +        self.exec_qemu_img("resize", img_tmp, "50G")
>          self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
>          self.wait_ssh()
>          self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] tests/vm: Allow to set qemu-img path
  2019-11-14 13:42 ` [PATCH 1/1] tests/vm: Allow to set qemu-img path Wainer dos Santos Moschetta
  2019-12-03 11:35   ` Alex Bennée
@ 2019-12-03 16:17   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-03 16:17 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta, qemu-devel; +Cc: fam, alex.bennee

On 11/14/19 2:42 PM, Wainer dos Santos Moschetta wrote:
> By default VM build test use qemu-img from system's PATH to
> create the image disk. Due the lack of qemu-img on the system
> or the desire to simply use a version built with QEMU, it would
> be nice to allow one to set its path. So this patch makes that
> possible by reading the path to qemu-img from QEMU_IMG if set,
> otherwise it fallback to default behavior.
> 
> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   docs/devel/testing.rst    | 6 ++++--
>   tests/vm/Makefile.include | 1 +
>   tests/vm/basevm.py        | 5 +++++
>   tests/vm/centos           | 2 +-
>   tests/vm/fedora           | 4 +---
>   tests/vm/freebsd          | 3 +--
>   tests/vm/netbsd           | 3 +--
>   tests/vm/openbsd          | 3 +--
>   tests/vm/ubuntu.i386      | 2 +-
>   9 files changed, 16 insertions(+), 13 deletions(-)
> 
> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
> index 8e981e062d..9be6cd4410 100644
> --- a/docs/devel/testing.rst
> +++ b/docs/devel/testing.rst
> @@ -418,13 +418,15 @@ access, so they SHOULD NOT be exposed to external interfaces if you are
>   concerned about attackers taking control of the guest and potentially
>   exploiting a QEMU security bug to compromise the host.
>   
> -QEMU binary
> ------------
> +QEMU binaries
> +-------------
>   
>   By default, qemu-system-x86_64 is searched in $PATH to run the guest. If there
>   isn't one, or if it is older than 2.10, the test won't work. In this case,
>   provide the QEMU binary in env var: ``QEMU=/path/to/qemu-2.10+``.
>   
> +Likewise the path to qemu-img can be set in QEMU_IMG environment variable.
> +
>   Make jobs
>   ---------
>   
> diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
> index fea348e845..9e7c46a473 100644
> --- a/tests/vm/Makefile.include
> +++ b/tests/vm/Makefile.include
> @@ -34,6 +34,7 @@ vm-help vm-test:
>   	@echo "    DEBUG=1              	 - Enable verbose output on host and interactive debugging"
>   	@echo "    V=1				 - Enable verbose ouput on host and guest commands"
>   	@echo "    QEMU=/path/to/qemu		 - Change path to QEMU binary"
> +	@echo "    QEMU_IMG=/path/to/qemu-img	 - Change path to qemu-img tool"
>   
>   vm-build-all: $(addprefix vm-build-, $(IMAGES))
>   
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index 91a9226026..d1efeb3646 100755
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -152,6 +152,11 @@ class BaseVM(object):
>       def build_image(self, img):
>           raise NotImplementedError
>   
> +    def exec_qemu_img(self, *args):
> +        cmd = [os.environ.get("QEMU_IMG", "qemu-img")]
> +        cmd.extend(list(args))
> +        subprocess.check_call(cmd)
> +
>       def add_source_dir(self, src_dir):
>           name = "data-" + hashlib.sha1(src_dir.encode("utf-8")).hexdigest()[:5]
>           tarfile = os.path.join(self._tmpdir, name + ".tar")
> diff --git a/tests/vm/centos b/tests/vm/centos
> index 53976f1c4c..eac07dacd6 100755
> --- a/tests/vm/centos
> +++ b/tests/vm/centos
> @@ -68,7 +68,7 @@ class CentosVM(basevm.BaseVM):
>           sys.stderr.write("Extracting the image...\n")
>           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.exec_qemu_img("resize", img_tmp, "50G")
>           self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
>           self.wait_ssh()
>           self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
> diff --git a/tests/vm/fedora b/tests/vm/fedora
> index 7fec1479fb..8e270fc0f0 100755
> --- a/tests/vm/fedora
> +++ b/tests/vm/fedora
> @@ -74,9 +74,7 @@ class FedoraVM(basevm.BaseVM):
>   
>           self.print_step("Preparing iso and disk image")
>           subprocess.check_call(["cp", "-f", cimg, iso])
> -        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
> -                               img_tmp, self.size])
> -
> +        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
>           self.print_step("Booting installer")
>           self.boot(img_tmp, extra_args = [
>               "-bios", "pc-bios/bios-256k.bin",
> diff --git a/tests/vm/freebsd b/tests/vm/freebsd
> index 2a19461a90..1825cc5821 100755
> --- a/tests/vm/freebsd
> +++ b/tests/vm/freebsd
> @@ -82,8 +82,7 @@ class FreeBSDVM(basevm.BaseVM):
>           self.print_step("Preparing iso and disk image")
>           subprocess.check_call(["cp", "-f", cimg, iso_xz])
>           subprocess.check_call(["xz", "-dvf", iso_xz])
> -        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
> -                               img_tmp, self.size])
> +        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
>   
>           self.print_step("Booting installer")
>           self.boot(img_tmp, extra_args = [
> diff --git a/tests/vm/netbsd b/tests/vm/netbsd
> index 611e6cc5b5..ec6f3563b2 100755
> --- a/tests/vm/netbsd
> +++ b/tests/vm/netbsd
> @@ -77,8 +77,7 @@ class NetBSDVM(basevm.BaseVM):
>   
>           self.print_step("Preparing iso and disk image")
>           subprocess.check_call(["ln", "-f", cimg, iso])
> -        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
> -                               img_tmp, self.size])
> +        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
>   
>           self.print_step("Booting installer")
>           self.boot(img_tmp, extra_args = [
> diff --git a/tests/vm/openbsd b/tests/vm/openbsd
> index b92c39f89a..6df5162dbf 100755
> --- a/tests/vm/openbsd
> +++ b/tests/vm/openbsd
> @@ -73,8 +73,7 @@ class OpenBSDVM(basevm.BaseVM):
>   
>           self.print_step("Preparing iso and disk image")
>           subprocess.check_call(["cp", "-f", cimg, iso])
> -        subprocess.check_call(["qemu-img", "create", "-f", "qcow2",
> -                               img_tmp, self.size])
> +        self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size)
>   
>           self.print_step("Booting installer")
>           self.boot(img_tmp, extra_args = [
> diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
> index 38f740eabf..39bbe9cc21 100755
> --- a/tests/vm/ubuntu.i386
> +++ b/tests/vm/ubuntu.i386
> @@ -70,7 +70,7 @@ class UbuntuX86VM(basevm.BaseVM):
>               sha256sum="e30091144c73483822b7c27193e9d47346dd1064229da577c3fedcf943f7cfcc")
>           img_tmp = img + ".tmp"
>           subprocess.check_call(["cp", "-f", cimg, img_tmp])
> -        subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"])
> +        self.exec_qemu_img("resize", img_tmp, "50G")
>           self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
>           self.wait_ssh()
>           self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 13:42 [PATCH 0/1] tests/vm: Allow to set path to qemu-img Wainer dos Santos Moschetta
2019-11-14 13:42 ` [PATCH 1/1] tests/vm: Allow to set qemu-img path Wainer dos Santos Moschetta
2019-12-03 11:35   ` Alex Bennée
2019-12-03 16:17   ` Philippe Mathieu-Daudé

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git