Paolo Bonzini
fbcc3e5004
qemu-thread: optimize QemuLockCnt with futexes on Linux
...
This is complex, but I think it is reasonably documented in the source.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
Reviewed-by: Fam Zheng <famz@redhat.com >
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Message-id: 20170112180800.21085-5-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
2017-01-16 13:25:18 +00:00
Paolo Bonzini
d7c99a1282
aio: make ctx->list_lock a QemuLockCnt, subsuming ctx->walking_bh
...
This will make it possible to walk the list of bottom halves without
holding the AioContext lock---and in turn to call bottom half
handlers without holding the lock.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
Reviewed-by: Fam Zheng <famz@redhat.com >
Message-id: 20170112180800.21085-4-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
2017-01-16 13:25:17 +00:00
Paolo Bonzini
51dee5e465
qemu-thread: introduce QemuLockCnt
...
A QemuLockCnt comprises a counter and a mutex, with primitives
to increment and decrement the counter, and to take and release the
mutex. It can be used to do lock-free visits to a data structure
whenever mutexes would be too heavy-weight and the critical section
is too long for RCU.
This could be implemented simply by protecting the counter with the
mutex, but QemuLockCnt is harder to misuse and more efficient.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
Reviewed-by: Fam Zheng <famz@redhat.com >
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Message-id: 20170112180800.21085-3-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
2017-01-16 13:25:17 +00:00
Paolo Bonzini
cf2c02c8ea
aio: rename bh_lock to list_lock
...
This will be used for AioHandlers too. There is going to be little
or no contention, so it is better to reuse the same lock.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
Reviewed-by: Fam Zheng <famz@redhat.com >
Message-id: 20170112180800.21085-2-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
2017-01-16 13:25:17 +00:00
Paolo Bonzini
8f90b5e91d
block: get rid of bdrv_io_unplugged_begin/end
...
bdrv_io_plug and bdrv_io_unplug are only called (via their
BlockBackend equivalents) after starting asynchronous I/O.
bdrv_drain is not going to be called while they are running,
because---even if a coroutine runs for some reason---it will
only drain in the next iteration of the event loop through
bdrv_co_yield_to_drain.
So this mechanism is unnecessary, get rid of it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
Message-id: 20161129113334.605-1-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
2017-01-16 13:25:17 +00:00
Peter Maydell
2ccede18bd
Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.9-pull-request' into staging
...
# gpg: Signature made Sat 14 Jan 2017 09:06:31 GMT
# gpg: using RSA key 0xF30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com >"
# gpg: aka "Laurent Vivier <laurent@vivier.eu >"
# gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com >"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C
* remotes/vivier/tags/m68k-for-2.9-pull-request:
target-m68k: increment/decrement with SP
target-m68k: CAS doesn't need aligned access
target-m68k: manage pre-dec et post-inc in CAS
target-m68k: fix gen_flush_flags()
target-m68k: fix bit operation with immediate value
m68k: Remove PCI and USB from config file
target-m68k: Implement bfffo
target-m68k: Implement bitfield ops for memory
target-m68k: Implement bitfield ops for registers
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2017-01-16 12:41:35 +00:00
Peter Maydell
02f50ca0de
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20170113' into staging
...
Fixes and more queued patches
# gpg: Signature made Fri 13 Jan 2017 20:00:53 GMT
# gpg: using RSA key 0xAD1270CC4DD0279B
# gpg: Good signature from "Richard Henderson <rth7680@gmail.com >"
# gpg: aka "Richard Henderson <rth@redhat.com >"
# gpg: aka "Richard Henderson <rth@twiddle.net >"
# Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC 16A4 AD12 70CC 4DD0 279B
* remotes/rth/tags/pull-tcg-20170113:
tcg/aarch64: Fix tcg_out_movi
tcg/aarch64: Fix addsub2 for 0+C
target/arm: Fix ubfx et al for aarch64
tcg/s390: Fix merge error with facilities
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2017-01-16 11:17:38 +00:00
Marc-André Lureau
56e8bdd46a
build-sys: add qapi doc generation targets
...
Generate and install the man, txt and html versions of QAPI
documentation (generate and install qemu-doc.txt too).
Add it also to optional pdf/info targets.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Message-Id: <20170113144135.5150-22-marcandre.lureau@redhat.com >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 10:11:43 +01:00
Marc-André Lureau
f8bab10b4c
build-sys: add txt documentation rules
...
Build plain text documentation, and install it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
Message-Id: <20170113144135.5150-21-marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 10:11:43 +01:00
Marc-André Lureau
76480423a8
build-sys: use a generic TEXI2MAN rule
...
The recipe for making a man page from .texi is duplicated several
times over. Capture it in suitable pattern rules instead.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
Message-Id: <20170113144135.5150-20-marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 10:11:43 +01:00
Marc-André Lureau
bd3f5706d1
build-sys: remove dvi doc generation
...
There is no clear reason to have rules to generate dvi format
documentation, pdf is generally better supported nowadays.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
Message-Id: <20170113144135.5150-19-marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 10:11:43 +01:00
Marc-André Lureau
e9ee06bdf0
build-sys: use --no-split for info
...
Splitting the info files doesn't bring much benefits these days.
This fixes also untracked generated info files from git ignore.
Let's use MAKEINFOFLAGS for common flags, --number-sections is already
the default anyway, so adding it doesn't change the info output.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
Message-Id: <20170113144135.5150-18-marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 10:11:43 +01:00
Marc-André Lureau
c051a4c202
docs: add qemu logo to pdf
...
Add a logo to texi2pdf output. Other formats (info/html) are left as
future improvements.
The PDF (needed by texi2pdf for vectorized images) was generated from
pc-bios/qemu_logo.svg like this:
inkscape --export-pdf=docs/qemu_logo.pdf pc-bios/qemu_logo.svg
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
Message-Id: <20170113144135.5150-17-marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 10:11:43 +01:00
Marc-André Lureau
3313b6124b
qapi: add qapi2texi script
...
As the name suggests, the qapi2texi script converts JSON QAPI
description into a texi file suitable for different target
formats (info/man/txt/pdf/html...).
It parses the following kind of blocks:
Free-form:
##
# = Section
# == Subsection
#
# Some text foo with *emphasis*
# 1. with a list
# 2. like that
#
# And some code:
# | $ echo foo
# | -> do this
# | <- get that
#
##
Symbol description:
##
# @symbol:
#
# Symbol body ditto ergo sum. Foo bar
# baz ding.
#
# @param1: the frob to frobnicate
# @param2: #optional how hard to frobnicate
#
# Returns: the frobnicated frob.
# If frob isn't frobnicatable, GenericError.
#
# Since: version
# Notes: notes, comments can have
# - itemized list
# - like this
#
# Example:
#
# -> { "execute": "quit" }
# <- { "return": {} }
#
##
That's roughly following the following EBNF grammar:
api_comment = "##\n" comment "##\n"
comment = freeform_comment | symbol_comment
freeform_comment = { "# " text "\n" | "#\n" }
symbol_comment = "# @" name ":\n" { member | tag_section | freeform_comment }
member = "# @" name ':' [ text ] "\n" freeform_comment
tag_section = "# " ( "Returns:", "Since:", "Note:", "Notes:", "Example:", "Examples:" ) [ text ] "\n" freeform_comment
text = free text with markup
Note that the grammar is ambiguous: a line "# @foo:\n" can be parsed
both as freeform_comment and as symbol_comment. The actual parser
recognizes symbol_comment.
See docs/qapi-code-gen.txt for more details.
Deficiencies and limitations:
- the generated QMP documentation includes internal types
- union type support is lacking
- type information is lacking in generated documentation
- doc comment error message positions are imprecise, they point
to the beginning of the comment.
- a few minor issues, all marked TODO/FIXME in the code
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Message-Id: <20170113144135.5150-16-marcandre.lureau@redhat.com >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
[test-qapi.py tweaked to avoid trailing empty lines in .out]
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 10:10:35 +01:00
Marc-André Lureau
231aaf3a82
qmp-events: move 'MIGRATION_PASS' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:50 +01:00
Marc-André Lureau
a102a4acad
qmp-events: move 'DUMP_COMPLETED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:50 +01:00
Marc-André Lureau
e602f0b4e7
qmp-events: move 'MEM_UNPLUG_ERROR' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:50 +01:00
Marc-André Lureau
14df1ea168
qmp-events: move 'VSERPORT_CHANGE' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:50 +01:00
Marc-André Lureau
2ee7fea7ce
qmp-events: move 'QUORUM_REPORT_BAD' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:50 +01:00
Marc-André Lureau
9dcbe9a7e8
qmp-events: move 'QUORUM_FAILURE' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:50 +01:00
Marc-André Lureau
449dbec15a
qmp-events: move 'GUEST_PANICKED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
a030dc0029
qmp-events: move 'BALLOON_CHANGE' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
622b3a6a51
qmp-events: move 'ACPI_DEVICE_OST' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
bce911ce26
qmp-events: move 'MIGRATION' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
e6bcb080f9
qmp-events: move 'SPICE_MIGRATE_COMPLETED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
93ab0fc3c3
qmp-events: move 'SPICE_DISCONNECTED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
da08e2a5a2
qmp-events: move 'SPICE_INITIALIZED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
5db6670347
qmp-events: move 'SPICE_CONNECTED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
659789ba36
qmp-events: move 'VNC_DISCONNECTED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
99ab2471a4
qmp-events: move 'VNC_INITIALIZED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
f46052fd13
qmp-events: move 'VNC_CONNECTED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
5dbdcf4324
qmp-events: move 'NIC_RX_FILTER_CHANGED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
cdc94a1b3e
qmp-events: move 'DEVICE_DELETED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
9ba5cec9dd
qmp-events: move 'WATCHDOG' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
73c41bfd31
qmp-events: move 'RTC_CHANGE' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
aa496f9812
qmp-events: move 'WAKEUP' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
4de62c38a5
qmp-events: move 'SUSPEND_DISK' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
6f3cc5406b
qmp-events: move 'SUSPEND' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:49 +01:00
Marc-André Lureau
a2235a0499
qmp-events: move 'RESUME' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
138c454c0f
qmp-events: move 'STOP' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
7a2aae7a36
qmp-events: move 'RESET' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
189d43bed6
qmp-events: move 'POWERDOWN' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
12defe50f8
qmp-events: move 'SHUTDOWN' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
01b7d4be5c
qmp-events: move 'DEVICE_TRAY_MOVED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
11a3dee1b9
qmp-events: move 'BLOCK_JOB_READY' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
af0e09106c
qmp-events: move 'BLOCK_JOB_ERROR' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
e161df3939
qmp-events: move 'BLOCK_JOB_CANCELLED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
e21e65b212
qmp-events: move 'BLOCK_JOB_COMPLETED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
07c9f583d5
qmp-events: move 'BLOCK_IO_ERROR' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00
Marc-André Lureau
370d4eba7d
qmp-events: move 'BLOCK_IMAGE_CORRUPTED' doc to schema
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Signed-off-by: Markus Armbruster <armbru@redhat.com >
2017-01-16 09:19:48 +01:00