From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Meneghel Rodrigues Subject: Re: [PATCH] KVM test: Put os.kill in kvm_stat into try block to avoid traceback Date: Mon, 29 Mar 2010 11:04:03 -0300 Message-ID: <1269871443.2585.0.camel@localhost.localdomain> References: <1269856603-8405-1-git-send-email-yzhou@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Yolkfull Chow Return-path: Received: from mx1.redhat.com ([209.132.183.28]:14553 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752231Ab0C2OEL (ORCPT ); Mon, 29 Mar 2010 10:04:11 -0400 In-Reply-To: <1269856603-8405-1-git-send-email-yzhou@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2010-03-29 at 17:56 +0800, Yolkfull Chow wrote: > Sometimes it tried to kill an already terminated process which can cause > a traceback. This patch fixes the problem. Thanks, applied! > Signed-off-by: Yolkfull Chow > --- > client/profilers/kvm_stat/kvm_stat.py | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/client/profilers/kvm_stat/kvm_stat.py b/client/profilers/kvm_stat/kvm_stat.py > index 7568a03..59d6ff6 100644 > --- a/client/profilers/kvm_stat/kvm_stat.py > +++ b/client/profilers/kvm_stat/kvm_stat.py > @@ -51,7 +51,10 @@ class kvm_stat(profiler.profiler): > > @param test: Autotest test on which this profiler will operate on. > """ > - os.kill(self.pid, 15) > + try: > + os.kill(self.pid, 15) > + except OSError: > + pass > > > def report(self, test):