[Qemu-devel] [PATCH] tests/vm: Use -cpu max rather than -cpu host

Peter Maydell posted 1 patch 7 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180820155554.23476-1-peter.maydell@linaro.org
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 passed
tests/vm/basevm.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[Qemu-devel] [PATCH] tests/vm: Use -cpu max rather than -cpu host
Posted by Peter Maydell 7 years, 2 months ago
-cpu max works with any accelerator, so we don't need
to use it only conditionally if not using KVM. Just use
it all the time.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This is equivalent to "revert dcf7ea4a78b105 and apply
https://patchwork.ozlabs.org/patch/953122/".
---
 tests/vm/basevm.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index d7149dea7da..13c06a35491 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -65,6 +65,7 @@ class BaseVM(object):
             self._stdout = self._devnull
         self._args = [ \
             "-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",
@@ -72,11 +73,9 @@ class BaseVM(object):
         if vcpus:
             self._args += ["-smp", str(vcpus)]
         if os.access("/dev/kvm", os.R_OK | os.W_OK):
-            self._args += ["-cpu", "host"]
             self._args += ["-enable-kvm"]
         else:
             logging.info("KVM not available, not using -enable-kvm")
-            self._args += ["-cpu", "max"]
         self._data_args = []
 
     def _download_with_cache(self, url, sha256sum=None):
-- 
2.18.0


Re: [Qemu-devel] [PATCH] tests/vm: Use -cpu max rather than -cpu host
Posted by Peter Maydell 7 years, 1 month ago
Ping?

thanks
-- PMM

On 20 August 2018 at 16:55, Peter Maydell <peter.maydell@linaro.org> wrote:
> -cpu max works with any accelerator, so we don't need
> to use it only conditionally if not using KVM. Just use
> it all the time.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> This is equivalent to "revert dcf7ea4a78b105 and apply
> https://patchwork.ozlabs.org/patch/953122/".
> ---
>  tests/vm/basevm.py | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index d7149dea7da..13c06a35491 100755
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -65,6 +65,7 @@ class BaseVM(object):
>              self._stdout = self._devnull
>          self._args = [ \
>              "-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",
> @@ -72,11 +73,9 @@ class BaseVM(object):
>          if vcpus:
>              self._args += ["-smp", str(vcpus)]
>          if os.access("/dev/kvm", os.R_OK | os.W_OK):
> -            self._args += ["-cpu", "host"]
>              self._args += ["-enable-kvm"]
>          else:
>              logging.info("KVM not available, not using -enable-kvm")
> -            self._args += ["-cpu", "max"]
>          self._data_args = []
>
>      def _download_with_cache(self, url, sha256sum=None):
> --
> 2.18.0
>
>

Re: [Qemu-devel] [PATCH] tests/vm: Use -cpu max rather than -cpu host
Posted by Fam Zheng 7 years, 1 month ago
On Tue, 09/25 15:54, Peter Maydell wrote:
> Ping?

Will send a pull request soon, thanks.

Fam

> 
> thanks
> -- PMM
> 
> On 20 August 2018 at 16:55, Peter Maydell <peter.maydell@linaro.org> wrote:
> > -cpu max works with any accelerator, so we don't need
> > to use it only conditionally if not using KVM. Just use
> > it all the time.
> >
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> > This is equivalent to "revert dcf7ea4a78b105 and apply
> > https://patchwork.ozlabs.org/patch/953122/".
> > ---
> >  tests/vm/basevm.py | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> > index d7149dea7da..13c06a35491 100755
> > --- a/tests/vm/basevm.py
> > +++ b/tests/vm/basevm.py
> > @@ -65,6 +65,7 @@ class BaseVM(object):
> >              self._stdout = self._devnull
> >          self._args = [ \
> >              "-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",
> > @@ -72,11 +73,9 @@ class BaseVM(object):
> >          if vcpus:
> >              self._args += ["-smp", str(vcpus)]
> >          if os.access("/dev/kvm", os.R_OK | os.W_OK):
> > -            self._args += ["-cpu", "host"]
> >              self._args += ["-enable-kvm"]
> >          else:
> >              logging.info("KVM not available, not using -enable-kvm")
> > -            self._args += ["-cpu", "max"]
> >          self._data_args = []
> >
> >      def _download_with_cache(self, url, sha256sum=None):
> > --
> > 2.18.0
> >
> >