|
| From: | Wenchao Xia |
| Subject: | Re: [Qemu-devel] [PATCH V8 04/10] qapi script: check correctness of union |
| Date: | Sat, 01 Mar 2014 07:19:11 +0800 |
| User-agent: | Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 |
δΊ 2014/2/28 3:21, Eric Blake ει:
On 02/27/2014 04:09 AM, Wenchao Xia wrote:From: Wenchao Xia<address@hidden> Signed-off-by: Wenchao Xia<address@hidden> Signed-off-by: Wenchao Xia<address@hidden>Double-S-o-B. I've also noticed that I'm getting undeliverable mail rejections from your linux.vnet.ibm.com address: TCVM.MEGACENTER.DE.IBM.COM unable to deliver following mail to recipient(s): <address@hidden> TCVM.MEGACENTER.DE.IBM.COM received negative reply: 550 5.1.1<address@hidden>: Recipient address rejected: User unknown in local recipient table
I am using address@hidden now, yep I should fix the SoB problem.
--- scripts/qapi.py | 106 +++++++++++++++++++- tests/Makefile | 4 +- diff --git a/scripts/qapi.py b/scripts/qapi.py index 1954292..cea346f 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -50,6 +50,15 @@ class QAPISchemaError(Exception): def __str__(self): return "%s:%s:%s: %s" % (self.fp.name, self.line, self.col, self.msg) +class QAPIExprError(Exception): + def __init__(self, expr_info, msg): + self.fp = expr_info['fp'] + self.line = expr_info['line'] + self.msg = msg + + def __str__(self): + return "%s:%s: %s" % (self.fp.name, self.line, self.msg) + class QAPISchema: def __init__(self, fp): @@ -64,7 +73,10 @@ class QAPISchema: self.accept() while self.tok != None: - self.exprs.append(self.get_expr(False)) + expr_info = {'fp': fp, 'line': self.line} + expr_elem = {'expr': self.get_expr(False), + 'info': expr_info} + self.exprs.append(expr_elem)Should these two hunks be part of 3/10? Or at least as a separate patch? Or at least mentioned in the commit message?
Patch 3/10 only remember line number in class QAPISchema, as well as its member "cursor". The above code add line info in exprs, and if they are moved to last patch, the caller code should also go, which is a main part of patch. I'd like to improve the commit messages instead.
@@ -162,6 +174,89 @@ class QAPISchema: raise QAPISchemaError(self, 'Expected "{", "[" or string') return expr +def find_base_fields(base): + base_struct_define = find_struct(base) + if not base_struct_define: + return None + return base_struct_define['data'] + +# Return the discriminator enum define if discrminator is specified as ans/discrminator/discriminator/
| [Prev in Thread] | Current Thread | [Next in Thread] |