diff --git a/qemu/scripts/qapi/common.py b/qemu/scripts/qapi/common.py index 8dab62f5..6a3ea452 100644 --- a/qemu/scripts/qapi/common.py +++ b/qemu/scripts/qapi/common.py @@ -1876,7 +1876,7 @@ def mcgen(code, **kwds): def guardname(filename): - return c_name(filename, protect=False).upper() + return re.sub(r'[^A-Za-z0-9_]', '_', filename).upper() def guardstart(name):