From 2c3f6e4175fdfb4b7148005ae837df128a308007 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 19 Feb 2018 16:06:33 -0500 Subject: [PATCH] qapi-event: Clean up how name of enum QAPIEvent is made Use c_name() instead of ad hoc code. Doesn't upcase the -p prefix, which is an improvement in my book. Unbreaks prefix containing '.', but other funny characters remain broken. To be fixed next. Backports commit 016a335bd8ca624f43adbb08fa1698c29ec52a1a from qemu --- qemu/scripts/qapi-event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/scripts/qapi-event.py b/qemu/scripts/qapi-event.py index b40f542a..d82a0157 100644 --- a/qemu/scripts/qapi-event.py +++ b/qemu/scripts/qapi-event.py @@ -266,7 +266,7 @@ fdecl.write(mcgen(''' exprs = parse_schema(input_file) -event_enum_name = prefix.upper().replace('-', '_') + "QAPIEvent" +event_enum_name = c_name(prefix + "QAPIEvent", protect=False) event_enum_values = [] event_enum_strings = []