public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: kvm@vger.kernel.org
Cc: Michael Goldish <mgoldish@redhat.com>
Subject: Re: [KVM-AUTOTEST PATCH 6/8] Choose a monitor filename in the constructor of VM class
Date: Mon, 08 Jun 2009 12:19:33 -0300	[thread overview]
Message-ID: <1244474373.2849.62.camel@localhost.localdomain> (raw)
In-Reply-To: <1244433717-3391-10-git-send-email-lmr@redhat.com>

On Mon, 2009-06-08 at 01:01 -0300, Lucas Meneghel Rodrigues wrote:
> Choose a monitor filename in the VM class constructor instead of the
> VM.create() method. This will reduce the number of monitor files left
> in /tmp, because the constructor is called fewer times than VM.create().

Applied.

> Risk: Low (comprehensible change, just moving a block of code).
> Visibility: Small (users of kvm test).
> 
> Signed-off-by: Michael Goldish <mgoldish@redhat.com>
> ---
>  client/tests/kvm/kvm_vm.py |   21 +++++++++++----------
>  1 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
> index 76b0251..3001648 100644
> --- a/client/tests/kvm/kvm_vm.py
> +++ b/client/tests/kvm/kvm_vm.py
> @@ -115,6 +115,17 @@ class VM:
>          self.iso_dir = iso_dir
>  
> 
> +        # Find available monitor filename
> +        while True:
> +            # The monitor filename should be unique
> +            self.instance = time.strftime("%Y%m%d-%H%M%S-") + \
> +            kvm_utils.generate_random_string(4)
> +            self.monitor_file_name = os.path.join("/tmp",
> +                                                  "monitor-" + self.instance)
> +            if not os.path.exists(self.monitor_file_name):
> +                break
> +
> +
>      def verify_process_identity(self):
>          """
>          Make sure .pid really points to the original qemu process. If .pid
> @@ -297,16 +308,6 @@ class VM:
>                      logging.error("Actual MD5 sum differs from expected one")
>                      return False
>  
> -        # Find available monitor filename
> -        while True:
> -            # The monitor filename should be unique
> -            self.instance = time.strftime("%Y%m%d-%H%M%S-") + \
> -            kvm_utils.generate_random_string(4)
> -            self.monitor_file_name = os.path.join("/tmp",
> -                                                  "monitor-" + self.instance)
> -            if not os.path.exists(self.monitor_file_name):
> -                break
> -
>          # Handle port redirections
>          redir_names = kvm_utils.get_sub_dict_names(params, "redirs")
>          host_ports = kvm_utils.find_free_ports(5000, 6000, len(redir_names))
-- 
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies


  reply	other threads:[~2009-06-08 15:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08  4:01 [KVM-AUTOTEST PATCH 0/8] Re-submitting some of the patches on the patch queue Lucas Meneghel Rodrigues
2009-06-08  4:01 ` [KVM-AUTOTEST PATCH 1/8] kvm_config: Allow for "=" in the value of a config parameter Lucas Meneghel Rodrigues
2009-06-08  4:01   ` [PATCH 1/3] Make possible to use kvm_config as a standalone program Lucas Meneghel Rodrigues
2009-06-08  4:01     ` [PATCH 2/3] Fixing bad line breaks Lucas Meneghel Rodrigues
2009-06-08  4:01       ` [KVM-AUTOTEST PATCH 2/8] RHEL-4.7 step files: fix the initial boot barriers Lucas Meneghel Rodrigues
2009-06-08  4:01         ` [PATCH 3/3] Fix bad logging calls Lucas Meneghel Rodrigues
2009-06-08  4:01           ` [KVM-AUTOTEST PATCH 3/8] WinXP step file fixes Lucas Meneghel Rodrigues
2009-06-08  4:01             ` [KVM-AUTOTEST PATCH 4/8] RHEL 5.3 " Lucas Meneghel Rodrigues
2009-06-08  4:01               ` [KVM-AUTOTEST PATCH 5/8] stepeditor.py: get rid of some shortcuts Lucas Meneghel Rodrigues
2009-06-08  4:01                 ` [KVM-AUTOTEST PATCH 6/8] Choose a monitor filename in the constructor of VM class Lucas Meneghel Rodrigues
2009-06-08 15:19                   ` Lucas Meneghel Rodrigues [this message]
2009-06-08 15:19                 ` [KVM-AUTOTEST PATCH 5/8] stepeditor.py: get rid of some shortcuts Lucas Meneghel Rodrigues
2009-06-08 15:18               ` [KVM-AUTOTEST PATCH 4/8] RHEL 5.3 step file fixes Lucas Meneghel Rodrigues
2009-06-08 15:18             ` [KVM-AUTOTEST PATCH 3/8] WinXP " Lucas Meneghel Rodrigues
2009-06-08 15:17         ` [KVM-AUTOTEST PATCH 2/8] RHEL-4.7 step files: fix the initial boot barriers Lucas Meneghel Rodrigues
2009-06-08 15:16   ` [KVM-AUTOTEST PATCH 1/8] kvm_config: Allow for "=" in the value of a config parameter Lucas Meneghel Rodrigues
2009-06-09  8:41 ` [KVM-AUTOTEST PATCH] A test patch - Boot VMs until one of them becomes unresponsive Yolkfull Chow
2009-06-09  9:37   ` Yaniv Kaul
2009-06-09  9:57     ` Michael Goldish
2009-06-09 12:45   ` Uri Lublin
2009-06-10  8:12     ` Yolkfull Chow
  -- strict thread matches above, loose matches on Subject: below --
2009-06-05 20:46 [KVM-AUTOTEST PATCH 0/8] Re-submitting some of the patches on the patch queue Lucas Meneghel Rodrigues
2009-06-05 20:46 ` [KVM-AUTOTEST PATCH 1/8] kvm_config: Allow for "=" in the value of a config parameter Lucas Meneghel Rodrigues
2009-06-05 20:46   ` [KVM-AUTOTEST PATCH 2/8] RHEL-4.7 step files: fix the initial boot barriers Lucas Meneghel Rodrigues
2009-06-05 20:46     ` [KVM-AUTOTEST PATCH 3/8] WinXP step file fixes Lucas Meneghel Rodrigues
2009-06-05 20:46       ` [KVM-AUTOTEST PATCH 4/8] RHEL 5.3 " Lucas Meneghel Rodrigues
2009-06-05 20:46         ` [KVM-AUTOTEST PATCH 5/8] stepeditor.py: get rid of some shortcuts Lucas Meneghel Rodrigues
2009-06-05 20:46           ` [KVM-AUTOTEST PATCH 6/8] Choose a monitor filename in the constructor of VM class Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1244474373.2849.62.camel@localhost.localdomain \
    --to=lmr@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mgoldish@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox