[{"id":1822343,"web_url":"http://patchwork.ozlabs.org/comment/1822343/","msgid":"<87zi6lza7i.fsf@dusky.pond.sub.org>","list_archive_url":null,"date":"2017-12-14T13:54:25","subject":"Re: [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma","submitter":{"id":2645,"url":"http://patchwork.ozlabs.org/api/people/2645/","name":"Markus Armbruster","email":"armbru@redhat.com"},"content":"Marc-André Lureau <marcandre.lureau@redhat.com> writes:\n\n> Add a pragma that allows to tag the following expressions with a unit\n> name. By default, an expression has no unit name.\n\nPlease explain the unit name's intended purpose.\n\n> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> ---\n>  scripts/qapi.py              | 9 ++++++++-\n>  docs/devel/qapi-code-gen.txt | 3 +++\n>  2 files changed, 11 insertions(+), 1 deletion(-)\n>\n> diff --git a/scripts/qapi.py b/scripts/qapi.py\n> index eb4ffdc06d..1d0defd638 100644\n> --- a/scripts/qapi.py\n> +++ b/scripts/qapi.py\n> @@ -279,10 +279,12 @@ class QAPISchemaParser(object):\n>          self.docs = []\n>          self.cur_doc = None\n>          self.accept()\n> +        self.unit = None\n>  \n>          while self.tok is not None:\n>              info = {'file': fname, 'line': self.line,\n> -                    'parent': self.incl_info}\n> +                    'parent': self.incl_info,\n> +                    'unit': self.unit}\n>              if self.tok == '#':\n>                  self.reject_expr_doc()\n>                  self.cur_doc = self.get_doc(info)\n> @@ -371,6 +373,11 @@ class QAPISchemaParser(object):\n>                                     \"Pragma name-case-whitelist must be\"\n>                                     \" a list of strings\")\n>              name_case_whitelist = value\n> +        elif name == 'unit':\n> +            if not isinstance(value, str):\n> +                raise QAPISemError(info,\n> +                                   \"Pragma 'unit' must be string\")\n> +            self.unit = value\n>          else:\n>              raise QAPISemError(info, \"Unknown pragma '%s'\" % name)\n>  \n> diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt\n> index 24fc6f74ee..37a27cd9d7 100644\n> --- a/docs/devel/qapi-code-gen.txt\n> +++ b/docs/devel/qapi-code-gen.txt\n> @@ -326,6 +326,9 @@ violate the rules on permitted return types.  Default is none.\n>  Pragma 'name-case-whitelist' takes a list of names that may violate\n>  rules on use of upper- vs. lower-case letters.  Default is none.\n>  \n> +Pragma 'unit' takes a string value. It will set the unit name for the\n> +following expressions in the schema. Most code generator can filter\n> +based on a unit name. Default is none.\n\nDo you mean \"most code generators\"?\n\nWhat does \"filtering\" mean?\n\n>  \n>  === Struct types ===\n\nHumor me: put two spaces after a sentence-ending period.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yyFS60Fzxz9s1h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Dec 2017 00:55:01 +1100 (AEDT)","from localhost ([::1]:41059 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1ePTyW-0002TQ-2x\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Dec 2017 08:55:00 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:47056)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1ePTyB-0002T8-Rx\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 08:54:40 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1ePTy7-00068s-Ue\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 08:54:39 -0500","from mx1.redhat.com ([209.132.183.28]:46618)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <armbru@redhat.com>) id 1ePTy7-00067o-Lz\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 08:54:35 -0500","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id A01378008B;\n\tThu, 14 Dec 2017 13:54:34 +0000 (UTC)","from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com\n\t[10.36.116.74])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id C248B5D9CC;\n\tThu, 14 Dec 2017 13:54:31 +0000 (UTC)","by blackfin.pond.sub.org (Postfix, from userid 1000)\n\tid 5C2991138658; Thu, 14 Dec 2017 14:54:25 +0100 (CET)"],"From":"Markus Armbruster <armbru@redhat.com>","To":"=?utf-8?q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@redhat.com>","References":"<20170911110623.24981-1-marcandre.lureau@redhat.com>\n\t<20170911110623.24981-42-marcandre.lureau@redhat.com>","Date":"Thu, 14 Dec 2017 14:54:25 +0100","In-Reply-To":"<20170911110623.24981-42-marcandre.lureau@redhat.com> (\n\t=?utf-8?b?Ik1hcmMtQW5kcsOp?= Lureau\"'s message of \"Mon,\n\t11 Sep 2017 \t13:06:14 +0200\")","Message-ID":"<87zi6lza7i.fsf@dusky.pond.sub.org>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tThu, 14 Dec 2017 13:54:34 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1822345,"web_url":"http://patchwork.ozlabs.org/comment/1822345/","msgid":"<CAJ+F1CLe-=UOtVSN+Pnou1uOVF+sDqus3KUdJfNO5oa+VZt2=Q@mail.gmail.com>","list_archive_url":null,"date":"2017-12-14T14:00:12","subject":"Re: [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma","submitter":{"id":6442,"url":"http://patchwork.ozlabs.org/api/people/6442/","name":"Marc-André Lureau","email":"marcandre.lureau@gmail.com"},"content":"Hi\n\nOn Thu, Dec 14, 2017 at 2:54 PM, Markus Armbruster <armbru@redhat.com> wrote:\n> Marc-André Lureau <marcandre.lureau@redhat.com> writes:\n>\n>> Add a pragma that allows to tag the following expressions with a unit\n>> name. By default, an expression has no unit name.\n>\n> Please explain the unit name's intended purpose.\n>\n\nIt's syccintly explained in the doc.\n\n>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n>> ---\n>>  scripts/qapi.py              | 9 ++++++++-\n>>  docs/devel/qapi-code-gen.txt | 3 +++\n>>  2 files changed, 11 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/scripts/qapi.py b/scripts/qapi.py\n>> index eb4ffdc06d..1d0defd638 100644\n>> --- a/scripts/qapi.py\n>> +++ b/scripts/qapi.py\n>> @@ -279,10 +279,12 @@ class QAPISchemaParser(object):\n>>          self.docs = []\n>>          self.cur_doc = None\n>>          self.accept()\n>> +        self.unit = None\n>>\n>>          while self.tok is not None:\n>>              info = {'file': fname, 'line': self.line,\n>> -                    'parent': self.incl_info}\n>> +                    'parent': self.incl_info,\n>> +                    'unit': self.unit}\n>>              if self.tok == '#':\n>>                  self.reject_expr_doc()\n>>                  self.cur_doc = self.get_doc(info)\n>> @@ -371,6 +373,11 @@ class QAPISchemaParser(object):\n>>                                     \"Pragma name-case-whitelist must be\"\n>>                                     \" a list of strings\")\n>>              name_case_whitelist = value\n>> +        elif name == 'unit':\n>> +            if not isinstance(value, str):\n>> +                raise QAPISemError(info,\n>> +                                   \"Pragma 'unit' must be string\")\n>> +            self.unit = value\n>>          else:\n>>              raise QAPISemError(info, \"Unknown pragma '%s'\" % name)\n>>\n>> diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt\n>> index 24fc6f74ee..37a27cd9d7 100644\n>> --- a/docs/devel/qapi-code-gen.txt\n>> +++ b/docs/devel/qapi-code-gen.txt\n>> @@ -326,6 +326,9 @@ violate the rules on permitted return types.  Default is none.\n>>  Pragma 'name-case-whitelist' takes a list of names that may violate\n>>  rules on use of upper- vs. lower-case letters.  Default is none.\n>>\n>> +Pragma 'unit' takes a string value. It will set the unit name for the\n>> +following expressions in the schema. Most code generator can filter\n>> +based on a unit name. Default is none.\n>\n> Do you mean \"most code generators\"?\n\nThe qapi code/doc generators.\n\n>\n> What does \"filtering\" mean?\n\nTo be able to select a subset of expressions based on the unit name.\n\n>>\n>>  === Struct types ===\n>\n> Humor me: put two spaces after a sentence-ending period.\n>\n\nI don't get what you mean.\n\nthanks","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"VjvlCMNA\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yyFZz24s8z9t2f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Dec 2017 01:00:58 +1100 (AEDT)","from localhost ([::1]:41093 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1ePU4G-00054n-7R\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Dec 2017 09:00:56 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:50410)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1ePU3c-00051J-IA\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 09:00:22 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1ePU3b-00030y-Cq\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 09:00:16 -0500","from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:40765)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <marcandre.lureau@gmail.com>)\n\tid 1ePU3a-0002ys-NI\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 09:00:15 -0500","by mail-wm0-x22a.google.com with SMTP id f206so11553396wmf.5\n\tfor <qemu-devel@nongnu.org>; Thu, 14 Dec 2017 06:00:14 -0800 (PST)","by 10.223.165.153 with HTTP; Thu, 14 Dec 2017 06:00:12 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc:content-transfer-encoding;\n\tbh=XvnKwQBsBaT/CuIJaGonbBwR7adA0vkMtKCG2AKm7Wg=;\n\tb=VjvlCMNA7zXWPRpnAuTmYt+wmm+EoDz49vzTzTStOiqcNXwzU/bYf4un5Z98GgpOfr\n\tLBxuHTuk//Bx+XvtQfkTFnrbA48Xrzq2hJEDlTR/4pMxtDM9nx2ZMYcybUttJBPaXXKF\n\tErgophcaB/NzuEiyPmADUpIGyfoziyNNLFcvy3l6xRa42tZvOeD1/fXiwKIQHOAOLIO8\n\tgRoH3FTSmcazJwE2m5xvzaMh6urTiDSHsGTZbUGc8QGAEH8w9gg7hoqa1tatB0ssMMDO\n\taIDNEoWdk2yzB83bwJ57w/drGvjA7kecJ3AXs2bSXrOPbkb/1L0qJ4spL0sHUAds5MHG\n\t2qMQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-transfer-encoding;\n\tbh=XvnKwQBsBaT/CuIJaGonbBwR7adA0vkMtKCG2AKm7Wg=;\n\tb=At4RSXxocnVYIqFCI18XUt+P1MQ3+lMybZj5iEdyHNqT4sa2kZ6UQNDbzXgoMXu/RD\n\t8tfShTl8WjoP6IDe+2gIqNMXfzIEbojklDIjpFVtk99AKGWe4f7/5eXVGHkwukekz8QF\n\t145mLNJGmYtPYfe3WjApSlF7ePiKjzqsRkTlIDzHYrd7yZA8EfWiUXtc6sVgsXmyhz1Q\n\tIS0BCT9egd/yGrYLHD8rqBq6nuqbgvXD3bSl4UZTFZISRdusv7asVEkXs/031wcmFGRR\n\tGQ8ySaMs4zkd1umz0ul35QJwUvzwNKY3f5mlGEJvM6Qh28o+7QBDp9Z/dVBOEVUsXh6L\n\t2QpA==","X-Gm-Message-State":"AKGB3mKP4JkeVFRo5TBrWKYecr0rQqLr1C2CNMosMepzeX+AH4RJHJbw\n\tmqznadSXBCSRdl4SmxIKrjU8BrAHW/ryrfiMbk0=","X-Google-Smtp-Source":"ACJfBovv32AgozqfYO07UVFMuuNND74nZih/M6KNA5LB/TXst+IGreiG87hkX/HRamwBG8Tac3qhpBIi8WHviBKVxkM=","X-Received":"by 10.28.92.4 with SMTP id q4mr2150315wmb.42.1513260013100; Thu,\n\t14 Dec 2017 06:00:13 -0800 (PST)","MIME-Version":"1.0","In-Reply-To":"<87zi6lza7i.fsf@dusky.pond.sub.org>","References":"<20170911110623.24981-1-marcandre.lureau@redhat.com>\n\t<20170911110623.24981-42-marcandre.lureau@redhat.com>\n\t<87zi6lza7i.fsf@dusky.pond.sub.org>","From":"=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@gmail.com>","Date":"Thu, 14 Dec 2017 15:00:12 +0100","Message-ID":"<CAJ+F1CLe-=UOtVSN+Pnou1uOVF+sDqus3KUdJfNO5oa+VZt2=Q@mail.gmail.com>","To":"Markus Armbruster <armbru@redhat.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c09::22a","Subject":"Re: [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"QEMU <qemu-devel@nongnu.org>, Michael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1822385,"web_url":"http://patchwork.ozlabs.org/comment/1822385/","msgid":"<87po7hxttx.fsf@dusky.pond.sub.org>","list_archive_url":null,"date":"2017-12-14T14:33:30","subject":"Re: [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma","submitter":{"id":2645,"url":"http://patchwork.ozlabs.org/api/people/2645/","name":"Markus Armbruster","email":"armbru@redhat.com"},"content":"Marc-André Lureau <marcandre.lureau@gmail.com> writes:\n\n> Hi\n>\n> On Thu, Dec 14, 2017 at 2:54 PM, Markus Armbruster <armbru@redhat.com> wrote:\n>> Marc-André Lureau <marcandre.lureau@redhat.com> writes:\n>>\n>>> Add a pragma that allows to tag the following expressions with a unit\n>>> name. By default, an expression has no unit name.\n>>\n>> Please explain the unit name's intended purpose.\n>>\n>\n> It's syccintly explained in the doc.\n\nThe commit message should state the patch's purpose.  When the patch\nadds documentation, and you'd rather not duplicate it in the commit\nmessage, a short summary plus a pointer there may do.\n\n>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n>>> ---\n>>>  scripts/qapi.py              | 9 ++++++++-\n>>>  docs/devel/qapi-code-gen.txt | 3 +++\n>>>  2 files changed, 11 insertions(+), 1 deletion(-)\n>>>\n>>> diff --git a/scripts/qapi.py b/scripts/qapi.py\n>>> index eb4ffdc06d..1d0defd638 100644\n>>> --- a/scripts/qapi.py\n>>> +++ b/scripts/qapi.py\n>>> @@ -279,10 +279,12 @@ class QAPISchemaParser(object):\n>>>          self.docs = []\n>>>          self.cur_doc = None\n>>>          self.accept()\n>>> +        self.unit = None\n>>>\n>>>          while self.tok is not None:\n>>>              info = {'file': fname, 'line': self.line,\n>>> -                    'parent': self.incl_info}\n>>> +                    'parent': self.incl_info,\n>>> +                    'unit': self.unit}\n>>>              if self.tok == '#':\n>>>                  self.reject_expr_doc()\n>>>                  self.cur_doc = self.get_doc(info)\n>>> @@ -371,6 +373,11 @@ class QAPISchemaParser(object):\n>>>                                     \"Pragma name-case-whitelist must be\"\n>>>                                     \" a list of strings\")\n>>>              name_case_whitelist = value\n>>> +        elif name == 'unit':\n>>> +            if not isinstance(value, str):\n>>> +                raise QAPISemError(info,\n>>> +                                   \"Pragma 'unit' must be string\")\n>>> +            self.unit = value\n>>>          else:\n>>>              raise QAPISemError(info, \"Unknown pragma '%s'\" % name)\n>>>\n>>> diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt\n>>> index 24fc6f74ee..37a27cd9d7 100644\n>>> --- a/docs/devel/qapi-code-gen.txt\n>>> +++ b/docs/devel/qapi-code-gen.txt\n>>> @@ -326,6 +326,9 @@ violate the rules on permitted return types.  Default is none.\n>>>  Pragma 'name-case-whitelist' takes a list of names that may violate\n>>>  rules on use of upper- vs. lower-case letters.  Default is none.\n>>>\n>>> +Pragma 'unit' takes a string value. It will set the unit name for the\n>>> +following expressions in the schema. Most code generator can filter\n>>> +based on a unit name. Default is none.\n>>\n>> Do you mean \"most code generators\"?\n>\n> The qapi code/doc generators.\n\nSo plural is intended.  Easy enough to fix.\n\n>>\n>> What does \"filtering\" mean?\n>\n> To be able to select a subset of expressions based on the unit name.\n\nLet's spell that out.\n\n>>>\n>>>  === Struct types ===\n>>\n>> Humor me: put two spaces after a sentence-ending period.\n>>\n>\n> I don't get what you mean.\n\nThis sentence ends with a period, which is followed by two spaces.  This\nsentence is followed by just one space. I prefer two.  A few\ninconsistencies have crept into this file over time, let's not add more.\nAll clear now?","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yyGPF1rW3z9sCZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Dec 2017 01:37:37 +1100 (AEDT)","from localhost ([::1]:41283 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1ePUdj-0003QE-9E\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Dec 2017 09:37:35 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:43276)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1ePUZu-0001WD-JB\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 09:33:47 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1ePUZq-0005Xj-IA\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 09:33:38 -0500","from mx1.redhat.com ([209.132.183.28]:49017)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <armbru@redhat.com>) id 1ePUZq-0005TK-4x\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 09:33:34 -0500","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id C579EC014181;\n\tThu, 14 Dec 2017 14:33:32 +0000 (UTC)","from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com\n\t[10.36.116.74])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 696737D963;\n\tThu, 14 Dec 2017 14:33:32 +0000 (UTC)","by blackfin.pond.sub.org (Postfix, from userid 1000)\n\tid D71001138658; Thu, 14 Dec 2017 15:33:30 +0100 (CET)"],"From":"Markus Armbruster <armbru@redhat.com>","To":"=?utf-8?q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@gmail.com>","References":"<20170911110623.24981-1-marcandre.lureau@redhat.com>\n\t<20170911110623.24981-42-marcandre.lureau@redhat.com>\n\t<87zi6lza7i.fsf@dusky.pond.sub.org>\n\t<CAJ+F1CLe-=UOtVSN+Pnou1uOVF+sDqus3KUdJfNO5oa+VZt2=Q@mail.gmail.com>","Date":"Thu, 14 Dec 2017 15:33:30 +0100","In-Reply-To":"<CAJ+F1CLe-=UOtVSN+Pnou1uOVF+sDqus3KUdJfNO5oa+VZt2=Q@mail.gmail.com>\n\t( =?utf-8?b?Ik1hcmMtQW5kcsOp?= Lureau\"'s message of \"Thu,\n\t14 Dec 2017 \t15:00:12 +0100\")","Message-ID":"<87po7hxttx.fsf@dusky.pond.sub.org>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tThu, 14 Dec 2017 14:33:32 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"QEMU <qemu-devel@nongnu.org>, Michael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1822473,"web_url":"http://patchwork.ozlabs.org/comment/1822473/","msgid":"<87zi6luwax.fsf@dusky.pond.sub.org>","list_archive_url":null,"date":"2017-12-14T16:08:22","subject":"Re: [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma","submitter":{"id":2645,"url":"http://patchwork.ozlabs.org/api/people/2645/","name":"Markus Armbruster","email":"armbru@redhat.com"},"content":"Marc-André Lureau <marcandre.lureau@redhat.com> writes:\n\n> Add a pragma that allows to tag the following expressions with a unit\n> name. By default, an expression has no unit name.\n>\n> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> ---\n>  scripts/qapi.py              | 9 ++++++++-\n>  docs/devel/qapi-code-gen.txt | 3 +++\n>  2 files changed, 11 insertions(+), 1 deletion(-)\n>\n> diff --git a/scripts/qapi.py b/scripts/qapi.py\n> index eb4ffdc06d..1d0defd638 100644\n> --- a/scripts/qapi.py\n> +++ b/scripts/qapi.py\n> @@ -279,10 +279,12 @@ class QAPISchemaParser(object):\n>          self.docs = []\n>          self.cur_doc = None\n>          self.accept()\n> +        self.unit = None\n>  \n>          while self.tok is not None:\n>              info = {'file': fname, 'line': self.line,\n> -                    'parent': self.incl_info}\n> +                    'parent': self.incl_info,\n> +                    'unit': self.unit}\n>              if self.tok == '#':\n>                  self.reject_expr_doc()\n>                  self.cur_doc = self.get_doc(info)\n> @@ -371,6 +373,11 @@ class QAPISchemaParser(object):\n>                                     \"Pragma name-case-whitelist must be\"\n>                                     \" a list of strings\")\n>              name_case_whitelist = value\n> +        elif name == 'unit':\n> +            if not isinstance(value, str):\n> +                raise QAPISemError(info,\n> +                                   \"Pragma 'unit' must be string\")\n> +            self.unit = value\n>          else:\n>              raise QAPISemError(info, \"Unknown pragma '%s'\" % name)\n>  \n> diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt\n> index 24fc6f74ee..37a27cd9d7 100644\n> --- a/docs/devel/qapi-code-gen.txt\n> +++ b/docs/devel/qapi-code-gen.txt\n> @@ -326,6 +326,9 @@ violate the rules on permitted return types.  Default is none.\n>  Pragma 'name-case-whitelist' takes a list of names that may violate\n>  rules on use of upper- vs. lower-case letters.  Default is none.\n>  \n> +Pragma 'unit' takes a string value. It will set the unit name for the\n> +following expressions in the schema. Most code generator can filter\n> +based on a unit name. Default is none.\n>  \n>  === Struct types ===\n\nTest coverage?","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yyJQn1BD9z9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Dec 2017 03:09:05 +1100 (AEDT)","from localhost ([::1]:41762 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1ePW4F-0007iG-8m\n\tfor incoming@patchwork.ozlabs.org; Thu, 14 Dec 2017 11:09:03 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:47137)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1ePW3l-0007hB-NY\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 11:08:34 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1ePW3g-0002Sk-2I\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 11:08:33 -0500","from mx1.redhat.com ([209.132.183.28]:38148)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <armbru@redhat.com>) id 1ePW3f-0002Rq-TB\n\tfor qemu-devel@nongnu.org; Thu, 14 Dec 2017 11:08:28 -0500","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 21414C0587F7;\n\tThu, 14 Dec 2017 16:08:27 +0000 (UTC)","from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com\n\t[10.36.116.74])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id C90416A510;\n\tThu, 14 Dec 2017 16:08:23 +0000 (UTC)","by blackfin.pond.sub.org (Postfix, from userid 1000)\n\tid 46B461138658; Thu, 14 Dec 2017 17:08:22 +0100 (CET)"],"From":"Markus Armbruster <armbru@redhat.com>","To":"=?utf-8?q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@redhat.com>","References":"<20170911110623.24981-1-marcandre.lureau@redhat.com>\n\t<20170911110623.24981-42-marcandre.lureau@redhat.com>","Date":"Thu, 14 Dec 2017 17:08:22 +0100","In-Reply-To":"<20170911110623.24981-42-marcandre.lureau@redhat.com> (\n\t=?utf-8?b?Ik1hcmMtQW5kcsOp?= Lureau\"'s message of \"Mon,\n\t11 Sep 2017 \t13:06:14 +0200\")","Message-ID":"<87zi6luwax.fsf@dusky.pond.sub.org>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tThu, 14 Dec 2017 16:08:27 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]