tracetool: Forbid newline character in event format
Events aren't designed to be multi-lines. Multiple events can be used instead. Prevent that format using multi-lines by forbidding the newline character. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Mads Ynddal <mads@ynddal.dk> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20240606103943.79116-6-philmd@linaro.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
956f63f878
commit
4c2b6f3287
@ -301,6 +301,8 @@ class Event(object):
|
||||
if fmt.endswith(r'\n"'):
|
||||
raise ValueError("Event format must not end with a newline "
|
||||
"character")
|
||||
if '\\n' in fmt:
|
||||
raise ValueError("Event format must not use new line character")
|
||||
|
||||
if len(fmt_trans) > 0:
|
||||
fmt = [fmt_trans, fmt]
|
||||
|
Loading…
Reference in New Issue
Block a user