qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 63eaaa: block: Remove bdrv_make_anon()


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 63eaaa: block: Remove bdrv_make_anon()
Date: Wed, 30 Mar 2016 07:30:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 63eaaae08cb7738311f73d1a7e6e6a68ddf60688
      
https://github.com/qemu/qemu/commit/63eaaae08cb7738311f73d1a7e6e6a68ddf60688
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M blockdev.c
    M include/block/block.h

  Log Message:
  -----------
  block: Remove bdrv_make_anon()

The call in hmp_drive_del() is dead code because blk_remove_bs() is
called a few lines above. The only other remaining user is
bdrv_delete(), which only abuses bdrv_make_anon() to remove it from the
named nodes list. This path inlines the list entry removal into
bdrv_delete() and removes bdrv_make_anon().

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 4c8449832c0add27b898e657a9e7e8603f44157c
      
https://github.com/qemu/qemu/commit/4c8449832c0add27b898e657a9e7e8603f44157c
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M blockdev.c

  Log Message:
  -----------
  block: Remove copy-on-read from bdrv_move_feature_fields()

Ever since we first introduced bdrv_append() in commit 8802d1fd ('qapi:
Introduce blockdev-group-snapshot-sync command'), the copy-on-read flag
was moved to the new top layer when taking a snapshot. The only problem
is that it doesn't make a whole lot of sense.

The use case for manually enabled CoR is to avoid reading data twice
from a slow remote image, so we want to save it to a local overlay, say
an ISO image accessed via HTTP to a local qcow2 overlay. When taking a
snapshot, we end up with a backing chain like this:

    http <- local.qcow2 <- snap_overlay.qcow2

There is no point in doing CoR from local.qcow2 into snap_overlay.qcow2,
we just want to keep copying data from the remote source into
local.qcow2.

The other use case of CoR is in the context of streaming, which isn't
very interesting for bdrv_move_feature_fields() because op blockers
prevent this combination.

This patch makes the copy-on-read flag stay on the image for which it
was originally set and prevents it from being propagated to the new
overlay. It is no longer intended to move CoR to the BlockBackend level.
In order for this to make sense, we also need to keep the respective
image read-write.

As a side effect of these changes, creating a live snapshot image (as
opposed to using an existing externally created one) on top of a COR
block device works now. It used to fail because it tried to open its
backing file both read-only and with COR.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 7a827aaec8c4bb56826f07605b895909b5fa4dde
      
https://github.com/qemu/qemu/commit/7a827aaec8c4bb56826f07605b895909b5fa4dde
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Remove dirty bitmaps from bdrv_move_feature_fields()

This patch changes dirty bitmaps from following a BlockBackend in graph
changes to sticking with the node they were created at. For the full
discussion, read the following mailing list thread:

  [Qemu-block] block: Dirty bitmaps and COR in bdrv_move_feature_fields()
  https://lists.nongnu.org/archive/html/qemu-block/2016-02/msg00745.html

In summary, the justification for this change is:

* When moving the dirty bitmap to the top of the tree was introduced in
  bdrv_append() in commit a9fc4408, it didn't actually have any effect
  because there could never be a bitmap in use when bdrv_append() was
  called (op blockers would prevent this). This is still true today for
  all internal uses of dirty bitmaps.

* Support for user-defined dirty bitmaps was introduced in 2.4, but we
  discouraged users from using it because we didn't consider it ready
  yet.

  Moreover, in 2.5, the bdrv_swap() removal introduced a bug that left
  dangling pointers if a dirty bitmap was present (the anchors of the
  dirty bitmap were swapped, but the back link in the first element
  wasn't updated), so it didn't even work correctly.

* block-dirty-bitmap-add takes an arbitrary node name, even if no
  BlockBackend is attached. This suggests that it is a node level
  operation and not a BlockBackend one. Consequently, there is no reason
  for dirty bitmaps to stay with a BlockBackend that was attached to the
  node they were created for.

* It was suggested that block-dirty-bitmap-add could track the node if a
  node name was specified, and track the BlockBackend if the device name
  was specified. This would however be inconsistent with other QMP
  commands. Commands that accept both device and node names currently
  interpret the device name just as an alias for the current root node
  of that BlockBackend.

* Dirty bitmaps have a name that is only unique amongst the bitmaps in a
  specific node. Moving bitmaps could lead to name clashes. Automatic
  renaming would involve too much magic.

* Persistent bitmaps are stored in a specific node. Moving them around
  automatically might be at least surprising, but it would probably also
  become a real problem because that would have to happen atomically
  without the management tool knowing of the operation.

At the end of the day it seems to be very clear that it was a mistake to
include dirty bitmaps in bdrv_move_feature_fields(). The functionality
of moving bitmaps and/or attaching them to a BlockBackend instead will
probably be needed, but it should be done with a new explicit QMP
command or option.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: aaa436f9982ebf3988c9a25661c96bca97b259b0
      
https://github.com/qemu/qemu/commit/aaa436f9982ebf3988c9a25661c96bca97b259b0
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M qapi/block-core.json

  Log Message:
  -----------
  block: Remove cache.writeback from blockdev-add

The WCE bit is a frontend property and should not be part of the backend
configuration. This is especially important because the same BDS can be
used by different users with different WCE requirements.

Signed-off-by: Kevin Wolf <address@hidden>


  Commit: b8816a43865822883ffc9b506e6243c7d986561a
      
https://github.com/qemu/qemu/commit/b8816a43865822883ffc9b506e6243c7d986561a
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M tests/qemu-iotests/142.out

  Log Message:
  -----------
  block: Make backing files always writeback

First of all, we're generally not writing to backing files, but when we
do, it's in the context of block jobs which know very well when to flush
the image.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 73ac451f3435910433900d7d01a1cac6ccb401e6
      
https://github.com/qemu/qemu/commit/73ac451f3435910433900d7d01a1cac6ccb401e6
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M blockdev.c
    M tests/qemu-iotests/142
    M tests/qemu-iotests/142.out

  Log Message:
  -----------
  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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: d0855f1235ed203700a3a24fc7e138490c272117
      
https://github.com/qemu/qemu/commit/d0855f1235ed203700a3a24fc7e138490c272117
  Author: Programmingkid <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

Mac OS X can be picky when it comes to allowing the user
to use physical devices in QEMU. Most mounted volumes
appear to be off limits to QEMU. If an issue is detected,
a message is displayed showing the user how to unmount a
volume. Now QEMU uses both CD and DVD media.

Signed-off-by: John Arbuckle <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 72f41b6fbd19113247f1ff46f844e9b79cbd5e48
      
https://github.com/qemu/qemu/commit/72f41b6fbd19113247f1ff46f844e9b79cbd5e48
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/block-backend.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Remove blk_set_bs()

The function is unused since commit f21d96d0 ('block: Use BdrvChild in
BlockBackend').

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 853ccfed8fe40ba97c4814b5165fda4cfeee044b
      
https://github.com/qemu/qemu/commit/853ccfed8fe40ba97c4814b5165fda4cfeee044b
  Author: Peter Xu <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/qapi.c

  Log Message:
  -----------
  block/qapi: make two printf() formats literal

Fix two places to use literal printf format when possible.

Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 5eda622768a2162993e50275b325125d4485757d
      
https://github.com/qemu/qemu/commit/5eda622768a2162993e50275b325125d4485757d
  Author: Peter Xu <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/qapi.c

  Log Message:
  -----------
  block/qapi: fix unbounded stack for dump_qdict

Using heap instead of stack for better safety.

Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 0e8f44bee998ba7711b77efee7aee0aee688b4ad
      
https://github.com/qemu/qemu/commit/0e8f44bee998ba7711b77efee7aee0aee688b4ad
  Author: Max Reitz <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/qapi.c

  Log Message:
  -----------
  block/qapi: Set s->device in bdrv_query_stats()

This is the only instance of bdrv_query_blk_stats() accessing anything
in the BlockStats structure other than s->stats, so let us move it to
its caller (where it makes just as much sense) allowing us to make
bdrv_query_blk_stats() take a pointer to the BlockDeviceStats instead of
BlockStats.

Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 543021569978c908fccff235bf90fc803e6fed1d
      
https://github.com/qemu/qemu/commit/543021569978c908fccff235bf90fc803e6fed1d
  Author: Max Reitz <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/qapi.c

  Log Message:
  -----------
  block/qapi: Pass bdrv_query_blk_stats() s->stats

bdrv_query_blk_stats() does not need access to all of BlockStats,
BlockDeviceStats is enough and is what this function is actually
supposed to fill.

Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: abb06c5ac1c86e747bbe08bf7b5b69723ad69832
      
https://github.com/qemu/qemu/commit/abb06c5ac1c86e747bbe08bf7b5b69723ad69832
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M block/io.c
    M include/block/block.h
    M qemu-img.c

  Log Message:
  -----------
  block: add flag to indicate that no I/O will be performed

When opening an image it is useful to know whether the caller
intends to perform I/O on the image or not. In the case of
encrypted images this will allow the block driver to avoid
having to prompt for decryption keys when we merely want to
query header metadata about the image. eg qemu-img info

This flag is enforced at the top level only, since even if
we don't want todo I/O on the 'qcow2' file payload, the
underlying 'file' driver will still need todo I/O to read
the qcow2 header, for example.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 4ef130fca87b7a8c77e1af9ca967f28b683811d7
      
https://github.com/qemu/qemu/commit/4ef130fca87b7a8c77e1af9ca967f28b683811d7
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M qemu-img.c
    M qemu-io.c

  Log Message:
  -----------
  qemu-img/qemu-io: don't prompt for passwords if not required

The qemu-img/qemu-io tools prompt for disk encryption passwords
regardless of whether any are actually required. Adding a check
on bdrv_key_required() avoids this prompt for disk formats which
have been converted to the QCryptoSecret APIs.

This is just a temporary hack to ensure the block I/O tests
continue to work after each patch, since the last patch will
completely delete all the password prompting code.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 491e5e85ef7f10946762b3827eaa62635593fced
      
https://github.com/qemu/qemu/commit/491e5e85ef7f10946762b3827eaa62635593fced
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  tests: redirect stderr to stdout for iotests

The python I/O tests helper for running qemu-img/qemu-io
setup stdout to be captured to a pipe, but left stderr
untouched. As a result, if something failed in qemu-img/
qemu-io, data written to stderr would get output directly
and not line up with data on the test stdout due to
buffering.  If we explicitly redirect stderr to the same
pipe as stdout, things are much clearer when they go
wrong.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: c6a92369dc58345ce2df679313eac78c536db343
      
https://github.com/qemu/qemu/commit/c6a92369dc58345ce2df679313eac78c536db343
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  tests: refactor python I/O tests helper main method

The iotests.py helper provides a main() method for running
tests via the python unit test framework. Not all tests
will want to use this, so refactor it to split the testing
of compatible formats and platforms into separate helper
methods

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: a2d1c8fd84de207ab8e078d00851e0b93b50756d
      
https://github.com/qemu/qemu/commit/a2d1c8fd84de207ab8e078d00851e0b93b50756d
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  tests: add output filter to python I/O tests helper

Add a 'log' method to iotests.py which prints messages to
stdout, with optional filtering of data. Port over some
standard filters already present in the shell common.filter
code to be usable in python too.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 78368575a63df3ef95653024fa21a91d441b0c8d
      
https://github.com/qemu/qemu/commit/78368575a63df3ef95653024fa21a91d441b0c8d
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/Makefile.objs
    A block/crypto.c
    M qapi/block-core.json

  Log Message:
  -----------
  block: add generic full disk encryption driver

Add a block driver that is capable of supporting any full disk
encryption format. This utilizes the previously added block
encryption code, and at this time supports the LUKS format.

The driver code is capable of supporting any format supported
by the QCryptoBlock module, so it registers one block driver
for each format. This patch only registers the "luks" driver
since the "qcow" driver is there only for back-compatibility
with existing qcow built-in encryption.

New LUKS compatible volumes can be formatted using qemu-img
with defaults for all settings.

$ qemu-img create --object secret,data=123456,id=sec0 \
      -f luks -o key-secret=sec0 demo.luks 10G

Alternatively the cryptographic settings can be explicitly
set

$ qemu-img create --object secret,data=123456,id=sec0 \
      -f luks -o key-secret=sec0,cipher-alg=aes-256,\
           cipher-mode=cbc,ivgen-alg=plain64,hash-alg=sha256 \
      demo.luks 10G

And query its size

$ qemu-img info demo.img
image: demo.img
file format: luks
virtual size: 10G (10737418240 bytes)
disk size: 132K
encrypted: yes

Note that it was not necessary to provide the password
when querying info for the volume. The password is only
required when performing I/O on the volume

All volumes created by this new 'luks' driver should be
capable of being opened by the kernel dm-crypt driver.

The only algorithms listed in the LUKS spec that are
not currently supported by this impl are sha512 and
ripemd160 hashes and cast6 cipher.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
[ kwolf - Added #include to resolve conflict with da34e65c ]
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: e6ff69bf5edfb0475903456a8c7f785635986540
      
https://github.com/qemu/qemu/commit/e6ff69bf5edfb0475903456a8c7f785635986540
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M block/qcow.c
    M block/qcow2.c
    M include/block/block.h
    M tests/qemu-iotests/049.out
    M tests/qemu-iotests/087
    M tests/qemu-iotests/087.out
    M tests/qemu-iotests/134.out

  Log Message:
  -----------
  block: move encryption deprecation warning into qcow code

For a couple of releases we have been warning

  Encrypted images are deprecated
  Support for them will be removed in a future release.
  You can use 'qemu-img convert' to convert your image to an unencrypted one.

This warning was issued by system emulators, qemu-img, qemu-nbd
and qemu-io. Such a broad warning was issued because the original
intention was to rip out all the code for dealing with encryption
inside the QEMU block layer APIs.

The new block encryption framework used for the LUKS driver does
not rely on the unloved block layer API for encryption keys,
instead using the QOM 'secret' object type. It is thus no longer
appropriate to warn about encryption unconditionally.

When the qcow/qcow2 drivers are converted to use the new encryption
framework too, it will be practical to keep AES-CBC support present
for use in qemu-img, qemu-io & qemu-nbd to allow for interoperability
with older QEMU versions and liberation of data from existing encrypted
qcow2 files.

This change moves the warning out of the generic block code and
into the qcow/qcow2 drivers. Further, the warning is set to only
appear when running the system emulators, since qemu-img, qemu-io,
qemu-nbd are expected to support qcow2 encryption long term now that
the maint burden has been eliminated.

Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 6278ae035fbd4bbab6a43cd53e4bf3bb71debc71
      
https://github.com/qemu/qemu/commit/6278ae035fbd4bbab6a43cd53e4bf3bb71debc71
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    A tests/qemu-iotests/149
    A tests/qemu-iotests/149.out
    M tests/qemu-iotests/common
    M tests/qemu-iotests/group

  Log Message:
  -----------
  block: an interoperability test for luks vs dm-crypt/cryptsetup

It is important that the QEMU luks implementation retains 100%
compatibility with the reference implementation provided by
the combination of the linux kernel dm-crypt module and cryptsetup
userspace tools.

There is a matrix of tests to be performed with different sets
of encryption settings. For each matrix entry, two tests will
be performed. One will create a LUKS image with the cryptsetup
tool and then do I/O with both cryptsetup & qemu-io. The other
will create the image with qemu-img and then again do I/O with
both cryptsetup and qemu-io.

The new I/O test 149 performs interoperability testing between
QEMU and the reference implementation. Such testing inherantly
requires elevated privileges, so to this this the user must have
configured passwordless sudo access. The test will automatically
skip if sudo is not available.

The test has to be run explicitly thus:

    cd tests/qemu-iotests
    ./check -luks 149

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: c32b82afaf261ebb922269e2be298e05331b875c
      
https://github.com/qemu/qemu/commit/c32b82afaf261ebb922269e2be298e05331b875c
  Author: Pavel Dovgalyuk <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/io.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: add flush callback

This patch adds callback for flush request. This callback is responsible
for flushing whole block devices stack. bdrv_flush function does not
proceed to underlying devices. It should be performed by this callback
function, if needed.

Signed-off-by: Pavel Dovgalyuk <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 58a0067aa8bf1e3ccad4fc354b080502e63f9fb1
      
https://github.com/qemu/qemu/commit/58a0067aa8bf1e3ccad4fc354b080502e63f9fb1
  Author: Pavel Dovgalyuk <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M replay/replay-events.c

  Log Message:
  -----------
  replay: bh scheduling fix

This patch fixes scheduling of bottom halves when record/replay is enabled.
Now BH are not added to replay queue when asynchronous events are disabled.
This may happen in startup and loadvm/savevm phases of execution.

Signed-off-by: Pavel Dovgalyuk <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 95b4aed5fd0bec00e2c3f754c86fec5ba7a83a20
      
https://github.com/qemu/qemu/commit/95b4aed5fd0bec00e2c3f754c86fec5ba7a83a20
  Author: Pavel Dovgalyuk <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M replay/replay-events.c

  Log Message:
  -----------
  replay: fix error message

This patch fixes error message in saving loop of the asynchronous events queue.

Signed-off-by: Pavel Dovgalyuk <address@hidden>
[ kwolf: Fixed format string to use PRId64 instead of %d ]
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 63785678f3941c84be01d3ab7867e2742ea9fe3e
      
https://github.com/qemu/qemu/commit/63785678f3941c84be01d3ab7867e2742ea9fe3e
  Author: Pavel Dovgalyuk <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/Makefile.objs
    A block/blkreplay.c
    M docs/replay.txt
    M include/sysemu/replay.h
    M replay/replay-events.c
    M replay/replay-internal.h
    M replay/replay.c
    M stubs/replay.c

  Log Message:
  -----------
  replay: introduce block devices record/replay

This patch introduces block driver that implement recording
and replaying of block devices' operations.
All block completion operations are added to the queue.
Queue is flushed at checkpoints and information about processed requests
is recorded to the log. In replay phase the queue is matched with
events read from the log. Therefore block devices requests are processed
deterministically.

Signed-off-by: Pavel Dovgalyuk <address@hidden>
[ kwolf: Rebased onto modified and already applied part of the series ]
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: baf5602ed92628067990abfa7a873f51586a4dc1
      
https://github.com/qemu/qemu/commit/baf5602ed92628067990abfa7a873f51586a4dc1
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M include/block/block.h

  Log Message:
  -----------
  block: Add bdrv_parse_cache_mode()

It's like bdrv_parse_cache_flags(), except that writethrough mode isn't
included in the flags, but returned as a separate bool.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 6effd5bfc2b52240eea96a6eab3afa7624f253b2
      
https://github.com/qemu/qemu/commit/6effd5bfc2b52240eea96a6eab3afa7624f253b2
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M qemu-nbd.c

  Log Message:
  -----------
  qemu-nbd: Call blk_set_enable_write_cache() explicitly

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: e151fc16dd2a5615c31b54a051d831c4e38fa88a
      
https://github.com/qemu/qemu/commit/e151fc16dd2a5615c31b54a051d831c4e38fa88a
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M qemu-io.c

  Log Message:
  -----------
  qemu-io: Call blk_set_enable_write_cache() explicitly

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: e699614341cd9ed5676fe24c4f73f20497c28059
      
https://github.com/qemu/qemu/commit/e699614341cd9ed5676fe24c4f73f20497c28059
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Expand all BDRV_O_FLAGS uses

It always only set the BDRV_O_CACHE_WB flag, which is going to go away.
In order to make the next changes more local for better reviewability
this patches expands the macro.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: ce09954720d4d59b682b45d622e62ec13c332070
      
https://github.com/qemu/qemu/commit/ce09954720d4d59b682b45d622e62ec13c332070
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Call blk_set_enable_write_cache() explicitly

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: ecdd3cc82d7f5dd181ad74d8c4d04f5295b1bcf7
      
https://github.com/qemu/qemu/commit/ecdd3cc82d7f5dd181ad74d8c4d04f5295b1bcf7
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M hw/block/xen_disk.c

  Log Message:
  -----------
  xen_disk: Call blk_set_enable_write_cache() explicitly

Signed-off-by: Kevin Wolf <address@hidden>
Acked-by: Stefano Stabellini <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: e4b24b497e4171a89da541fe83c3dc84c51d42da
      
https://github.com/qemu/qemu/commit/e4b24b497e4171a89da541fe83c3dc84c51d42da
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: blockdev_init(): Call blk_set_enable_write_cache() explicitly

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 72e775c7d9de3eaa35a6edaf9d87cedee149d0f5
      
https://github.com/qemu/qemu/commit/72e775c7d9de3eaa35a6edaf9d87cedee149d0f5
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/block-backend.c
    M block/crypto.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/sheepdog.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M blockdev.c

  Log Message:
  -----------
  block: Always set writeback mode in blk_new_open()

All callers of blk_new_open() either don't rely on the WCE bit set after
blk_new_open() because they explicitly set it anyway, or they pass
BDRV_O_CACHE_WB unconditionally.

This patch changes blk_new_open() so that it always enables writeback
mode and asserts that BDRV_O_CACHE_WB is clear. For those callers that
used to pass BDRV_O_CACHE_WB unconditionally, the flag is removed now.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 855a6a93a12b60b2799eb5999baabd7a85a37c99
      
https://github.com/qemu/qemu/commit/855a6a93a12b60b2799eb5999baabd7a85a37c99
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Handle flush error in bdrv_pwrite_sync()

We don't want to silently ignore a flush error.

Also, there is little point in avoiding the flush for writethrough modes
and once WCE is moved to the BB layer, we definitely need the flush here
because bdrv_pwrite() won't involve one any more.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: bfd18d1e0b06608226fcef1982c3a439c49c3366
      
https://github.com/qemu/qemu/commit/bfd18d1e0b06608226fcef1982c3a439c49c3366
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/io.c
    M block/iscsi.c
    M include/block/block.h
    M include/block/block_int.h
    M tests/qemu-iotests/142
    M tests/qemu-iotests/142.out

  Log Message:
  -----------
  block: Move enable_write_cache to BB level

Whether a write cache is used or not is a decision that concerns the
user (e.g. the guest device) rather than the backend. It was already
logically part of the BB level as bdrv_move_feature_fields() always kept
it on top of the BDS tree; with this patch, the core of it (the actual
flag and the additional flushes) is also implemented there.

Direct callers of bdrv_open() must pass BDRV_O_CACHE_WB now if bs
doesn't have a BlockBackend attached.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: c83f9fba2a4ae3f07a7ac8ff8c021f539a08b6ce
      
https://github.com/qemu/qemu/commit/c83f9fba2a4ae3f07a7ac8ff8c021f539a08b6ce
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M block/qapi.c
    M include/block/qapi.h
    M tests/qemu-iotests/142
    M tests/qemu-iotests/142.out

  Log Message:
  -----------
  block/qapi: Use blk_enable_write_cache()

Now that WCE is handled on the BlockBackend level, the flag is
meaningless for BDSes. As the schema requires us to fill the field,
we return an enabled write cache for them.

Note that this means that querying the BlockBackend name may return
writethrough as the cache information, whereas querying the node-name of
the root of that same BlockBackend will return writeback.

This may appear odd at first, but it actually makes sense because it
correctly repesents the layer that implements the WCE handling. This
becomes more apparent when you consider nodes that are the root node of
multiple BlockBackends, where each BB can have its own WCE setting.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 93f5e6d88a452799b907954b90cf49abee8f7ea4
      
https://github.com/qemu/qemu/commit/93f5e6d88a452799b907954b90cf49abee8f7ea4
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/io.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Introduce bdrv_co_writev_flags()

This function will allow drivers to implement BDRV_REQ_FUA natively
instead of sending a separate flush after the write.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 9f0eb9e129398d8907ec990b18c03f20ee0de15e
      
https://github.com/qemu/qemu/commit/9f0eb9e129398d8907ec990b18c03f20ee0de15e
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  iscsi: Support BDRV_REQ_FUA

This replaces the existing hack in the iscsi driver that sent the FUA
bit in writethrough mode and ignored the following flush in order to
optimise the number of roundtrips (see commit 73b5394e).

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 2b556518c3424caa4f40ee4f6199e8877488f5e8
      
https://github.com/qemu/qemu/commit/2b556518c3424caa4f40ee4f6199e8877488f5e8
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/nbd-client.c
    M block/nbd-client.h
    M block/nbd.c

  Log Message:
  -----------
  nbd: Support BDRV_REQ_FUA

The NBD server already used to send a FUA flag when the writethrough
mode was set. This code was a remnant from the times where protocol
drivers actually had to implement writethrough modes. Since nowadays the
block layer sends flushes in writethrough mode and non-root nodes are
always writeback, this was mostly dead code - only mostly because if NBD
was configured to be used without a format, we sent _both_ FUA and an
explicit flush afterwards, which makes the code not technically dead,
but useless overhead.

This patch changes the code so that the block layer's FUA flag is
recognised and translated into a NBD FUA flag. The additional flush is
avoided now.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 5481531154cf08ed53623a0184f7677a9b98d083
      
https://github.com/qemu/qemu/commit/5481531154cf08ed53623a0184f7677a9b98d083
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/raw_bsd.c

  Log Message:
  -----------
  raw: Support BDRV_REQ_FUA

Pass through the FUA flag to the lower layer so that the separate flush
can be saved in practically relevant cases where a (raw) format driver
sits on top of the protocol driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 04feb4a5073e75b8ed213b297c857fa3ccc0b538
      
https://github.com/qemu/qemu/commit/04feb4a5073e75b8ed213b297c857fa3ccc0b538
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: Use bdrv_parse_cache_mode() in drive_init()

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 19dbecdceef3f0800a96c25931d71b0b82c3a47a
      
https://github.com/qemu/qemu/commit/19dbecdceef3f0800a96c25931d71b0b82c3a47a
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M qemu-io-cmds.c
    M tests/qemu-iotests/142
    M tests/qemu-iotests/142.out

  Log Message:
  -----------
  qemu-io: Use bdrv_parse_cache_mode() in reopen_f()

We must forbid changing the WCE flag in bdrv_reopen() in the same patch,
as otherwise the behaviour would change so that the flag takes
precedence over the explicitly specified option.

The correct value of the WCE flag depends on the BlockBackend user (e.g.
guest device) and isn't a decision that the QMP client makes, so this
change is what we want.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 53e8ae010071637b4317402e2ece9e4dbb329c50
      
https://github.com/qemu/qemu/commit/53e8ae010071637b4317402e2ece9e4dbb329c50
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M include/block/block.h

  Log Message:
  -----------
  block: Remove bdrv_parse_cache_flags()

All users are converted to bdrv_parse_cache_mode() now.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 61de4c680846167e01d7ba42bf787f8d1d80bf5e
      
https://github.com/qemu/qemu/commit/61de4c680846167e01d7ba42bf787f8d1d80bf5e
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/vvfat.c
    M blockdev.c
    M include/block/block.h
    M qemu-img.c
    M qemu-io-cmds.c
    M tests/qemu-iotests/051
    M tests/qemu-iotests/051.pc.out
    M tests/qemu-iotests/142
    M tests/qemu-iotests/142.out

  Log Message:
  -----------
  block: Remove BDRV_O_CACHE_WB

The previous patches have successively made blk->enable_write_cache the
true source for the information whether a writethrough mode must be
implemented. The corresponding BDRV_O_CACHE_WB is only useless baggage
we're carrying around, so now's the time to remove it.

At the same time, we remove the 'cache.writeback' option parsing on the
BDS level as the only effect was setting the BDRV_O_CACHE_WB flag.

This change requires test cases that explicitly enabled the option to
drop it. Other than that and the change of the error message when
writethrough is enabled on the BDS level (from "Can't set writethrough
mode" to "doesn't support the option"), there should be no change in
behaviour.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 09cf9db1bcd60d9889b774925ba7058286d35412
      
https://github.com/qemu/qemu/commit/09cf9db1bcd60d9889b774925ba7058286d35412
  Author: Kevin Wolf <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M block/backup.c
    M block/mirror.c
    M include/block/block.h

  Log Message:
  -----------
  block: Remove bdrv_(set_)enable_write_cache()

The only remaining users were block jobs (mirror and backup) which
unconditionally enabled WCE on the BlockBackend of the target image. As
these block jobs don't go through BlockBackend for their I/O requests,
they aren't affected by this setting anyway but always get a writeback
mode, so that call can be removed.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: aad15de4275d2fc90acdf6101493dfee4e39b803
      
https://github.com/qemu/qemu/commit/aad15de4275d2fc90acdf6101493dfee4e39b803
  Author: Max Reitz <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M qemu-img.c
    M tests/qemu-iotests/122.out

  Log Message:
  -----------
  qemu-img: Fix preallocation with -S 0 for convert

When passing -S 0 to qemu-img convert, the target image is supposed to
be fully allocated. Right now, this is not the case if the source image
contains areas which bdrv_get_block_status() reports as being zero.

This patch changes a zeroed area's status from BLK_ZERO to BLK_DATA
before invoking convert_write() if -S 0 has been specified. In addition,
the check whether convert_read() actually needs to do anything
(basically only if the current area is a BLK_DATA area) is pulled out of
that function to the caller.

If -S 0 has been specified, zeroed areas need to be written as data to
the output, thus they then have to be accounted when calculating the
progress made.

This patch changes the reference output for iotest 122; contrary to what
it assumed, -S 0 really should allocate everything in the output, not
just areas that are filled with zeros (as opposed to being zeroed).

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: cd219eb1e55a5bf9eab4193cafaf6ab188fc2752
      
https://github.com/qemu/qemu/commit/cd219eb1e55a5bf9eab4193cafaf6ab188fc2752
  Author: Max Reitz <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/null.c

  Log Message:
  -----------
  block/null-{co,aio}: Allow reading zeroes

This is optional so that it does not impede the null block driver's
performance unless this behavior is desired.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Acked-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: a90639270df14ee8bd2aec38243c24348c9053fa
      
https://github.com/qemu/qemu/commit/a90639270df14ee8bd2aec38243c24348c9053fa
  Author: Max Reitz <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block/null.c

  Log Message:
  -----------
  block/null-{co,aio}: Implement get_block_status()

Signed-off-by: Max Reitz <address@hidden>
Acked-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: f4e732a0a773c4e44c2c183a5d63cd850ffb57d1
      
https://github.com/qemu/qemu/commit/f4e732a0a773c4e44c2c183a5d63cd850ffb57d1
  Author: Max Reitz <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    A tests/qemu-iotests/150
    A tests/qemu-iotests/150.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  iotests: Test qemu-img convert -S 0 behavior

Passing -S 0 to qemu-img convert should result in all source data being
copied to the output, even if that source data is known to be 0. The
output image should therefore have exactly the same size on disk as an
image which we explicitly filled with data.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: b9c27e7ae6fb1387eafe858d8378ff14cd1c5b89
      
https://github.com/qemu/qemu/commit/b9c27e7ae6fb1387eafe858d8378ff14cd1c5b89
  Author: Peter Maydell <address@hidden>
  Date:   2016-03-30 (Wed, 30 Mar 2016)

  Changed paths:
    M block.c
    M block/Makefile.objs
    M block/backup.c
    A block/blkreplay.c
    M block/block-backend.c
    A block/crypto.c
    M block/io.c
    M block/iscsi.c
    M block/mirror.c
    M block/nbd-client.c
    M block/nbd-client.h
    M block/nbd.c
    M block/null.c
    M block/parallels.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/raw-posix.c
    M block/raw_bsd.c
    M block/sheepdog.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M blockdev.c
    M docs/replay.txt
    M hw/block/xen_disk.c
    M include/block/block.h
    M include/block/block_int.h
    M include/block/qapi.h
    M include/sysemu/replay.h
    M qapi/block-core.json
    M qemu-img.c
    M qemu-io-cmds.c
    M qemu-io.c
    M qemu-nbd.c
    M replay/replay-events.c
    M replay/replay-internal.h
    M replay/replay.c
    M stubs/replay.c
    M tests/qemu-iotests/049.out
    M tests/qemu-iotests/051
    M tests/qemu-iotests/051.pc.out
    M tests/qemu-iotests/087
    M tests/qemu-iotests/087.out
    M tests/qemu-iotests/122.out
    M tests/qemu-iotests/134.out
    M tests/qemu-iotests/142
    M tests/qemu-iotests/142.out
    A tests/qemu-iotests/149
    A tests/qemu-iotests/149.out
    A tests/qemu-iotests/150
    A tests/qemu-iotests/150.out
    M tests/qemu-iotests/common
    M tests/qemu-iotests/group
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches

# gpg: Signature made Wed 30 Mar 2016 11:57:54 BST using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"

* remotes/kevin/tags/for-upstream: (48 commits)
  iotests: Test qemu-img convert -S 0 behavior
  block/null-{co,aio}: Implement get_block_status()
  block/null-{co,aio}: Allow reading zeroes
  qemu-img: Fix preallocation with -S 0 for convert
  block: Remove bdrv_(set_)enable_write_cache()
  block: Remove BDRV_O_CACHE_WB
  block: Remove bdrv_parse_cache_flags()
  qemu-io: Use bdrv_parse_cache_mode() in reopen_f()
  block: Use bdrv_parse_cache_mode() in drive_init()
  raw: Support BDRV_REQ_FUA
  nbd: Support BDRV_REQ_FUA
  iscsi: Support BDRV_REQ_FUA
  block: Introduce bdrv_co_writev_flags()
  block/qapi: Use blk_enable_write_cache()
  block: Move enable_write_cache to BB level
  block: Handle flush error in bdrv_pwrite_sync()
  block: Always set writeback mode in blk_new_open()
  block: blockdev_init(): Call blk_set_enable_write_cache() explicitly
  xen_disk: Call blk_set_enable_write_cache() explicitly
  qemu-img: Call blk_set_enable_write_cache() explicitly
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/8850dcbfd766...b9c27e7ae6fb

reply via email to

[Prev in Thread] Current Thread [Next in Thread]