From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [KVM-AUTOTEST PATCH v2 3/6] [RFC] Introduce exception context strings Date: Wed, 05 Jan 2011 18:39:35 +0200 Message-ID: <4D249EC7.2070204@redhat.com> References: <1294242329-11034-1-git-send-email-mgoldish@redhat.com> <1294242329-11034-3-git-send-email-mgoldish@redhat.com> <4D249855.30607@redhat.com> <4D249A8F.8090009@redhat.com> <20110105163643.GF3361@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Michael Goldish , autotest@test.kernel.org, kvm@vger.kernel.org To: Eduardo Habkost Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59466 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256Ab1AEQjk (ORCPT ); Wed, 5 Jan 2011 11:39:40 -0500 In-Reply-To: <20110105163643.GF3361@otherpad.lan.raisama.net> Sender: kvm-owner@vger.kernel.org List-ID: On 01/05/2011 06:36 PM, Eduardo Habkost wrote: > On Wed, Jan 05, 2011 at 06:21:35PM +0200, Avi Kivity wrote: > > btw, you can have a decorator for enclosing an entire function in an > > error context: > > > > @function_error_context('migration test') > > def migration_test(...): > > ... > > @context_aware does that, but it doesn't let you set the context string > (it just initializes it to "(function_name)"). I think it is enough for > our purposes (and it keeps the API simple). > > > > > anything in migration_test() is enclosed in that context. But we're > > just repeating the ordinary stack trace with something more > > readable. > > The context information is more useful for cases we want to know where > exactly we were, inside a single function (e.g. "did we crash before or > after migration finished?"). So the API is optimized for the cases where > we actually want to change the context string inside the same function. > Ok, makes sense. 'with' would have been nice, but I understand the need for compatibility. -- error compiling committee.c: too many arguments to function