Revision e3193601

b/Makefile
7 7
ifeq ($(TRACE_BACKEND),dtrace)
8 8
GENERATED_HEADERS += trace-dtrace.h
9 9
endif
10
GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
10 11

  
11 12
ifneq ($(wildcard config-host.mak),)
12 13
# Put the all: rule here so that config-host.mak can contain dependencies.
......
187 188
$(qapi-dir)/qga-qapi-visit.c: $(qapi-dir)/qga-qapi-visit.h
188 189
$(qapi-dir)/qga-qapi-visit.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
189 190
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
191
$(qapi-dir)/qga-qmp-commands.h: $(qapi-dir)/qga-qmp-marshal.c
190 192
$(qapi-dir)/qga-qmp-marshal.c: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
191 193
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
192 194

  
195
qapi-types.c: qapi-types.h
196
qapi-types.h: $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
197
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "." < $<, "  GEN   $@")
198
qapi-visit.c: qapi-visit.h
199
qapi-visit.h: $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py
200
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "."  < $<, "  GEN   $@")
201
qmp-commands.h: qmp-marshal.c
202
qmp-marshal.c: $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
203
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -m -o "." < $<, "  GEN   $@")
204

  
193 205
test-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
194 206
test-visitor: test-visitor.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o qemu-error.o qemu-tool.o $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
195 207

  
b/Makefile.objs
406 406
qapi-nested-y += qmp-registry.o qmp-dispatch.o
407 407
qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y))
408 408

  
409
common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o $(qapi-obj-y)
410

  
409 411
######################################################################
410 412
# guest agent
411 413

  
b/Makefile.target
375 375

  
376 376
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
377 377

  
378
monitor.o: hmp-commands.h qmp-commands.h
378
monitor.o: hmp-commands.h qmp-commands-old.h
379 379

  
380 380
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
381 381

  
......
407 407
hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
408 408
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
409 409

  
410
qmp-commands.h: $(SRC_PATH)/qmp-commands.hx
410
qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
411 411
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
412 412

  
413 413
clean:
414 414
	rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
415 415
	rm -f *.d */*.d tcg/*.o ide/*.o 9pfs/*.o
416
	rm -f hmp-commands.h qmp-commands.h gdbstub-xml.c
416
	rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
417 417
ifdef CONFIG_TRACE_SYSTEMTAP
418 418
	rm -f *.stp
419 419
endif
b/monitor.c
122 122
        int  (*cmd_async)(Monitor *mon, const QDict *params,
123 123
                          MonitorCompletion *cb, void *opaque);
124 124
    } mhandler;
125
    bool qapi;
125 126
    int flags;
126 127
} mon_cmd_t;
127 128

  
......
3182 3183
};
3183 3184

  
3184 3185
static const mon_cmd_t qmp_cmds[] = {
3185
#include "qmp-commands.h"
3186
#include "qmp-commands-old.h"
3186 3187
    { /* NULL */ },
3187 3188
};
3188 3189

  
......
5107 5108
        goto err_out;
5108 5109
    }
5109 5110

  
5110
    if (strstart(cmd_name, "query-", &query_cmd)) {
5111
    cmd = qmp_find_cmd(cmd_name);
5112
    if (!cmd && strstart(cmd_name, "query-", &query_cmd)) {
5111 5113
        cmd = qmp_find_query_cmd(query_cmd);
5112
    } else {
5113
        cmd = qmp_find_cmd(cmd_name);
5114 5114
    }
5115

  
5116 5115
    if (!cmd) {
5117 5116
        qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
5118 5117
        goto err_out;
b/qapi-schema.json
1
# -*- Mode: Python -*-
2
#
3
# QAPI Schema

Also available in: Unified diff