]> git.proxmox.com Git - mirror_qemu.git/commit - blockdev.c
block: Reject writethrough mode except at the root
authorKevin Wolf <kwolf@redhat.com>
Mon, 14 Mar 2016 14:46:03 +0000 (15:46 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 30 Mar 2016 09:59:32 +0000 (11:59 +0200)
commit73ac451f3435910433900d7d01a1cac6ccb401e6
treea65ef5c7a56b8e1f0ba569e8317465112050db3a
parentb8816a43865822883ffc9b506e6243c7d986561a
block: Reject writethrough mode except at the root

Writethrough mode is going to become a BlockBackend feature rather than
a BDS one, so forbid it in places where we won't be able to support it
when the code finally matches the envisioned design.

We only allowed setting the cache mode of non-root nodes after the 2.5
release, so we're still free to make this change.

The target of block jobs is now always opened in a writeback mode
because it doesn't have a BlockBackend attached. This makes more sense
anyway because block jobs know when to flush. If the graph is modified
on job completion, the original cache mode moves to the new root, so
for the guest device writethough always stays enabled if it was
configured this way.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
block.c
blockdev.c
tests/qemu-iotests/142
tests/qemu-iotests/142.out