On Wed, 2013-04-17 at 16:39 -0300, Lucas Meneghel Rodrigues wrote:
> Setting the environment variable MALLOC_PERTURB_ to
> a non zero value [1] helps to find out some subtle
> memory allocation problems, and it is being used in
> our test grid. However, by default, the virt test
> runner doesn't use it.
> 
> Add the new, qemu test specific --use-malloc-perturb flag
> and set it to 'yes' (use the env variable) by default.
> This way we're being more strict, which makes sense
> in the context of a test suite. If people want to double
> check the behavior of the test without the flag, just
> use '--use-malloc-perturb no'.

I did send this one as a patch mostly because I wanted to raise
awareness on the qemu development list that the test runner changed its
behavior to be more restrictive from now on.

> [1] http://udrepper.livejournal.com/11429.html
> 
> Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
> ---
>  run | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/run b/run
> index 170f00a..dd203aa 100755
> --- a/run
> +++ b/run
> @@ -238,6 +238,11 @@ class VirtTestRunParser(optparse.OptionParser):
>                              "If -c is provided and this flag is omitted, "
>                              "no attempt to set the qemu binaries will be 
> made. "
>                                "Default path: %s" % qemu_bin_path))
> +        qemu.add_option("--use-malloc-perturb", action="store",
> +                        dest="malloc_perturb", default="yes",
> +                        help=("Use MALLOC_PERTURB_ env variable set to 1 "
> +                              "to help catch memory allocation problems on "
> +                              "qemu (yes or no). Default: %default"))
>          qemu.add_option("--accel", action="store", dest="accel", 
> default="kvm",
>                          help=("Accelerator used to run qemu (kvm or tcg). "
>                                "Default: kvm"))
> @@ -468,6 +473,11 @@ class VirtTestApp(object):
>              logging.info("Config provided, ignoring --vhost option")
>  
>  
> +    def _process_malloc_perturb(self):
> +        self.cartesian_parser.assign("malloc_perturb",
> +                                     self.options.malloc_perturb)
> +
> +
>      def _process_qemu_specific_options(self):
>          """
>          Calls for processing all options specific to the qemu test.
> @@ -484,6 +494,7 @@ class VirtTestApp(object):
>          self._process_nic_model()
>          self._process_disk_buses()
>          self._process_vhost()
> +        self._process_malloc_perturb()
>  
>  
>      def _process_guest_os(self):
> -- 
> 1.8.2
> 


_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to