[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] Python version requirements vs qemu-upstream
According to our own documentation, even Python 2.3 is supported for building, yet the qemu-upstream version update results in that part of the build no longer working with Python 2.4 due to a number of conditional assignments like this full_name = name if not fn_prefix else "%s_%s" % (name, fn_prefix) in scripts/qapi-visit.py. Converting these instances to proper conditionals fixes the issue for me. I further found that with some gcc versions trace/control-internal.h causes a huge amount of warnings to be generated. While this isn't keeping the build from succeeding, it's still rather annoying. The combined full fix for both issues is below. But I'm uncertain whether sending these to qemu-devel would make any sense, as I have no idea whether such old build environments are being cared about there. Jan --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -20,7 +20,10 @@ import errno def generate_visit_struct_fields(name, field_prefix, fn_prefix, members): substructs = [] ret = '' - full_name = name if not fn_prefix else "%s_%s" % (name, fn_prefix) + if not fn_prefix: + full_name = name + else: + full_name = "%s_%s" % (name, fn_prefix) for argname, argentry, optional, structured in parse_args(members): if structured: @@ -84,7 +87,10 @@ if (!error_is_set(errp)) { ''') push_indent() - full_name = name if not field_prefix else "%s_%s" % (field_prefix, name) + if not field_prefix: + full_name = name + else: + full_name = "%s_%s" % (field_prefix, name) if len(field_prefix): ret += mcgen(''' @@ -226,6 +232,10 @@ def generate_visit_union(expr): base = expr.get('base') discriminator = expr.get('discriminator') + if not discriminator: + type="type" + else: + type=discriminator if discriminator == {}: assert not base @@ -270,7 +280,7 @@ void visit_type_%(name)s(Visitor *m, %(n if (!err) { switch ((*obj)->kind) { ''', - name=name, type="type" if not discriminator else discriminator) + name=name, type=type) for key in members: if not discriminator: --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -16,15 +16,15 @@ extern TraceEvent trace_events[]; -static inline TraceEvent *trace_event_id(TraceEventID id) +static inline TraceEventID trace_event_count(void) { - assert(id < trace_event_count()); - return &trace_events[id]; + return TRACE_EVENT_COUNT; } -static inline TraceEventID trace_event_count(void) +static inline TraceEvent *trace_event_id(TraceEventID id) { - return TRACE_EVENT_COUNT; + assert(id < trace_event_count()); + return &trace_events[id]; } static inline bool trace_event_is_pattern(const char *str) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |