[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 08/17] trace: remove the TraceEventID and Tra
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v4 08/17] trace: remove the TraceEventID and TraceEventVCPUID enums |
Date: |
Fri, 23 Sep 2016 15:12:07 +0100 |
User-agent: |
Mutt/1.7.0 (2016-08-17) |
On Thu, Sep 22, 2016 at 08:42:23PM +0200, Lluís Vilanova wrote:
> Lluís Vilanova writes:
> > Daniel P Berrange writes:
> >> On Thu, Sep 22, 2016 at 02:35:38PM +0200, Lluís Vilanova wrote:
> >>> Daniel P Berrange writes:
> >>> Here's a more pythonic way to write it:
> >>>
> >>> numvcpu = len([e for e in events if "vcpu" in e.properties])
>
> >> FWIW I was tending to avoid this kind of idiom, since most of QEMU
> >> maintainers are C developers, for whom this looks rather alien.
>
> > I dont wanna enter into a coding style discussion, since I don't know how
> > alien
> > QEMU developers feel about this (to me, it certainly looks ugly to keep the
> > explicit for loop). Feel free to ignore it.
>
> BTW, the pythonic one is the style used in many other places on the tracetool
> code.
I agree. Let's write in Python, not try to write C in Python.
Stefan
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH v4 07/17] trace: give each trace event a named TraceEvent struct, (continued)
Re: [Qemu-devel] [PATCH v4 08/17] trace: remove the TraceEventID and TraceEventVCPUID enums, Stefan Hajnoczi, 2016/09/23
[Qemu-devel] [PATCH v4 11/17] trace: provide mechanism for registering trace events, Daniel P. Berrange, 2016/09/22
[Qemu-devel] [PATCH v4 12/17] trace: dynamically allocate trace_dstate in CPUState, Daniel P. Berrange, 2016/09/22
[Qemu-devel] [PATCH v4 13/17] trace: dynamically allocate event IDs at runtime, Daniel P. Berrange, 2016/09/22
[Qemu-devel] [PATCH v4 14/17] trace: get rid of generated-events.h/generated-events.c, Daniel P. Berrange, 2016/09/22