于 2014/2/28 3:21, Eric Blake 写道:
On 02/27/2014 04:09 AM, Wenchao Xia wrote:
From: Wenchao Xia<xiaw...@linux.vnet.ibm.com>

Signed-off-by: Wenchao Xia<xiaw...@linux.vnet.ibm.com>
Signed-off-by: Wenchao Xia<wenchaoq...@gmail.com>
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):
     <xiaw...@linux.ibm.com>
TCVM.MEGACENTER.DE.IBM.COM received negative reply:
550 5.1.1<xiaw...@linux.ibm.com>: Recipient address rejected: User
unknown in local recipient table

  I am using wenchaoq...@gmail.com 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 an
s/discrminator/discriminator/




Reply via email to