mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00:00
Fix qapi code generation fix
The fixes to qapi code generation had multiple bugs: - the Null class used to drop output was missing some methods - in some scripts it was never instantiated, leading to a None return, which is missing even more methods - the --source and --header options were swapped Luckily, all those bugs were hidden by a makefile bug which caused the old behaviour (with the race) to be invoked. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
committed by
Anthony Liguori
parent
73a511decc
commit
19bf7c8708
@ -183,9 +183,9 @@ for o, a in opts:
|
||||
elif o in ("-o", "--output-dir"):
|
||||
output_dir = a + "/"
|
||||
elif o in ("-c", "--source"):
|
||||
do_h = True
|
||||
elif o in ("-h", "--header"):
|
||||
do_c = True
|
||||
elif o in ("-h", "--header"):
|
||||
do_h = True
|
||||
|
||||
if not do_c and not do_h:
|
||||
do_c = True
|
||||
@ -201,13 +201,11 @@ except os.error, e:
|
||||
raise
|
||||
|
||||
def maybe_open(really, name, opt):
|
||||
class Null(object):
|
||||
def write(self, str):
|
||||
pass
|
||||
def read(self):
|
||||
return ''
|
||||
if really:
|
||||
return open(name, opt)
|
||||
else:
|
||||
import StringIO
|
||||
return StringIO.StringIO()
|
||||
|
||||
fdef = maybe_open(do_c, c_file, 'w')
|
||||
fdecl = maybe_open(do_h, h_file, 'w')
|
||||
|
Reference in New Issue
Block a user