2012-11-16 18:35:27 +01:00
|
|
|
#######################################################################
|
2012-12-20 16:10:26 +01:00
|
|
|
# Common libraries for tools and emulators
|
2015-10-31 06:39:52 +01:00
|
|
|
stub-obj-y = stubs/ crypto/
|
qapi: New QMP command query-qmp-schema for QMP introspection
qapi/introspect.json defines the introspection schema. It's designed
for QMP introspection, but should do for similar uses, such as QGA.
The introspection schema does not reflect all the rules and
restrictions that apply to QAPI schemata. A valid QAPI schema has an
introspection value conforming to the introspection schema, but the
converse is not true.
Introspection lowers away a number of schema details, and makes
implicit things explicit:
* The built-in types are declared with their JSON type.
All integer types are mapped to 'int', because how many bits we use
internally is an implementation detail. It could be pressed into
external interface service as very approximate range information,
but that's a bad idea. If we need range information, we better do
it properly.
* Implicit type definitions are made explicit, and given
auto-generated names:
- Array types, named by appending "List" to the name of their
element type, like in generated C.
- The enumeration types implicitly defined by simple union types,
named by appending "Kind" to the name of their simple union type,
like in generated C.
- Types that don't occur in generated C. Their names start with ':'
so they don't clash with the user's names.
* All type references are by name.
* The struct and union types are generalized into an object type.
* Base types are flattened.
* Commands take a single argument and return a single result.
Dictionary argument or list result is an implicit type definition.
The empty object type is used when a command takes no arguments or
produces no results.
The argument is always of object type, but the introspection schema
doesn't reflect that.
The 'gen': false directive is omitted as implementation detail.
The 'success-response' directive is omitted as well for now, even
though it's not an implementation detail, because it's not used by
QMP.
* Events carry a single data value.
Implicit type definition and empty object type use, just like for
commands.
The value is of object type, but the introspection schema doesn't
reflect that.
* Types not used by commands or events are omitted.
Indirect use counts as use.
* Optional members have a default, which can only be null right now
Instead of a mandatory "optional" flag, we have an optional default.
No default means mandatory, default null means optional without
default value. Non-null is available for optional with default
(possible future extension).
* Clients should *not* look up types by name, because type names are
not ABI. Look up the command or event you're interested in, then
follow the references.
TODO Should we hide the type names to eliminate the temptation?
New generator scripts/qapi-introspect.py computes an introspection
value for its input, and generates a C variable holding it.
It can generate awfully long lines. Marked TODO.
A new test-qmp-input-visitor test case feeds its result for both
tests/qapi-schema/qapi-schema-test.json and qapi-schema.json to a
QmpInputVisitor to verify it actually conforms to the schema.
New QMP command query-qmp-schema takes its return value from that
variable. Its reply is some 85KiBytes for me right now.
If this turns out to be too much, we have a couple of options:
* We can use shorter names in the JSON. Not the QMP style.
* Optionally return the sub-schema for commands and events given as
arguments.
Right now qmp_query_schema() sends the string literal computed by
qmp-introspect.py. To compute sub-schema at run time, we'd have to
duplicate parts of qapi-introspect.py in C. Unattractive.
* Let clients cache the output of query-qmp-schema.
It changes only on QEMU upgrades, i.e. rarely. Provide a command
query-qmp-schema-hash. Clients can have a cache indexed by hash,
and re-query the schema only when they don't have it cached. Even
simpler: put the hash in the QMP greeting.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-09-16 13:06:28 +02:00
|
|
|
util-obj-y = util/ qobject/ qapi/
|
2018-02-11 10:36:05 +01:00
|
|
|
util-obj-y += qapi/qapi-builtin-types.o
|
|
|
|
util-obj-y += qapi/qapi-types.o
|
qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth. These monolithic headers get included all
over the place. In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.
We wouldn't write such monolithic headers by hand. It stands to
reason that we shouldn't generate them, either.
Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module. Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before. If you need less, you can include
one or more of the sub-module headers. To be exploited shortly.
Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c. This happens when commands returning the same
type occur in multiple modules. Not worth avoiding.
Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn. This requires temporary hacks in
commands.py and events.py. Similarly, c_name() must temporarily
be taught to munge '/' in common.py. They'll go away with the rename.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-11 10:36:00 +01:00
|
|
|
util-obj-y += qapi/qapi-types-block-core.o
|
|
|
|
util-obj-y += qapi/qapi-types-block.o
|
|
|
|
util-obj-y += qapi/qapi-types-char.o
|
|
|
|
util-obj-y += qapi/qapi-types-common.o
|
|
|
|
util-obj-y += qapi/qapi-types-crypto.o
|
|
|
|
util-obj-y += qapi/qapi-types-introspect.o
|
|
|
|
util-obj-y += qapi/qapi-types-migration.o
|
2018-02-27 00:13:27 +01:00
|
|
|
util-obj-y += qapi/qapi-types-misc.o
|
qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth. These monolithic headers get included all
over the place. In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.
We wouldn't write such monolithic headers by hand. It stands to
reason that we shouldn't generate them, either.
Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module. Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before. If you need less, you can include
one or more of the sub-module headers. To be exploited shortly.
Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c. This happens when commands returning the same
type occur in multiple modules. Not worth avoiding.
Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn. This requires temporary hacks in
commands.py and events.py. Similarly, c_name() must temporarily
be taught to munge '/' in common.py. They'll go away with the rename.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-11 10:36:00 +01:00
|
|
|
util-obj-y += qapi/qapi-types-net.o
|
|
|
|
util-obj-y += qapi/qapi-types-rocker.o
|
|
|
|
util-obj-y += qapi/qapi-types-run-state.o
|
|
|
|
util-obj-y += qapi/qapi-types-sockets.o
|
|
|
|
util-obj-y += qapi/qapi-types-tpm.o
|
|
|
|
util-obj-y += qapi/qapi-types-trace.o
|
|
|
|
util-obj-y += qapi/qapi-types-transaction.o
|
|
|
|
util-obj-y += qapi/qapi-types-ui.o
|
2018-02-11 10:36:05 +01:00
|
|
|
util-obj-y += qapi/qapi-builtin-visit.o
|
|
|
|
util-obj-y += qapi/qapi-visit.o
|
qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth. These monolithic headers get included all
over the place. In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.
We wouldn't write such monolithic headers by hand. It stands to
reason that we shouldn't generate them, either.
Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module. Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before. If you need less, you can include
one or more of the sub-module headers. To be exploited shortly.
Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c. This happens when commands returning the same
type occur in multiple modules. Not worth avoiding.
Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn. This requires temporary hacks in
commands.py and events.py. Similarly, c_name() must temporarily
be taught to munge '/' in common.py. They'll go away with the rename.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-11 10:36:00 +01:00
|
|
|
util-obj-y += qapi/qapi-visit-block-core.o
|
|
|
|
util-obj-y += qapi/qapi-visit-block.o
|
|
|
|
util-obj-y += qapi/qapi-visit-char.o
|
|
|
|
util-obj-y += qapi/qapi-visit-common.o
|
|
|
|
util-obj-y += qapi/qapi-visit-crypto.o
|
|
|
|
util-obj-y += qapi/qapi-visit-introspect.o
|
|
|
|
util-obj-y += qapi/qapi-visit-migration.o
|
2018-02-27 00:13:27 +01:00
|
|
|
util-obj-y += qapi/qapi-visit-misc.o
|
qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth. These monolithic headers get included all
over the place. In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.
We wouldn't write such monolithic headers by hand. It stands to
reason that we shouldn't generate them, either.
Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module. Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before. If you need less, you can include
one or more of the sub-module headers. To be exploited shortly.
Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c. This happens when commands returning the same
type occur in multiple modules. Not worth avoiding.
Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn. This requires temporary hacks in
commands.py and events.py. Similarly, c_name() must temporarily
be taught to munge '/' in common.py. They'll go away with the rename.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-11 10:36:00 +01:00
|
|
|
util-obj-y += qapi/qapi-visit-net.o
|
|
|
|
util-obj-y += qapi/qapi-visit-rocker.o
|
|
|
|
util-obj-y += qapi/qapi-visit-run-state.o
|
|
|
|
util-obj-y += qapi/qapi-visit-sockets.o
|
|
|
|
util-obj-y += qapi/qapi-visit-tpm.o
|
|
|
|
util-obj-y += qapi/qapi-visit-trace.o
|
|
|
|
util-obj-y += qapi/qapi-visit-transaction.o
|
|
|
|
util-obj-y += qapi/qapi-visit-ui.o
|
2018-02-11 10:36:05 +01:00
|
|
|
util-obj-y += qapi/qapi-events.o
|
qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth. These monolithic headers get included all
over the place. In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.
We wouldn't write such monolithic headers by hand. It stands to
reason that we shouldn't generate them, either.
Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module. Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before. If you need less, you can include
one or more of the sub-module headers. To be exploited shortly.
Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c. This happens when commands returning the same
type occur in multiple modules. Not worth avoiding.
Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn. This requires temporary hacks in
commands.py and events.py. Similarly, c_name() must temporarily
be taught to munge '/' in common.py. They'll go away with the rename.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-11 10:36:00 +01:00
|
|
|
util-obj-y += qapi/qapi-events-block-core.o
|
|
|
|
util-obj-y += qapi/qapi-events-block.o
|
|
|
|
util-obj-y += qapi/qapi-events-char.o
|
|
|
|
util-obj-y += qapi/qapi-events-common.o
|
|
|
|
util-obj-y += qapi/qapi-events-crypto.o
|
|
|
|
util-obj-y += qapi/qapi-events-introspect.o
|
|
|
|
util-obj-y += qapi/qapi-events-migration.o
|
2018-02-27 00:13:27 +01:00
|
|
|
util-obj-y += qapi/qapi-events-misc.o
|
qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth. These monolithic headers get included all
over the place. In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.
We wouldn't write such monolithic headers by hand. It stands to
reason that we shouldn't generate them, either.
Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module. Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before. If you need less, you can include
one or more of the sub-module headers. To be exploited shortly.
Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c. This happens when commands returning the same
type occur in multiple modules. Not worth avoiding.
Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn. This requires temporary hacks in
commands.py and events.py. Similarly, c_name() must temporarily
be taught to munge '/' in common.py. They'll go away with the rename.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-11 10:36:00 +01:00
|
|
|
util-obj-y += qapi/qapi-events-net.o
|
|
|
|
util-obj-y += qapi/qapi-events-rocker.o
|
|
|
|
util-obj-y += qapi/qapi-events-run-state.o
|
|
|
|
util-obj-y += qapi/qapi-events-sockets.o
|
|
|
|
util-obj-y += qapi/qapi-events-tpm.o
|
|
|
|
util-obj-y += qapi/qapi-events-trace.o
|
|
|
|
util-obj-y += qapi/qapi-events-transaction.o
|
|
|
|
util-obj-y += qapi/qapi-events-ui.o
|
2018-02-11 10:36:05 +01:00
|
|
|
util-obj-y += qapi/qapi-introspect.o
|
2012-11-16 18:35:27 +01:00
|
|
|
|
2016-12-12 13:49:01 +01:00
|
|
|
chardev-obj-y = chardev/
|
|
|
|
|
2010-01-06 20:24:05 +01:00
|
|
|
#######################################################################
|
|
|
|
# block-obj-y is code used by both qemu system emulation and qemu-img
|
|
|
|
|
2016-01-14 09:41:02 +01:00
|
|
|
block-obj-y += nbd/
|
2018-04-12 17:29:59 +02:00
|
|
|
block-obj-y += block.o blockjob.o job.o
|
2017-08-22 07:08:27 +02:00
|
|
|
block-obj-y += block/ scsi/
|
2013-06-05 14:19:41 +02:00
|
|
|
block-obj-y += qemu-io-cmds.o
|
2016-07-27 09:01:49 +02:00
|
|
|
block-obj-$(CONFIG_REPLICATION) += replication.o
|
2010-01-06 20:24:05 +01:00
|
|
|
|
2014-02-10 07:48:59 +01:00
|
|
|
block-obj-m = block/
|
|
|
|
|
2015-09-02 11:57:27 +02:00
|
|
|
#######################################################################
|
|
|
|
# crypto-obj-y is code used by both qemu system emulation and qemu-img
|
|
|
|
|
|
|
|
crypto-obj-y = crypto/
|
|
|
|
crypto-aes-obj-y = crypto/
|
2010-04-29 14:14:43 +02:00
|
|
|
|
2015-09-02 12:18:16 +02:00
|
|
|
#######################################################################
|
|
|
|
# qom-obj-y is code used by both qemu system emulation and qemu-img
|
|
|
|
|
|
|
|
qom-obj-y = qom/
|
|
|
|
|
2015-02-27 17:19:33 +01:00
|
|
|
#######################################################################
|
|
|
|
# io-obj-y is code used by both qemu system emulation and qemu-img
|
|
|
|
|
|
|
|
io-obj-y = io/
|
|
|
|
|
2010-01-06 20:24:05 +01:00
|
|
|
######################################################################
|
2011-11-15 13:47:11 +01:00
|
|
|
# Target independent part of system emulation. The long term path is to
|
|
|
|
# suppress *all* target specific code in case of system emulation, i.e. a
|
|
|
|
# single QEMU executable should support all CPUs and machines.
|
2010-01-06 20:24:05 +01:00
|
|
|
|
2013-01-19 11:06:47 +01:00
|
|
|
ifeq ($(CONFIG_SOFTMMU),y)
|
2014-02-10 07:48:52 +01:00
|
|
|
common-obj-y = blockdev.o blockdev-nbd.o block/
|
2017-06-26 07:22:57 +02:00
|
|
|
common-obj-y += bootdevice.o iothread.o
|
2012-10-24 11:27:28 +02:00
|
|
|
common-obj-y += net/
|
2013-02-04 17:20:47 +01:00
|
|
|
common-obj-y += qdev-monitor.o device-hotplug.o
|
2010-06-12 07:49:30 +02:00
|
|
|
common-obj-$(CONFIG_WIN32) += os-win32.o
|
|
|
|
common-obj-$(CONFIG_POSIX) += os-posix.o
|
2010-05-21 11:54:32 +02:00
|
|
|
|
2012-05-22 13:46:08 +02:00
|
|
|
common-obj-$(CONFIG_LINUX) += fsdev/
|
|
|
|
|
2014-12-12 12:13:38 +01:00
|
|
|
common-obj-y += migration/
|
2010-01-06 20:24:05 +01:00
|
|
|
|
2012-05-22 13:49:02 +02:00
|
|
|
common-obj-y += audio/
|
2018-03-06 08:40:49 +01:00
|
|
|
common-obj-m += audio/
|
2012-05-29 11:08:47 +02:00
|
|
|
common-obj-y += hw/
|
2012-12-17 18:17:08 +01:00
|
|
|
|
2015-09-17 18:23:37 +02:00
|
|
|
common-obj-y += replay/
|
|
|
|
|
2012-05-22 13:48:15 +02:00
|
|
|
common-obj-y += ui/
|
2018-03-01 11:05:41 +01:00
|
|
|
common-obj-m += ui/
|
2012-05-29 11:08:47 +02:00
|
|
|
common-obj-y += bt-host.o bt-vhci.o
|
2014-05-02 13:40:53 +02:00
|
|
|
bt-host.o-cflags := $(BLUEZ_CFLAGS)
|
2010-07-07 20:57:52 +02:00
|
|
|
|
2012-10-05 19:39:33 +02:00
|
|
|
common-obj-y += dma-helpers.o
|
|
|
|
common-obj-y += vl.o
|
2014-05-02 13:40:53 +02:00
|
|
|
vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS)
|
2017-10-24 14:20:43 +02:00
|
|
|
common-obj-$(CONFIG_TPM) += tpm.o
|
2010-01-06 20:24:05 +01:00
|
|
|
|
2012-05-22 13:49:43 +02:00
|
|
|
common-obj-$(CONFIG_SLIRP) += slirp/
|
2010-01-06 20:24:05 +01:00
|
|
|
|
2012-06-25 17:03:47 +02:00
|
|
|
common-obj-y += backends/
|
2017-05-29 10:39:42 +02:00
|
|
|
common-obj-y += chardev/
|
2012-06-25 17:03:47 +02:00
|
|
|
|
2013-01-19 11:06:46 +01:00
|
|
|
common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
|
2017-09-07 10:53:16 +02:00
|
|
|
qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS)
|
|
|
|
qemu-seccomp.o-libs := $(SECCOMP_LIBS)
|
2012-08-14 23:44:05 +02:00
|
|
|
|
2015-05-24 22:20:14 +02:00
|
|
|
common-obj-$(CONFIG_FDT) += device_tree.o
|
|
|
|
|
2011-07-19 21:50:32 +02:00
|
|
|
######################################################################
|
|
|
|
# qapi
|
|
|
|
|
2018-02-11 10:36:05 +01:00
|
|
|
common-obj-y += qapi/qapi-commands.o
|
qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth. These monolithic headers get included all
over the place. In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.
We wouldn't write such monolithic headers by hand. It stands to
reason that we shouldn't generate them, either.
Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module. Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before. If you need less, you can include
one or more of the sub-module headers. To be exploited shortly.
Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c. This happens when commands returning the same
type occur in multiple modules. Not worth avoiding.
Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn. This requires temporary hacks in
commands.py and events.py. Similarly, c_name() must temporarily
be taught to munge '/' in common.py. They'll go away with the rename.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-11 10:36:00 +01:00
|
|
|
common-obj-y += qapi/qapi-commands-block-core.o
|
|
|
|
common-obj-y += qapi/qapi-commands-block.o
|
|
|
|
common-obj-y += qapi/qapi-commands-char.o
|
|
|
|
common-obj-y += qapi/qapi-commands-common.o
|
|
|
|
common-obj-y += qapi/qapi-commands-crypto.o
|
|
|
|
common-obj-y += qapi/qapi-commands-introspect.o
|
|
|
|
common-obj-y += qapi/qapi-commands-migration.o
|
2018-02-27 00:13:27 +01:00
|
|
|
common-obj-y += qapi/qapi-commands-misc.o
|
qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth. These monolithic headers get included all
over the place. In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.
We wouldn't write such monolithic headers by hand. It stands to
reason that we shouldn't generate them, either.
Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module. Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before. If you need less, you can include
one or more of the sub-module headers. To be exploited shortly.
Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c. This happens when commands returning the same
type occur in multiple modules. Not worth avoiding.
Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn. This requires temporary hacks in
commands.py and events.py. Similarly, c_name() must temporarily
be taught to munge '/' in common.py. They'll go away with the rename.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-11 10:36:00 +01:00
|
|
|
common-obj-y += qapi/qapi-commands-net.o
|
|
|
|
common-obj-y += qapi/qapi-commands-rocker.o
|
|
|
|
common-obj-y += qapi/qapi-commands-run-state.o
|
|
|
|
common-obj-y += qapi/qapi-commands-sockets.o
|
|
|
|
common-obj-y += qapi/qapi-commands-tpm.o
|
|
|
|
common-obj-y += qapi/qapi-commands-trace.o
|
|
|
|
common-obj-y += qapi/qapi-commands-transaction.o
|
|
|
|
common-obj-y += qapi/qapi-commands-ui.o
|
2018-02-11 10:36:05 +01:00
|
|
|
common-obj-y += qapi/qapi-introspect.o
|
2011-09-02 19:34:48 +02:00
|
|
|
common-obj-y += qmp.o hmp.o
|
2013-01-19 11:06:47 +01:00
|
|
|
endif
|
2011-09-02 19:34:47 +02:00
|
|
|
|
2012-12-20 15:24:49 +01:00
|
|
|
#######################################################################
|
|
|
|
# Target-independent parts used in system and user emulation
|
2016-06-28 20:37:27 +02:00
|
|
|
common-obj-y += cpus-common.o
|
2013-01-19 11:06:47 +01:00
|
|
|
common-obj-y += hw/
|
|
|
|
common-obj-y += qom/
|
|
|
|
common-obj-y += disas/
|
2012-03-04 21:32:36 +01:00
|
|
|
|
2013-08-08 20:18:07 +02:00
|
|
|
######################################################################
|
|
|
|
# Resource file for Windows executables
|
|
|
|
version-obj-$(CONFIG_WIN32) += $(BUILD_DIR)/version.o
|
|
|
|
|
2014-05-30 14:11:56 +02:00
|
|
|
######################################################################
|
|
|
|
# tracing
|
|
|
|
util-obj-y += trace/
|
|
|
|
target-obj-y += trace/
|
|
|
|
|
2011-08-11 22:38:12 +02:00
|
|
|
######################################################################
|
|
|
|
# guest agent
|
|
|
|
|
2018-02-11 10:36:05 +01:00
|
|
|
# FIXME: a few definitions from qapi/qapi-types.o and
|
|
|
|
# qapi/qapi-visit.o are needed by libqemuutil.a. These should be
|
|
|
|
# extracted into a QAPI schema module, or perhaps a separate schema.
|
2014-08-07 04:34:41 +02:00
|
|
|
qga-obj-y = qga/
|
qemu-ga: Add Windows VSS provider and requester as DLL
Adds VSS provider and requester as a qga-vss.dll, which is loaded by
Windows VSS service as well as by qemu-ga.
"provider.cpp" implements a basic stub of a software VSS provider.
Currently, this module only relays a frozen event from VSS service to the
agent, and thaw event from the agent to VSS service, to block VSS process
to keep the system frozen while snapshots are taken at the host.
To register the provider to the guest system as COM+ application, the type
library (.tlb) for qga-vss.dll is required. To build it from COM IDL (.idl),
VisualC++, MIDL and stdole2.tlb in Windows SDK are required. This patch also
adds pre-compiled .tlb file in the repository in order to enable
cross-compile qemu-ga.exe for Windows with VSS support.
"requester.cpp" provides the VSS requester to kick the VSS snapshot process.
Qemu-ga.exe works without the DLL, although fsfreeze features are disabled.
These functions are only supported in Windows 2003 or later. In older
systems, fsfreeze features are disabled.
In several versions of Windows which don't support attribute
VSS_VOLSNAP_ATTR_NO_AUTORECOVERY, DoSnapshotSet fails with error
VSS_E_OBJECT_NOT_FOUND. In this patch, we just ignore this error.
To solve this fundamentally, we need a framework to handle mount writable
snapshot on guests, which is required by VSS auto-recovery feature
(cleanup phase after a snapshot is taken).
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-07 17:40:18 +02:00
|
|
|
qga-vss-dll-obj-y = qga/
|
2014-09-08 11:17:48 +02:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# contrib
|
2017-07-14 10:33:45 +02:00
|
|
|
ivshmem-client-obj-$(CONFIG_IVSHMEM) = contrib/ivshmem-client/
|
|
|
|
ivshmem-server-obj-$(CONFIG_IVSHMEM) = contrib/ivshmem-server/
|
contrib: add libvhost-user
Add a library to help implementing vhost-user backend (or slave).
Dealing with vhost-user as an application developer isn't so easy: you
have all the trouble with any protocol: validation, unix ancillary data,
shared memory, eventfd, logging, and on top of that you need to deal
with virtio queues, if possible efficiently.
qemu test has a nice vhost-user testing application vhost-user-bridge,
which implements most of vhost-user, and virtio.c which implements
virtqueues manipulation. Based on these two, I tried to make a simple
library, reusable for tests or development of new vhost-user scenarios.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[Felipe: set used_idx copy on SET_VRING_ADDR and update shadow avail idx
on SET_VRING_BASE]
Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-10-18 11:24:04 +02:00
|
|
|
libvhost-user-obj-y = contrib/libvhost-user/
|
vhost-user-scsi: Introduce a vhost-user-scsi sample application
This commit introduces a vhost-user-scsi backend sample application. It
must be linked with libiscsi and libvhost-user.
To use it, compile with:
$ make vhost-user-scsi
And run as follows:
$ ./vhost-user-scsi -u vus.sock -i iscsi://uri_to_target/
$ qemu-system-x86_64 --enable-kvm -m 512 \
-object memory-backend-file,id=mem,size=512m,share=on,mem-path=guestmem \
-numa node,memdev=mem \
-chardev socket,id=vhost-user-scsi,path=vus.sock \
-device vhost-user-scsi-pci,chardev=vhost-user-scsi \
The application is currently limited at one LUN only and it processes
requests synchronously (therefore only achieving QD1). The purpose of
the code is to show how a backend can be implemented and to test the
vhost-user-scsi Qemu implementation.
If a different instance of this vhost-user-scsi application is executed
at a remote host, a VM can be live migrated to such a host.
Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
Message-Id: <1488479153-21203-5-git-send-email-felipe@nutanix.com>
2017-03-02 19:25:53 +01:00
|
|
|
vhost-user-scsi.o-cflags := $(LIBISCSI_CFLAGS)
|
|
|
|
vhost-user-scsi.o-libs := $(LIBISCSI_LIBS)
|
|
|
|
vhost-user-scsi-obj-y = contrib/vhost-user-scsi/
|
2018-01-04 02:53:34 +01:00
|
|
|
vhost-user-blk-obj-y = contrib/vhost-user-blk/
|
2016-06-16 10:39:47 +02:00
|
|
|
|
|
|
|
######################################################################
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs =
|
|
|
|
trace-events-subdirs += util
|
|
|
|
trace-events-subdirs += crypto
|
|
|
|
trace-events-subdirs += io
|
|
|
|
trace-events-subdirs += migration
|
|
|
|
trace-events-subdirs += block
|
2017-05-29 10:39:42 +02:00
|
|
|
trace-events-subdirs += chardev
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs += hw/block
|
|
|
|
trace-events-subdirs += hw/block/dataplane
|
|
|
|
trace-events-subdirs += hw/char
|
|
|
|
trace-events-subdirs += hw/intc
|
|
|
|
trace-events-subdirs += hw/net
|
2018-02-09 14:23:18 +01:00
|
|
|
trace-events-subdirs += hw/rdma
|
2018-02-09 14:44:14 +01:00
|
|
|
trace-events-subdirs += hw/rdma/vmw
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs += hw/virtio
|
|
|
|
trace-events-subdirs += hw/audio
|
|
|
|
trace-events-subdirs += hw/misc
|
2018-02-09 19:51:42 +01:00
|
|
|
trace-events-subdirs += hw/misc/macio
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs += hw/usb
|
|
|
|
trace-events-subdirs += hw/scsi
|
|
|
|
trace-events-subdirs += hw/nvram
|
|
|
|
trace-events-subdirs += hw/display
|
|
|
|
trace-events-subdirs += hw/input
|
|
|
|
trace-events-subdirs += hw/timer
|
|
|
|
trace-events-subdirs += hw/dma
|
|
|
|
trace-events-subdirs += hw/sparc
|
2017-12-21 08:32:57 +01:00
|
|
|
trace-events-subdirs += hw/sparc64
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs += hw/sd
|
|
|
|
trace-events-subdirs += hw/isa
|
|
|
|
trace-events-subdirs += hw/mem
|
|
|
|
trace-events-subdirs += hw/i386
|
|
|
|
trace-events-subdirs += hw/i386/xen
|
|
|
|
trace-events-subdirs += hw/9pfs
|
|
|
|
trace-events-subdirs += hw/ppc
|
|
|
|
trace-events-subdirs += hw/pci
|
2018-01-21 09:59:45 +01:00
|
|
|
trace-events-subdirs += hw/pci-host
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs += hw/s390x
|
|
|
|
trace-events-subdirs += hw/vfio
|
|
|
|
trace-events-subdirs += hw/acpi
|
|
|
|
trace-events-subdirs += hw/arm
|
|
|
|
trace-events-subdirs += hw/alpha
|
2017-10-08 22:47:27 +02:00
|
|
|
trace-events-subdirs += hw/hppa
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs += hw/xen
|
2017-09-18 21:01:25 +02:00
|
|
|
trace-events-subdirs += hw/ide
|
2018-03-03 02:18:41 +01:00
|
|
|
trace-events-subdirs += hw/tpm
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs += ui
|
|
|
|
trace-events-subdirs += audio
|
|
|
|
trace-events-subdirs += net
|
|
|
|
trace-events-subdirs += target/arm
|
|
|
|
trace-events-subdirs += target/i386
|
2017-03-04 19:56:52 +01:00
|
|
|
trace-events-subdirs += target/mips
|
2017-01-25 17:14:15 +01:00
|
|
|
trace-events-subdirs += target/sparc
|
|
|
|
trace-events-subdirs += target/s390x
|
|
|
|
trace-events-subdirs += target/ppc
|
|
|
|
trace-events-subdirs += qom
|
|
|
|
trace-events-subdirs += linux-user
|
|
|
|
trace-events-subdirs += qapi
|
2017-06-02 08:06:44 +02:00
|
|
|
trace-events-subdirs += accel/tcg
|
2017-06-02 08:06:46 +02:00
|
|
|
trace-events-subdirs += accel/kvm
|
2017-07-07 17:29:18 +02:00
|
|
|
trace-events-subdirs += nbd
|
scsi, file-posix: add support for persistent reservation management
It is a common requirement for virtual machine to send persistent
reservations, but this currently requires either running QEMU with
CAP_SYS_RAWIO, or using out-of-tree patches that let an unprivileged
QEMU bypass Linux's filter on SG_IO commands.
As an alternative mechanism, the next patches will introduce a
privileged helper to run persistent reservation commands without
expanding QEMU's attack surface unnecessarily.
The helper is invoked through a "pr-manager" QOM object, to which
file-posix.c passes SG_IO requests for PERSISTENT RESERVE OUT and
PERSISTENT RESERVE IN commands. For example:
$ qemu-system-x86_64
-device virtio-scsi \
-object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
-drive if=none,id=hd,driver=raw,file.filename=/dev/sdb,file.pr-manager=helper0
-device scsi-block,drive=hd
or:
$ qemu-system-x86_64
-device virtio-scsi \
-object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
-blockdev node-name=hd,driver=raw,file.driver=host_device,file.filename=/dev/sdb,file.pr-manager=helper0
-device scsi-block,drive=hd
Multiple pr-manager implementations are conceivable and possible, though
only one is implemented right now. For example, a pr-manager could:
- talk directly to the multipath daemon from a privileged QEMU
(i.e. QEMU links to libmpathpersist); this makes reservation work
properly with multipath, but still requires CAP_SYS_RAWIO
- use the Linux IOC_PR_* ioctls (they require CAP_SYS_ADMIN though)
- more interestingly, implement reservations directly in QEMU
through file system locks or a shared database (e.g. sqlite)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-21 18:58:56 +02:00
|
|
|
trace-events-subdirs += scsi
|
2017-01-25 17:14:15 +01:00
|
|
|
|
|
|
|
trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events)
|
|
|
|
|
|
|
|
trace-obj-y = trace-root.o
|
|
|
|
trace-obj-y += $(trace-events-subdirs:%=%/trace.o)
|
|
|
|
trace-obj-$(CONFIG_TRACE_UST) += trace-ust-all.o
|
|
|
|
trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace-root.o
|
|
|
|
trace-obj-$(CONFIG_TRACE_DTRACE) += $(trace-events-subdirs:%=%/trace-dtrace.o)
|