qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH v2 0/3] tests/vm: Improvements when KVM is not available
       [not found] <20180930232312.16486-1-f4bug@amsat.org>
@ 2018-10-10 21:18 ` Philippe Mathieu-Daudé
       [not found] ` <20180930232312.16486-3-f4bug@amsat.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-10-10 21:18 UTC (permalink / raw)
  To: Alex Bennée, Fam Zheng; +Cc: qemu-devel

Ping?

On 10/1/18 1:23 AM, Philippe Mathieu-Daudé wrote:
> Hi Fam,
> 
> Since v1: http://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg03411.html
> - rebased on master
> - added get_default_jobs (Fam)
> - dropped 'When using TCG, wait longer for a VM to start'
> 
> Few patches I added while testing the VM tests without KVM access.
> I doubt many people want to suffer using TCG for VM testing, but
> it was handy to debug/support aarch64 VM tests.
> 
> Also this could be a useful TCG stress test...?
> 
> Regards,
> 
> Phil.
> 
> Philippe Mathieu-Daudé (3):
>   tests/vm: Extract the kvm_available() handy function
>   tests/vm: Do not abuse parallelism when KVM is not available
>   tests/vm: Display remaining seconds to wait for a VM to start
> 
>  tests/vm/basevm.py | 25 ++++++++++++++++++++-----
>  1 file changed, 20 insertions(+), 5 deletions(-)
> 

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

* Re: [Qemu-devel] [PATCH v2 2/3] tests/vm: Do not abuse parallelism when KVM is not available
       [not found] ` <20180930232312.16486-3-f4bug@amsat.org>
@ 2018-10-11  2:46   ` Fam Zheng
  2018-10-11 23:48     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Fam Zheng @ 2018-10-11  2:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Alex Bennée, qemu-devel

