[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 9588c5: block: add missed aio_context_acquire
From: |
GitHub |
Subject: |
[Qemu-commits] [qemu/qemu] 9588c5: block: add missed aio_context_acquire into release... |
Date: |
Mon, 03 Apr 2017 10:00:10 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: 9588c5897b83a43c80b810ec44e575e1032378d4
https://github.com/qemu/qemu/commit/9588c5897b83a43c80b810ec44e575e1032378d4
Author: Denis V. Lunev <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M hw/core/qdev-properties-system.c
Log Message:
-----------
block: add missed aio_context_acquire into release_drive
Recently we expirience hang with iothreads enabled with the following
call trace:
Thread 1 (Thread 0x7fa95efebc80 (LWP 177117)):
0 ppoll () from /lib64/libc.so.6
2 qemu_poll_ns () at qemu-timer.c:313
3 aio_poll () at aio-posix.c:457
4 bdrv_flush () at block/io.c:2641
5 bdrv_close () at block.c:2143
6 bdrv_delete () at block.c:2352
7 bdrv_unref () at block.c:3429
8 blk_remove_bs () at block/block-backend.c:427
9 blk_delete () at block/block-backend.c:178
10 blk_unref () at block/block-backend.c:226
11 object_property_del_all () at qom/object.c:399
12 object_finalize () at qom/object.c:461
13 object_unref () at qom/object.c:898
14 object_property_del_child () at qom/object.c:422
15 qmp_marshal_device_del () at qmp-marshal.c:1145
16 handle_qmp_command () at /usr/src/debug/qemu-2.6.0/monitor.c:3929
Technically bdrv_flush() stucks in
while (rwco.ret == NOT_DONE) {
aio_poll(aio_context, true);
}
but rwco.ret is equal to 0 thus we have missed wakeup. Code investigation
reveals that we do not have performed aio_context_acquire() on this call
stack.
This patch adds missed lock.
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Max Reitz <address@hidden>
CC: Eric Blake <address@hidden>
CC: Markus Armbruster <address@hidden>
Message-id: address@hidden
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Commit: ca0b64e5ed5c60543ff4758c858f65cd090512f0
https://github.com/qemu/qemu/commit/ca0b64e5ed5c60543ff4758c858f65cd090512f0
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block/nbd.c
M blockdev-nbd.c
M chardev/char-socket.c
M ui/vnc.c
M util/qemu-sockets.c
Log Message:
-----------
nbd sockets vnc: Mark problematic address family tests TODO
Certain features make sense only with certain address families. For
instance, passing file descriptors requires AF_UNIX. Testing
SocketAddress's saddr->type == SOCKET_ADDRESS_KIND_UNIX is obvious,
but problematic: it can't recognize AF_UNIX when type ==
SOCKET_ADDRESS_KIND_FD.
Mark such tests of saddr->type TODO. We may want to check the address
family with getsockname() there.
Cc: Paolo Bonzini <address@hidden>
Cc: Gerd Hoffmann <address@hidden>
Cc: Daniel P. Berrange <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Commit: d2e49aad7259af943b72be761ee5c18e14acd71a
https://github.com/qemu/qemu/commit/d2e49aad7259af943b72be761ee5c18e14acd71a
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M chardev/char-socket.c
Log Message:
-----------
char: Fix socket with "type": "vsock" address
Watch this:
$ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2},
"package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "chardev-add", "arguments": { "id": "chr0", "backend": {
"type": "socket", "data": { "addr": { "type": "vsock", "data": { "cid": "CID",
"port": "P" }}}}}}
Aborted (core dumped)
Crashes because SocketAddress_to_str() is blissfully unaware of
SOCKET_ADDRESS_KIND_VSOCK. Fix that. Pick the output format to match
socket_parse(), just like the existing formats.
Cc: Stefan Hajnoczi <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Marc-André Lureau <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Commit: a6c76285f2e41535527a46edf4d158a2779545e1
https://github.com/qemu/qemu/commit/a6c76285f2e41535527a46edf4d158a2779545e1
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M io/dns-resolver.c
M ui/vnc.c
M util/qemu-sockets.c
Log Message:
-----------
io vnc sockets: Clean up SocketAddressKind switches
We have quite a few switches over SocketAddressKind. Some have case
labels for all enumeration values, others rely on a default label.
Some abort when the value isn't a valid SocketAddressKind, others
report an error then.
Unify as follows. Always provide case labels for all enumeration
values, to clarify intent. Abort when the value isn't a valid
SocketAddressKind, because the program state is messed up then.
Improve a few error messages while there.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Commit: 129c7d1c536d0c67a8781cb09fb5bdb3d0f6a2d0
https://github.com/qemu/qemu/commit/129c7d1c536d0c67a8781cb09fb5bdb3d0f6a2d0
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block.c
M block/file-posix.c
M block/nbd.c
M block/nfs.c
M block/rbd.c
M block/ssh.c
Log Message:
-----------
block: Document -drive problematic code and bugs
-blockdev and blockdev_add convert their arguments via QObject to
BlockdevOptions for qmp_blockdev_add(), which converts them back to
QObject, then to a flattened QDict. The QDict's members are typed
according to the QAPI schema.
-drive converts its argument via QemuOpts to a (flat) QDict. This
QDict's members are all QString.
Thus, the QType of a flat QDict member depends on whether it comes
from -drive or -blockdev/blockdev_add, except when the QAPI type maps
to QString, which is the case for 'str' and enumeration types.
The block layer core extracts generic configuration from the flat
QDict, and the block driver extracts driver-specific configuration.
Both commonly do so by converting (parts of) the flat QDict to
QemuOpts, which turns all values into strings. Not exactly elegant,
but correct.
However, A few places access the flat QDict directly:
* Most of them access members that are always QString. Correct.
* bdrv_open_inherit() accesses a boolean, carefully. Correct.
* nfs_config() uses a QObject input visitor. Correct only because the
visited type contains nothing but QStrings.
* nbd_config() and ssh_config() use a QObject input visitor, and the
visited types contain non-QStrings: InetSocketAddress members
@numeric, @to, @ipv4, @ipv6. -drive works as long as you don't try
to use them (they're all optional). @to is ignored anyway.
Reproducer:
-drive driver=ssh,server.host=h,server.port=22,server.ipv4,path=p
-drive
driver=nbd,server.type=inet,server.data.host=h,server.data.port=22,server.data.ipv4
both fail with "Invalid parameter type for 'data.ipv4', expected: boolean"
Add suitable comments to all these places. Mark the buggy ones FIXME.
"Fortunately", -drive's driver-specific options are entirely
undocumented.
Signed-off-by: Markus Armbruster <address@hidden>
Message-id: address@hidden
[mreitz: Fixed two typos]
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Commit: fce5d5386d8613e9659f1edc4be9c3f8b7cff073
https://github.com/qemu/qemu/commit/fce5d5386d8613e9659f1edc4be9c3f8b7cff073
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block/gluster.c
Log Message:
-----------
gluster: Prepare for SocketAddressFlat extension
qemu_gluster_glfs_init() and qemu_gluster_parse_json() rely on the
fact that SocketAddressFlatType has only two members
SOCKET_ADDRESS_FLAT_TYPE_INET and SOCKET_ADDRESS_FLAT_TYPE_UNIX.
Correct, but won't stay correct. Make them more robust.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Commit: 8bc0673f6dc2485b46da6de8204aaca2a711acea
https://github.com/qemu/qemu/commit/8bc0673f6dc2485b46da6de8204aaca2a711acea
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block/gluster.c
M qapi-schema.json
Log Message:
-----------
qapi-schema: SocketAddressFlat variants 'vsock' and 'fd'
Note that the new variants are impossible in qemu_gluster_glfs_init(),
because the gconf->server can only come from qemu_gluster_parse_uri()
or qemu_gluster_parse_json(), and neither can create anything but
'inet' or 'unix'.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Commit: 216411b83967ae19e3c9c520e13ceb8bb383890c
https://github.com/qemu/qemu/commit/216411b83967ae19e3c9c520e13ceb8bb383890c
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M include/qemu/sockets.h
M util/qemu-sockets.c
Log Message:
-----------
sockets: New helper socket_address_crumple()
SocketAddress is a simple union, and simple unions are awkward: they
have their variant members wrapped in a "data" object on the wire, and
require additional indirections in C. I intend to limit its use to
existing external interfaces. New ones should use SocketAddressFlat.
I further intend to convert all internal interfaces to
SocketAddressFlat. This helper should go away then.
Signed-off-by: Markus Armbruster <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Commit: 9445673ea67c272616b9f718396e267caa6446b7
https://github.com/qemu/qemu/commit/9445673ea67c272616b9f718396e267caa6446b7
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block/nbd.c
M qapi/block-core.json
M tests/qemu-iotests/147
Log Message:
-----------
nbd: Tidy up blockdev-add interface
SocketAddress is a simple union, and simple unions are awkward: they
have their variant members wrapped in a "data" object on the wire, and
require additional indirections in C. I intend to limit its use to
existing external interfaces, and convert all internal interfaces to
SocketAddressFlat.
BlockdevOptionsNbd is an external interface using SocketAddress. We
already use SocketAddressFlat elsewhere in blockdev-add. Replace it
by SocketAddressFlat while we can (it's new in 2.9) for simplicity and
consistency. For example,
{ "execute": "blockdev-add",
"arguments": { "node-name": "foo", "driver": "nbd",
"server": { "type": "inet",
"data": { "host": "localhost",
"port": "12345" } } } }
becomes
{ "execute": "blockdev-add",
"arguments": { "node-name": "foo", "driver": "nbd",
"server": { "type": "inet",
"host": "localhost", "port": "12345" } } }
Since the internal interfaces still take SocketAddress, this requires
conversion function socket_address_crumple(). It'll go away when I
update the interfaces.
Unfortunately, SocketAddress is also visible in -drive since 2.8:
-drive
if=none,driver=nbd,server.type=inet,server.data.host=127.0.0.1,server.data.port=12345
Nobody should be using it, as it's fairly new and has never been
documented, so adding still more compatibility gunk to keep it working
isn't worth the trouble. You now have to use
-drive
if=none,driver=nbd,server.type=inet,server.host=127.0.0.1,server.port=12345
Signed-off-by: Markus Armbruster <address@hidden>
Message-id: address@hidden
[mreitz: Change iotest 147 accordingly]
Because of this interface change, iotest 147 has to be adapted.
Unfortunately, we cannot just flatten all of the addresses because
nbd-server-start still takes a plain SocketAddress. Therefore, we need
both and this is most easily achieved by writing the SocketAddress into
the code and flattening it where necessary.
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Commit: d1c136885ba5b302f9781b8927a8ea2ee38cccd2
https://github.com/qemu/qemu/commit/d1c136885ba5b302f9781b8927a8ea2ee38cccd2
Author: Markus Armbruster <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block/sheepdog.c
M qapi/block-core.json
Log Message:
-----------
sheepdog: Fix blockdev-add
Commit 831acdc "sheepdog: Implement bdrv_parse_filename()" and commit
d282f34 "sheepdog: Support blockdev-add" have different ideas on how
the QemuOpts parameters for the server address are named. Fix that.
While there, rename BlockdevOptionsSheepdog member addr to server, for
consistency with BlockdevOptionsSsh, BlockdevOptionsGluster,
BlockdevOptionsNbd.
Commit 831acdc's example becomes
--drive
driver=sheepdog,server.type=inet,server.host=fido,server.port=7000,vdi=dolly
instead of
--drive driver=sheepdog,host=fido,vdi=dolly
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Tested-by: Kashyap Chamarthy <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Commit: 6aabeb58391a33cda7e2b406adb431a5ef7e8eea
https://github.com/qemu/qemu/commit/6aabeb58391a33cda7e2b406adb431a5ef7e8eea
Author: Peter Maydell <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M qemu-io-cmds.c
Log Message:
-----------
qemu-io-cmds: Assert that global and nofile commands don't use ct->perms
It would be a bug for a command with the CMD_NOFILE_OK or
CMD_FLAG_GLOBAL flags set to also set the ct->perms field,
because the former says "OK for a file not to be open"
but the latter is a check on a file.
Add an assertion in qemuio_add_command() so we can catch that
sort of buggy command definition immediately rather than it
being a bug that only manifests when a particular set of
command line options is used.
(Coverity gets confused about this (CID 1371723) and reports
that we might dereference a NULL blk pointer in this case,
because it can't tell that that code path never happens with
the cmdinfo_t that we have. This commit won't help unconfuse
it, but it does fix the underlying issue.)
Signed-off-by: Peter Maydell <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Commit: 07ff948bd135373c516842ae5ce856f41f7c553a
https://github.com/qemu/qemu/commit/07ff948bd135373c516842ae5ce856f41f7c553a
Author: Daniel P. Berrange <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M tests/qemu-iotests/097
M tests/qemu-iotests/097.out
A tests/qemu-iotests/176
A tests/qemu-iotests/176.out
M tests/qemu-iotests/group
Log Message:
-----------
iotests: fix 097 when run with qcow
The previous commit:
commit a3e1505daec31ef56f0489f8c8fff1b8e4ca92bd
Author: Eric Blake <address@hidden>
Date: Mon Dec 5 09:49:34 2016 -0600
qcow2: Don't strand clusters near 2G intervals during commit
extended the 097 test case so that it did two passes, once
with an internal snapshot, once without.
qcow (v1) does not support internal snapshots, so this change
broke test 097 when run against qcow.
This splits 097 in two, creating a new 176 that tests the
internal snapshot codepath, effectively putting 097 back
to its content before the above commit.
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
[eblake: test collisions: s/173/176/g]
Signed-off-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Commit: 0c1bd4692f9a19fb4d4bb3afe45439a09c37ab4c
https://github.com/qemu/qemu/commit/0c1bd4692f9a19fb4d4bb3afe45439a09c37ab4c
Author: Eric Blake <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block/qcow2-cluster.c
Log Message:
-----------
qcow2: Discard unaligned tail when wiping image
There is a subtle difference between the fast (qcow2v3 with no
extra data) and slow path (qcow2v2 format [aka 0.10], or when a
snapshot is present) of qcow2_make_empty(). The slow path fails
to discard the final (partial) cluster of an unaligned image.
The problem stems from the fact that qcow2_discard_clusters() was
silently ignoring sub-cluster head and tail on unaligned requests.
A quick audit of all callers shows that qcow2_snapshot_create() has
always passed a cluster-aligned request since the call was added
in commit 1ebf561; qcow2_co_pdiscard() has passed a cluster-aligned
request since commit ecdbead taught the block layer about preferred
discard alignment; and qcow2_make_empty() was fixed to pass an
aligned start (but not necessarily end) in commit a3e1505.
Asserting that the start is always aligned also points out that we
now have a dead check: rounding the end offset down can never result
in a value less than the aligned start offset (the check was rendered
dead with commit ecdbead). Meanwhile, we do not want to round the
end cluster down in the one case of the end offset matching the
(unaligned) file size - that final partial cluster should still be
discarded.
With those fixes in place, the fast and slow paths are back in sync
at discarding an entire image; the next patch will update
qemu-iotests to ensure we don't regress.
Note that bdrv_co_pdiscard ignores ALL partial cluster requests,
including the partial cluster at the end of an image; it can be
argued that the partial cluster at the end should be special-cased
so that a guest issuing discard requests at proper alignments
everywhere else can likewise empty the entire image. But that
optimization is left for another day.
Signed-off-by: Eric Blake <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Commit: f82c5b17ea85d8f432069a4afd6cbdb65d9d8a66
https://github.com/qemu/qemu/commit/f82c5b17ea85d8f432069a4afd6cbdb65d9d8a66
Author: Eric Blake <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M tests/qemu-iotests/097
M tests/qemu-iotests/097.out
M tests/qemu-iotests/176
M tests/qemu-iotests/176.out
Log Message:
-----------
iotests: Improve image-clear tests on non-aligned image
Tweak 097 and 176 to operate on an image that is not cluster-aligned,
to give further coverage of clearing out an entire image, including
the recent fix to eliminate the difference between fast path (97) and
slow (176) for qcow2. Also tested on qcow (97 only, since qcow lacks
snapshots).
Signed-off-by: Eric Blake <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Commit: 86d1bd70987cd11d85d01f52aa5824c63d910471
https://github.com/qemu/qemu/commit/86d1bd70987cd11d85d01f52aa5824c63d910471
Author: Max Reitz <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block/parallels.c
Log Message:
-----------
block/parallels: Avoid overflows
Change the types of variables in allocate_clusters() to int64_t so we do
not have to worry about potential overflows.
Add an assertion that our accesses to s->bat[] do not result in a buffer
overflow and that the implicit conversion performed when invoking
bat_entry_off() does not result in an integer overflow.
Coverity-id: 1307776
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Commit: b1a419ec79c2451fd7b6acfb415a02881ad77844
https://github.com/qemu/qemu/commit/b1a419ec79c2451fd7b6acfb415a02881ad77844
Author: Peter Maydell <address@hidden>
Date: 2017-04-03 (Mon, 03 Apr 2017)
Changed paths:
M block.c
M block/file-posix.c
M block/gluster.c
M block/nbd.c
M block/nfs.c
M block/parallels.c
M block/qcow2-cluster.c
M block/rbd.c
M block/sheepdog.c
M block/ssh.c
M blockdev-nbd.c
M chardev/char-socket.c
M hw/core/qdev-properties-system.c
M include/qemu/sockets.h
M io/dns-resolver.c
M qapi-schema.json
M qapi/block-core.json
M qemu-io-cmds.c
M tests/qemu-iotests/097
M tests/qemu-iotests/097.out
M tests/qemu-iotests/147
A tests/qemu-iotests/176
A tests/qemu-iotests/176.out
M tests/qemu-iotests/group
M ui/vnc.c
M util/qemu-sockets.c
Log Message:
-----------
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2017-04-03'
into staging
Block patches for 2.9-rc3
# gpg: Signature made Mon 03 Apr 2017 16:29:49 BST
# gpg: using RSA key 0xF407DB0061D5CF40
# gpg: Good signature from "Max Reitz <address@hidden>"
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40
* remotes/maxreitz/tags/pull-block-2017-04-03:
block/parallels: Avoid overflows
iotests: Improve image-clear tests on non-aligned image
qcow2: Discard unaligned tail when wiping image
iotests: fix 097 when run with qcow
qemu-io-cmds: Assert that global and nofile commands don't use ct->perms
sheepdog: Fix blockdev-add
nbd: Tidy up blockdev-add interface
sockets: New helper socket_address_crumple()
qapi-schema: SocketAddressFlat variants 'vsock' and 'fd'
gluster: Prepare for SocketAddressFlat extension
block: Document -drive problematic code and bugs
io vnc sockets: Clean up SocketAddressKind switches
char: Fix socket with "type": "vsock" address
nbd sockets vnc: Mark problematic address family tests TODO
block: add missed aio_context_acquire into release_drive
Signed-off-by: Peter Maydell <address@hidden>
Compare: https://github.com/qemu/qemu/compare/102a3d847891...b1a419ec79c2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] 9588c5: block: add missed aio_context_acquire into release...,
GitHub <=