Revision 19bf7c87

b/Makefile
177 177
test-qmp-input-visitor.o test-qmp-output-visitor.o test-qmp-commands.o qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
178 178
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
179 179

  
180
gen-out-type = $(subst .,-,$@)
180
gen-out-type = $(subst .,-,$(suffix $@))
181 181

  
182 182
$(qapi-dir)/test-qapi-types.c $(qapi-dir)/test-qapi-types.h :\
183 183
$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
b/scripts/qapi-commands.py
399 399
    elif o in ("-m", "--middle"):
400 400
        middle_mode = True
401 401
    elif o in ("-c", "--source"):
402
        do_h = True
403
    elif o in ("-h", "--header"):
404 402
        do_c = True
403
    elif o in ("-h", "--header"):
404
        do_h = True
405 405

  
406 406
if not do_c and not do_h:
407 407
    do_c = True
......
411 411
h_file = output_dir + prefix + h_file
412 412

  
413 413
def maybe_open(really, name, opt):
414
    class Null(object):
415
        def write(self, str):
416
            pass
417
        def read(self):
418
            return ''
419 414
    if really:
420 415
        return open(name, opt)
421 416
    else:
422
        return Null()
417
        import StringIO
418
        return StringIO.StringIO()
423 419

  
424 420
try:
425 421
    os.makedirs(output_dir)
b/scripts/qapi-types.py
183 183
    elif o in ("-o", "--output-dir"):
184 184
        output_dir = a + "/"
185 185
    elif o in ("-c", "--source"):
186
        do_h = True
187
    elif o in ("-h", "--header"):
188 186
        do_c = True
187
    elif o in ("-h", "--header"):
188
        do_h = True
189 189

  
190 190
if not do_c and not do_h:
191 191
    do_c = True
......
201 201
        raise
202 202

  
203 203
def maybe_open(really, name, opt):
204
    class Null(object):
205
        def write(self, str):
206
            pass
207
        def read(self):
208
            return ''
209 204
    if really:
210 205
        return open(name, opt)
206
    else:
207
        import StringIO
208
        return StringIO.StringIO()
211 209

  
212 210
fdef = maybe_open(do_c, c_file, 'w')
213 211
fdecl = maybe_open(do_h, h_file, 'w')
b/scripts/qapi-visit.py
159 159
    elif o in ("-o", "--output-dir"):
160 160
        output_dir = a + "/"
161 161
    elif o in ("-c", "--source"):
162
        do_h = True
163
    elif o in ("-h", "--header"):
164 162
        do_c = True
163
    elif o in ("-h", "--header"):
164
        do_h = True
165 165

  
166 166
if not do_c and not do_h:
167 167
    do_c = True
......
177 177
        raise
178 178

  
179 179
def maybe_open(really, name, opt):
180
    class Null(object):
181
        def write(self, str):
182
            pass
183
        def read(self):
184
            return ''
185 180
    if really:
186 181
        return open(name, opt)
182
    else:
183
        import StringIO
184
        return StringIO.StringIO()
187 185

  
188 186
fdef = maybe_open(do_c, c_file, 'w')
189 187
fdecl = maybe_open(do_h, h_file, 'w')

Also available in: Unified diff