On Mon, 10/01 01:23, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2: Add get_default_jobs (Fam suggestion)
> ---
>  tests/vm/basevm.py | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index 5a5fa09752..fc203e9f53 100755
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -202,6 +202,13 @@ class BaseVM(object):
>          return self._guest.qmp(*args, **kwargs)
>  
>  def parse_args(vm_name):
> +
> +    def get_default_jobs():
> +        if kvm_available():
> +            return multiprocessing.cpu_count() / 2
> +        else:
> +            return 1
> +
>      parser = optparse.OptionParser(
>          description="VM test utility.  Exit codes: "
>                      "0 = success, "
> @@ -214,7 +221,7 @@ def parse_args(vm_name):
>                        help="image file name")
>      parser.add_option("--force", "-f", action="store_true",
>                        help="force build image even if image exists")
> -    parser.add_option("--jobs", type=int, default=multiprocessing.cpu_count() / 2,
> +    parser.add_option("--jobs", type=int, default=get_default_jobs(),
>                        help="number of virtual CPUs")
>      parser.add_option("--verbose", "-V", action="store_true",
>                        help="Pass V=1 to builds within the guest")
> @@ -237,7 +244,7 @@ def main(vmcls):
>              return 1
>          logging.basicConfig(level=(logging.DEBUG if args.debug
>                                     else logging.WARN))
> -        vm = vmcls(debug=args.debug, vcpus=args.jobs)
> +        vm = vmcls(debug=args.debug, vcpus=args.jobs if kvm_available() else 0)

What's wrong with just using args.jobs? It defaults to 1 if kvm_available()
returns false, so I don't think we need another condition here.

>          if args.build_image:
>              if os.path.exists(args.image) and not args.force:
>                  sys.stderr.writelines(["Image file exists: %s\n" % args.image,
> @@ -248,7 +255,7 @@ def main(vmcls):
>              vm.add_source_dir(args.build_qemu)
>              cmd = [vm.BUILD_SCRIPT.format(
>                     configure_opts = " ".join(argv),
> -                   jobs=args.jobs,
> +                   jobs=args.jobs if kvm_available() else 1,

Again, can't we just use args.jobs?

>                     verbose = "V=1" if args.verbose else "")]
>          else:
>              cmd = argv
> -- 
> 2.19.0
> 

Fam

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

* Re: [Qemu-devel] [PATCH v2 2/3] tests/vm: Do not abuse parallelism when KVM is not available
  2018-10-11  2:46   ` [Qemu-devel] [PATCH v2 2/3] tests/vm: Do not abuse parallelism " Fam Zheng
@ 2018-10-11 23:48     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-10-11 23:48 UTC (permalink / raw)
  To: Fam Zheng; +Cc: Alex Bennée, qemu-devel@nongnu.org Developers

On Thu, Oct 11, 2018 at 4:46 AM Fam Zheng <famz@redhat.com> wrote:
> On Mon, 10/01 01:23, Philippe Mathieu-Daudé wrote:
> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > ---
> > v2: Add get_default_jobs (Fam suggestion)
> > ---
> >  tests/vm/basevm.py | 13 ++++++++++---
> >  1 file changed, 10 insertions(+), 3 deletions(-)
> >
> > diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> > index 5a5fa09752..fc203e9f53 100755
> > --- a/tests/vm/basevm.py
> > +++ b/tests/vm/basevm.py
> > @@ -202,6 +202,13 @@ class BaseVM(object):
> >          return self._guest.qmp(*args, **kwargs)
> >
> >  def parse_args(vm_name):
> > +
> > +    def get_default_jobs():
> > +        if kvm_available():
> > +            return multiprocessing.cpu_count() / 2
> > +        else:
> > +            return 1
> > +
> >      parser = optparse.OptionParser(
> >          description="VM test utility.  Exit codes: "
> >                      "0 = success, "
> > @@ -214,7 +221,7 @@ def parse_args(vm_name):
> >                        help="image file name")
> >      parser.add_option("--force", "-f", action="store_true",
> >                        help="force build image even if image exists")
> > -    parser.add_option("--jobs", type=int, default=multiprocessing.cpu_count() / 2,
> > +    parser.add_option("--jobs", type=int, default=get_default_jobs(),
> >                        help="number of virtual CPUs")
> >      parser.add_option("--verbose", "-V", action="store_true",
> >                        help="Pass V=1 to builds within the guest")
> > @@ -237,7 +244,7 @@ def main(vmcls):
> >              return 1
> >          logging.basicConfig(level=(logging.DEBUG if args.debug
> >                                     else logging.WARN))
> > -        vm = vmcls(debug=args.debug, vcpus=args.jobs)
> > +        vm = vmcls(debug=args.debug, vcpus=args.jobs if kvm_available() else 0)
>
> What's wrong with just using args.jobs? It defaults to 1 if kvm_available()
> returns false, so I don't think we need another condition here.

You are right, I missed that.

>
> >          if args.build_image:
> >              if os.path.exists(args.image) and not args.force:
> >                  sys.stderr.writelines(["Image file exists: %s\n" % args.image,
> > @@ -248,7 +255,7 @@ def main(vmcls):
> >              vm.add_source_dir(args.build_qemu)
> >              cmd = [vm.BUILD_SCRIPT.format(
> >                     configure_opts = " ".join(argv),
> > -                   jobs=args.jobs,
> > +                   jobs=args.jobs if kvm_available() else 1,
>
> Again, can't we just use args.jobs?
>
> >                     verbose = "V=1" if args.verbose else "")]
> >          else:
> >              cmd = argv
> > --
> > 2.19.0
> >
>
> Fam

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

end of thread, other threads:[~2018-10-11 23:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180930232312.16486-1-f4bug@amsat.org>
2018-10-10 21:18 ` [Qemu-devel] [PATCH v2 0/3] tests/vm: Improvements when KVM is not available Philippe Mathieu-Daudé
     [not found] ` <20180930232312.16486-3-f4bug@amsat.org>
2018-10-11  2:46   ` [Qemu-devel] [PATCH v2 2/3] tests/vm: Do not abuse parallelism " Fam Zheng
2018-10-11 23:48     ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).