On Thu, Nov 8, 2012 at 8:37 AM, Feng Yang <[email protected]> wrote:
> Restart the guest if exception raised
>
> Signed-off-by: Feng Yang <[email protected]>
> ---
>  virttest/virt_vm.py |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/virttest/virt_vm.py b/virttest/virt_vm.py
> index ff6a0f7..a6a1454 100644
> --- a/virttest/virt_vm.py
> +++ b/virttest/virt_vm.py
> @@ -439,8 +439,12 @@ class BaseVM(object):
>          Verifies whether the current virt_install commandline matches the
>          requested one, based on the test parameters.
>          """
> -        if (self.make_create_command() !=
> -                self.make_create_command(name, params, basedir)):
> +        try:
> +            need_restart = (self.make_create_command() !=
> +                           self.make_create_command(name, params, basedir))

This seems wrong... looking at the code of make_create_command, we see
that exceptions are raised on purpose to stop the test (for example,
wrong configuration, qemu doesn't support a given option). In which
scenarios you see this being useful?

> +        except Exception, e:
> +           need_restart = True
> +        if need_restart:
>              logging.debug("VM params in env don't match requested, 
> restarting.")
>              return True
>          else:
> --
> 1.7.1
>
> _______________________________________________
> Virt-test-devel mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/virt-test-devel



-- 
Lucas

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to