From e18df14185e817ba735bce57ecdef9a55fb3d093 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Tue, 19 Jul 2011 14:50:29 -0500 Subject: Add hard build dependency on glib GLib is an extremely common library that has a portable thread implementation along with tons of other goodies. GLib and GObject have a fantastic amount of infrastructure we can leverage in QEMU including an object oriented programming infrastructure. Short term, it has a very nice thread pool implementation that we could leverage in something like virtio-9p. It also has a test harness implementation that this series will use. Signed-off-by: Anthony Liguori Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- Makefile.objs | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile.objs') diff --git a/Makefile.objs b/Makefile.objs index c43ed05c89..55d18bbbec 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -376,3 +376,4 @@ vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS) +vl.o: QEMU_CFLAGS+=$(GLIB_CFLAGS) -- cgit v1.2.3 From 2345c77c6d383bd804527720551b79b1d0400693 Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 19 Jul 2011 14:50:32 -0500 Subject: qapi: add QAPI visitor core Base definitions/includes for Visiter interface used by generated visiter/marshalling code. Includes a GenericList type. Our lists require an embedded element. Since these types are generated, if you want to use them in a different type of data structure, there's no easy way to add another embedded element. The solution is to have non-embedded lists and that what this is. Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- Makefile.objs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile.objs') diff --git a/Makefile.objs b/Makefile.objs index 55d18bbbec..3b68f5914a 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -372,6 +372,12 @@ endif libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o card_7816.o +###################################################################### +# qapi + +qapi-nested-y = qapi-visit-core.o +qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y)) + vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS) -- cgit v1.2.3 From c40cc0a0ddbcda2af446b40271025b3dbee119ce Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 19 Jul 2011 14:50:33 -0500 Subject: qapi: add QMP input visitor A type of Visiter class that is used to walk a qobject's structure and assign each entry to the corresponding native C type. Command marshaling function will use this to pull out QMP command parameters recieved over the wire and pass them as native arguments to the corresponding C functions. Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.objs') diff --git a/Makefile.objs b/Makefile.objs index 3b68f5914a..d86ecc1a3f 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -375,7 +375,7 @@ libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o ###################################################################### # qapi -qapi-nested-y = qapi-visit-core.o +qapi-nested-y = qapi-visit-core.o qmp-input-visitor.o qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y)) vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) -- cgit v1.2.3 From e4e6aa14ed377d808aba4643cd922403606d4dee Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 19 Jul 2011 14:50:34 -0500 Subject: qapi: add QMP output visitor Type of Visiter class that serves as the inverse of the input visitor: it takes a series of native C types and uses their values to construct a corresponding QObject. The command marshaling/dispatcher functions will use this to convert the output of QMP functions into a QObject that can be sent over the wire. Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.objs') diff --git a/Makefile.objs b/Makefile.objs index d86ecc1a3f..301d56576c 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -375,7 +375,7 @@ libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o ###################################################################### # qapi -qapi-nested-y = qapi-visit-core.o qmp-input-visitor.o +qapi-nested-y = qapi-visit-core.o qmp-input-visitor.o qmp-output-visitor.o qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y)) vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) -- cgit v1.2.3 From d5f3c29cf8d59fad4f3c657fc0a26510043bec65 Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 19 Jul 2011 14:50:35 -0500 Subject: qapi: add QAPI dealloc visitor Type of Visitor class that can be passed into a qapi-generated C type's visitor function to free() any heap-allocated data types. Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.objs') diff --git a/Makefile.objs b/Makefile.objs index 301d56576c..92c7b56512 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -375,7 +375,7 @@ libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o ###################################################################### # qapi -qapi-nested-y = qapi-visit-core.o qmp-input-visitor.o qmp-output-visitor.o +qapi-nested-y = qapi-visit-core.o qmp-input-visitor.o qmp-output-visitor.o qapi-dealloc-visitor.o qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y)) vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) -- cgit v1.2.3 From 43c20a43ca4b3fa265469887186eb0fee68e4a0d Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 19 Jul 2011 14:50:36 -0500 Subject: qapi: add QMP command registration/lookup functions Registration/lookup functions for that provide a lookup table for dispatching QMP commands. Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- Makefile.objs | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile.objs') diff --git a/Makefile.objs b/Makefile.objs index 92c7b56512..c918ee7f8f 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -376,6 +376,7 @@ libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o # qapi qapi-nested-y = qapi-visit-core.o qmp-input-visitor.o qmp-output-visitor.o qapi-dealloc-visitor.o +qapi-nested-y += qmp-registry.o qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y)) vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) -- cgit v1.2.3 From ab02ab2aa7a36d78a579642caa404abd99acdc6e Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 19 Jul 2011 14:50:37 -0500 Subject: qapi: add QMP dispatch functions Given an object recieved via QMP, this code uses the dispatch table provided by qmp_registry.c to call the corresponding marshalling/dispatch function and format return values/errors for delivery to the QMP. Currently only synchronous QMP functions are supported, but this will also be used for async QMP functions and QMP guest proxy dispatch as well. Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.objs') diff --git a/Makefile.objs b/Makefile.objs index c918ee7f8f..52ad77ba91 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -376,7 +376,7 @@ libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o # qapi qapi-nested-y = qapi-visit-core.o qmp-input-visitor.o qmp-output-visitor.o qapi-dealloc-visitor.o -qapi-nested-y += qmp-registry.o +qapi-nested-y += qmp-registry.o qmp-dispatch.o qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y)) vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) -- cgit v1.2.3