qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 07/16] qapi: Drop support for escape sequence


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 07/16] qapi: Drop support for escape sequences other than \\
Date: Tue, 17 Sep 2019 11:18:44 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 9/13/19 3:13 PM, Markus Armbruster wrote:
> Since the previous commit restricted strings to printable ASCII,
> \uXXXX's only use is obfuscation.  Drop it.
> 
> This leaves \\, \/, \', and \".  Since QAPI schema strings are all
> names, and names are restricted to ASCII letters, digits, hyphen, and
> underscore, none of them is useful.
> 
> The latter three have no test coverage.  Drop them.
> 
> Keep \\ to avoid (more) gratuitous incompatibility with JSON.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---

> +++ b/scripts/qapi/common.py
> @@ -524,29 +524,9 @@ class QAPISchemaParser(object):
>                      if ch == '\n':
>                          raise QAPIParseError(self, 'Missing terminating 
> "\'"')
>                      if esc:

> -                        elif ch not in '\\/\'"':
> +                        # Note: we recognize only \\ because we have
> +                        # no use for funny characters in strings
> +                        if ch != '\\':
>                              raise QAPIParseError(self,
>                                                   "Unknown escape \\%s" % ch)

Thanks; that comment makes it better than it was in v2.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]