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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to