qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 306a06: block: expose crypto option names / d


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 306a06: block: expose crypto option names / defs to other ...
Date: Thu, 13 Jul 2017 06:52:39 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 306a06e5f766acaf26b71397a5692c65b65a61c7
      
https://github.com/qemu/qemu/commit/306a06e5f766acaf26b71397a5692c65b65a61c7
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/crypto.c
    A block/crypto.h

  Log Message:
  -----------
  block: expose crypto option names / defs to other drivers

The block/crypto.c defines a set of QemuOpts that provide
parameters for encryption. This will also be needed by
the qcow/qcow2 integration, so expose the relevant pieces
in a new block/crypto.h header. Some helper methods taking
QemuOpts are changed to take QDict to simplify usage in
other places.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 4a47f85431aa6bed22157f683196affe8b06c69e
      
https://github.com/qemu/qemu/commit/4a47f85431aa6bed22157f683196affe8b06c69e
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  block: add ability to set a prefix for opt names

When integrating the crypto support with qcow/qcow2, we don't
want to use the bare LUKS option names "hash-alg", "key-secret",
etc. We need to namespace them to match the nested QAPI schema.

e.g. "encrypt.hash-alg", "encrypt.key-secret"

so that they don't clash with any general qcow options at a later
date.

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 0b4ee9090e278a46b00b21624ba610552d0106d8
      
https://github.com/qemu/qemu/commit/0b4ee9090e278a46b00b21624ba610552d0106d8
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M qemu-img.texi

  Log Message:
  -----------
  qcow: document another weakness of qcow AES encryption

Document that use of guest virtual sector numbers as the basis for
the initialization vectors is a potential weakness, when combined
with internal snapshots or multiple images using the same passphrase.
This fixes the formatting of the itemized list too.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 6aa837f7bd60903573e0644f503f455454bbf5ae
      
https://github.com/qemu/qemu/commit/6aa837f7bd60903573e0644f503f455454bbf5ae
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow.c

  Log Message:
  -----------
  qcow: require image size to be > 1 for new images

The qcow driver refuses to open images which are less than
2 bytes in size, but will happily create such images. Add
a check in the create path to avoid this discrepancy.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: ebab5636f99eda7034984c27fc30d2c50912bf1c
      
https://github.com/qemu/qemu/commit/ebab5636f99eda7034984c27fc30d2c50912bf1c
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/042

  Log Message:
  -----------
  iotests: skip 042 with qcow which dosn't support zero sized images

Test 042 is designed to verify operation with zero sized images.
Such images are not supported with qcow (v1), so this test has
always failed.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 06af39ecf9da95bbd6dd38e86b15dbc042a6e09c
      
https://github.com/qemu/qemu/commit/06af39ecf9da95bbd6dd38e86b15dbc042a6e09c
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/048

  Log Message:
  -----------
  iotests: skip 048 with qcow which doesn't support resize

Test 048 is designed to verify data preservation during an
image resize. The qcow (v1) format impl has never supported
resize so always fails.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 0cb8d47ba94c0e16f22e3e385dc7c60aea852eee
      
https://github.com/qemu/qemu/commit/0cb8d47ba94c0e16f22e3e385dc7c60aea852eee
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow.c
    M block/qcow2.c
    M include/block/block_int.h
    M qemu-img.c
    M tests/qemu-iotests/049.out
    M tests/qemu-iotests/082.out
    M tests/qemu-iotests/085.out
    M tests/qemu-iotests/144.out
    M tests/qemu-iotests/185.out

  Log Message:
  -----------
  block: deprecate "encryption=on" in favor of "encrypt.format=aes"

Historically the qcow & qcow2 image formats supported a property
"encryption=on" to enable their built-in AES encryption. We'll
soon be supporting LUKS for qcow2, so need a more general purpose
way to enable encryption, with a choice of formats.

This introduces an "encrypt.format" option, which will later be
joined by a number of other "encrypt.XXX" options. The use of
a "encrypt." prefix instead of "encrypt-" is done to facilitate
mapping to a nested QAPI schema at later date.

e.g. the preferred syntax is now

  qemu-img create -f qcow2 -o encrypt.format=aes demo.qcow2

Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 1fad1f9400614ebbce9f3ee301fa8d64cbf715e2
      
https://github.com/qemu/qemu/commit/1fad1f9400614ebbce9f3ee301fa8d64cbf715e2
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow.c

  Log Message:
  -----------
  qcow: make encrypt_sectors encrypt in place

Instead of requiring separate input/output buffers for
encrypting data, change encrypt_sectors() to assume
use of a single buffer, encrypting in place. One current
caller uses the same buffer for input/output already
and the other two callers are easily converted to do so.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: d85f4222b4681da7ebf8a90b26e085a68fa2c55a
      
https://github.com/qemu/qemu/commit/d85f4222b4681da7ebf8a90b26e085a68fa2c55a
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/crypto.c
    M block/crypto.h
    M block/qcow.c
    M qapi/block-core.json

  Log Message:
  -----------
  qcow: convert QCow to use QCryptoBlock for encryption

This converts the qcow driver to make use of the QCryptoBlock
APIs for encrypting image content. This is only wired up to
permit use of the legacy QCow encryption format. Users who wish
to have the strong LUKS format should switch to qcow2 instead.

With this change it is now required to use the QCryptoSecret
object for providing passwords, instead of the current block
password APIs / interactive prompting.

  $QEMU \
    -object secret,id=sec0,file=/home/berrange/encrypted.pw \
    -drive file=/home/berrange/encrypted.qcow,encrypt.format=aes,\
     encrypt.key-secret=sec0

Though note that running QEMU system emulators with the AES
encryption is no longer supported, so while the above syntax
is valid, QEMU will refuse to actually run the VM in this
particular example.

Likewise when creating images with the legacy AES-CBC format

  qemu-img create -f qcow \
    --object secret,id=sec0,file=/home/berrange/encrypted.pw \
    -o encrypt.format=aes,encrypt.key-secret=sec0 \
    /home/berrange/encrypted.qcow 64M

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 446d306d23c8b568affec104d74f84f48d5eaa24
      
https://github.com/qemu/qemu/commit/446d306d23c8b568affec104d74f84f48d5eaa24
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-cluster.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: make qcow2_encrypt_sectors encrypt in place

Instead of requiring separate input/output buffers for
encrypting data, change qcow2_encrypt_sectors() to assume
use of a single buffer, encrypting in place. The current
callers all used the same buffer for input/output already.

Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: b25b387fa5928e516cb2c9e7fde68e958bd7e50a
      
https://github.com/qemu/qemu/commit/b25b387fa5928e516cb2c9e7fde68e958bd7e50a
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-cluster.c
    M block/qcow2.c
    M block/qcow2.h
    M qapi/block-core.json
    M tests/qemu-iotests/049
    M tests/qemu-iotests/049.out
    M tests/qemu-iotests/082.out
    M tests/qemu-iotests/087
    M tests/qemu-iotests/087.out
    M tests/qemu-iotests/134
    M tests/qemu-iotests/134.out
    M tests/qemu-iotests/158
    M tests/qemu-iotests/158.out
    M tests/qemu-iotests/common

  Log Message:
  -----------
  qcow2: convert QCow2 to use QCryptoBlock for encryption

This converts the qcow2 driver to make use of the QCryptoBlock
APIs for encrypting image content, using the legacy QCow2 AES
scheme.

With this change it is now required to use the QCryptoSecret
object for providing passwords, instead of the current block
password APIs / interactive prompting.

  $QEMU \
    -object secret,id=sec0,file=/home/berrange/encrypted.pw \
    -drive file=/home/berrange/encrypted.qcow2,encrypt.key-secret=sec0

The test 087 could be simplified since there is no longer a
difference in behaviour when using blockdev_add with encrypted
images for the running vs stopped CPU state.

Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 7674b5754e56c0639c231619764761d8bf0bebf2
      
https://github.com/qemu/qemu/commit/7674b5754e56c0639c231619764761d8bf0bebf2
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M docs/interop/qcow2.txt

  Log Message:
  -----------
  qcow2: extend specification to cover LUKS encryption

Update the qcow2 specification to describe how the LUKS header is
placed inside a qcow2 file, when using LUKS encryption for the
qcow2 payload instead of the legacy AES-CBC encryption

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 4652b8f3e1ec91bb9d6f00e40df7f96d1f1aafee
      
https://github.com/qemu/qemu/commit/4652b8f3e1ec91bb9d6f00e40df7f96d1f1aafee
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qcow2.h
    M qapi/block-core.json
    M tests/qemu-iotests/082.out

  Log Message:
  -----------
  qcow2: add support for LUKS encryption format

This adds support for using LUKS as an encryption format
with the qcow2 file, using the new encrypt.format parameter
to request "luks" format. e.g.

  # qemu-img create --object secret,data=123456,id=sec0 \
       -f qcow2 -o encrypt.format=luks,encrypt.key-secret=sec0 \
       test.qcow2 10G

The legacy "encryption=on" parameter still results in
creation of the old qcow2 AES format (and is equivalent
to the new 'encryption-format=aes'). e.g. the following are
equivalent:

  # qemu-img create --object secret,data=123456,id=sec0 \
       -f qcow2 -o encryption=on,encrypt.key-secret=sec0 \
       test.qcow2 10G

 # qemu-img create --object secret,data=123456,id=sec0 \
       -f qcow2 -o encryption-format=aes,encrypt.key-secret=sec0 \
       test.qcow2 10G

With the LUKS format it is necessary to store the LUKS
partition header and key material in the QCow2 file. This
data can be many MB in size, so cannot go into the QCow2
header region directly. Thus the spec defines a FDE
(Full Disk Encryption) header extension that specifies
the offset of a set of clusters to hold the FDE headers,
as well as the length of that region. The LUKS header is
thus stored in these extra allocated clusters before the
main image payload.

Aside from all the cryptographic differences implied by
use of the LUKS format, there is one further key difference
between the use of legacy AES and LUKS encryption in qcow2.
For LUKS, the initialiazation vectors are generated using
the host physical sector as the input, rather than the
guest virtual sector. This guarantees unique initialization
vectors for all sectors when qcow2 internal snapshots are
used, thus giving stronger protection against watermarking
attacks.

Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 426d52d88c54cf048385eeb73d802dd87c1317bd
      
https://github.com/qemu/qemu/commit/426d52d88c54cf048385eeb73d802dd87c1317bd
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/087
    M tests/qemu-iotests/087.out
    A tests/qemu-iotests/188
    A tests/qemu-iotests/188.out
    A tests/qemu-iotests/189
    A tests/qemu-iotests/189.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  qcow2: add iotests to cover LUKS encryption support

This extends the 087 iotest to cover LUKS encryption when doing
blockdev-add.

Two further tests are added to validate read/write of LUKS
encrypted images with a single file and with a backing file.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 23f831c33180656c03c5112552868e1dfa096da4
      
https://github.com/qemu/qemu/commit/23f831c33180656c03c5112552868e1dfa096da4
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/134
    M tests/qemu-iotests/158

  Log Message:
  -----------
  iotests: enable tests 134 and 158 to work with qcow (v1)

The 138 and 158 iotests exercise the legacy qcow2 aes encryption
code path and they work fine with qcow v1 too.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 788cf9f8c8cbda53843e060540f3e91a060eb744
      
https://github.com/qemu/qemu/commit/788cf9f8c8cbda53843e060540f3e91a060eb744
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M hmp.c
    M include/monitor/monitor.h
    M include/qemu/osdep.h
    M monitor.c
    M qapi-schema.json
    M qemu-img.c
    M qemu-io.c
    M qmp.c
    M util/oslib-posix.c
    M util/oslib-win32.c

  Log Message:
  -----------
  block: rip out all traces of password prompting

Now that qcow & qcow2 are wired up to get encryption keys
via the QCryptoSecret object, nothing is relying on the
interactive prompting for passwords. All the code related
to password prompting can thus be ripped out.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: c01c214b691d2f9c54a15ea7e486b1750f20fbf8
      
https://github.com/qemu/qemu/commit/c01c214b691d2f9c54a15ea7e486b1750f20fbf8
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block.c
    M block/crypto.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M blockdev.c
    M hmp-commands.hx
    M include/block/block.h
    M include/block/block_int.h
    M include/qapi/error.h
    M qapi/block-core.json
    M qapi/common.json

  Log Message:
  -----------
  block: remove all encryption handling APIs

Now that all encryption keys must be provided upfront via
the QCryptoSecret API and associated block driver properties
there is no need for any explicit encryption handling APIs
in the block layer. Encryption can be handled transparently
within the block driver. We only retain an API for querying
whether an image is encrypted or not, since that is a
potentially useful piece of metadata to report to the user.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 1cd9a787a2ee519665d914193e1022791397d621
      
https://github.com/qemu/qemu/commit/1cd9a787a2ee519665d914193e1022791397d621
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/crypto.c
    M block/qcow.c
    M block/qcow2.c
    M crypto/block-luks.c
    M crypto/block-qcow.c
    M crypto/block.c
    M crypto/blockpriv.h
    M include/crypto/block.h
    M tests/test-crypto-block.c

  Log Message:
  -----------
  block: pass option prefix down to crypto layer

While the crypto layer uses a fixed option name "key-secret",
the upper block layer may have a prefix on the options. e.g.
"encrypt.key-secret", in order to avoid clashes between crypto
option names & other block option names. To ensure the crypto
layer can report accurate error messages, we must tell it what
option name prefix was used.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 0a12f6f80eeebeebd492db7d8c4237fe5c712f68
      
https://github.com/qemu/qemu/commit/0a12f6f80eeebeebd492db7d8c4237fe5c712f68
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2.c
    M qapi/block-core.json

  Log Message:
  -----------
  qcow2: report encryption specific image information

Currently 'qemu-img info' reports a simple "encrypted: yes"
field. This is not very useful now that qcow2 can support
multiple encryption formats. Users want to know which format
is in use and some data related to it.

Wire up usage of the qcrypto_block_get_info() method so that
'qemu-img info' can report about the encryption format
and parameters in use

  $ qemu-img create \
      --object secret,id=sec0,data=123456 \
      -o encrypt.format=luks,encrypt.key-secret=sec0 \
      -f qcow2 demo.qcow2 1G
  Formatting 'demo.qcow2', fmt=qcow2 size=1073741824 \
  encryption=off encrypt.format=luks encrypt.key-secret=sec0 \
  cluster_size=65536 lazy_refcounts=off refcount_bits=16

  $ qemu-img info demo.qcow2
  image: demo.qcow2
  file format: qcow2
  virtual size: 1.0G (1073741824 bytes)
  disk size: 480K
  encrypted: yes
  cluster_size: 65536
  Format specific information:
      compat: 1.1
      lazy refcounts: false
      refcount bits: 16
      encrypt:
    ivgen alg: plain64
    hash alg: sha256
    cipher alg: aes-256
    uuid: 3fa930c4-58c8-4ef7-b3c5-314bb5af21f3
    format: luks
    cipher mode: xts
    slots:
        [0]:
            active: true
            iters: 1839058
            key offset: 4096
            stripes: 4000
        [1]:
            active: false
            key offset: 262144
        [2]:
            active: false
            key offset: 520192
        [3]:
            active: false
            key offset: 778240
        [4]:
            active: false
            key offset: 1036288
        [5]:
            active: false
            key offset: 1294336
        [6]:
            active: false
            key offset: 1552384
        [7]:
            active: false
            key offset: 1810432
    payload offset: 2068480
    master key iters: 438487
      corrupt: false

With the legacy "AES" encryption we just report the format
name

  $ qemu-img create \
      --object secret,id=sec0,data=123456 \
      -o encrypt.format=aes,encrypt.key-secret=sec0 \
      -f qcow2 demo.qcow2 1G
  Formatting 'demo.qcow2', fmt=qcow2 size=1073741824 \
  encryption=off encrypt.format=aes encrypt.key-secret=sec0 \
  cluster_size=65536 lazy_refcounts=off refcount_bits=16

  $ ./qemu-img info demo.qcow2
  image: demo.qcow2
  file format: qcow2
  virtual size: 1.0G (1073741824 bytes)
  disk size: 196K
  encrypted: yes
  cluster_size: 65536
  Format specific information:
      compat: 1.1
      lazy refcounts: false
      refcount bits: 16
      encrypt:
    format: aes
      corrupt: false

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 12f7efd02ee4e7144b842a1437defb997b9ae66b
      
https://github.com/qemu/qemu/commit/12f7efd02ee4e7144b842a1437defb997b9ae66b
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M qemu-doc.texi

  Log Message:
  -----------
  docs: document encryption options for qcow, qcow2 and luks

Expand the image format docs to cover the new options for
the qcow, qcow2 and luks disk image formats

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: a9ed6a919360b998009508be03b056f2b7417ac5
      
https://github.com/qemu/qemu/commit/a9ed6a919360b998009508be03b056f2b7417ac5
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/181

  Log Message:
  -----------
  iotests: 181 does not work for all formats

Test 181 only works for formats which support live migration (naturally,
as it is a live migration test). Disable it for all formats which do
not.

Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 5ce6bfe255091d532ec4555d0ede816294cb1703
      
https://github.com/qemu/qemu/commit/5ce6bfe255091d532ec4555d0ede816294cb1703
  Author: sochin.jiang <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block.c

  Log Message:
  -----------
  mirror: Fix inconsistent backing AioContext for after mirroring

mirror_complete opens the backing chain, which should have the same
AioContext as the top when using iothreads. Make the code guarantee
this, which fixes a failed assertion in bdrv_attach_child.

Signed-off-by: sochin.jiang <address@hidden>
Message-id: address@hidden
[mreitz: Reworded commit message]
Signed-off-by: Max Reitz <address@hidden>


  Commit: b5d1f154889a2e3e6a5da845a10719cea0d4e631
      
https://github.com/qemu/qemu/commit/b5d1f154889a2e3e6a5da845a10719cea0d4e631
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M docs/interop/qcow2.txt

  Log Message:
  -----------
  specs/qcow2: fix bitmap granularity qemu-specific note

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: b348c262cc6d820a43b1453bc7d745c21619f8aa
      
https://github.com/qemu/qemu/commit/b348c262cc6d820a43b1453bc7d745c21619f8aa
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M docs/interop/qcow2.txt

  Log Message:
  -----------
  specs/qcow2: do not use wording 'bitmap header'

A bitmap directory entry is sometimes called a 'bitmap header'. This
patch leaves only one name - 'bitmap directory entry'. The name 'bitmap
header' creates misunderstandings with 'qcow2 header' and 'qcow2 bitmap
header extension' (which is extension of qcow2 header)

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: f63ea4e92bad1dbad58b198f51ac48657c1facbd
      
https://github.com/qemu/qemu/commit/f63ea4e92bad1dbad58b198f51ac48657c1facbd
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M include/qemu/hbitmap.h
    M util/hbitmap.c

  Log Message:
  -----------
  hbitmap: improve dirty iter

Make dirty iter resistant to resetting bits in corresponding HBitmap.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: eedc4b6d8d88f233a6b2dded21779dcbb836cb08
      
https://github.com/qemu/qemu/commit/eedc4b6d8d88f233a6b2dded21779dcbb836cb08
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/test-hbitmap.c

  Log Message:
  -----------
  tests: add hbitmap iter test

Test that hbitmap iter is resistant to bitmap resetting.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: ba06ff1a5c4d080cc8e88ec2d7c3472c20d33f1b
      
https://github.com/qemu/qemu/commit/ba06ff1a5c4d080cc8e88ec2d7c3472c20d33f1b
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/dirty-bitmap.c
    M include/block/dirty-bitmap.h

  Log Message:
  -----------
  block: fix bdrv_dirty_bitmap_granularity signature

Make getter signature const-correct. This allows other functions with
const dirty bitmap parameter use bdrv_dirty_bitmap_granularity().

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 6bdc8b719a1617ec5ddfb13e78054df22fa12f84
      
https://github.com/qemu/qemu/commit/6bdc8b719a1617ec5ddfb13e78054df22fa12f84
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/dirty-bitmap.c
    M include/block/dirty-bitmap.h
    M include/qemu/hbitmap.h
    M util/hbitmap.c

  Log Message:
  -----------
  block/dirty-bitmap: add deserialize_ones func

Add bdrv_dirty_bitmap_deserialize_ones() function, which is needed for
qcow2 bitmap loading, to handle unallocated bitmap parts, marked as
all-ones.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 8a5bb1f114c5959cf6b247a737394afb0c518b40
      
https://github.com/qemu/qemu/commit/8a5bb1f114c5959cf6b247a737394afb0c518b40
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-refcount.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2-refcount: rename inc_refcounts() and make it public

This is needed for the following patch, which will introduce refcounts
checking for qcow2 bitmaps.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
[mreitz: s/inc_refcounts/qcow2_inc_refcounts_imrt/ in one more (new)
   place]
Signed-off-by: Max Reitz <address@hidden>


  Commit: 88ddffae8fc1e30cc907c2dbb989b7eba9e62319
      
https://github.com/qemu/qemu/commit/88ddffae8fc1e30cc907c2dbb989b7eba9e62319
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/Makefile.objs
    A block/qcow2-bitmap.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: add bitmaps extension

Add bitmap extension as specified in docs/specs/qcow2.txt.
For now, just mirror extension header into Qcow2 state and check
constraints. Also, calculate refcounts for qcow2 bitmaps, to not break
qemu-img check.

For now, disable image resize if it has bitmaps. It will be fixed later.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 8bfc932e1eaab86788bb08207d520bd2804422ae
      
https://github.com/qemu/qemu/commit/8bfc932e1eaab86788bb08207d520bd2804422ae
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/dirty-bitmap.c

  Log Message:
  -----------
  block/dirty-bitmap: fix comment for BlockDirtyBitmap.disabled field

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: d6883bc96890dae97757ee8a61aab7f18d9a66de
      
https://github.com/qemu/qemu/commit/d6883bc96890dae97757ee8a61aab7f18d9a66de
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/dirty-bitmap.c
    M block/io.c
    M blockdev.c
    M include/block/dirty-bitmap.h

  Log Message:
  -----------
  block/dirty-bitmap: add readonly field to BdrvDirtyBitmap

It will be needed in following commits for persistent bitmaps.
If bitmap is loaded from read-only storage (and we can't mark it
"in use" in this storage) corresponding BdrvDirtyBitmap should be
read-only.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: d1258dd0c87d27faa5d25f8d604e030dd2a5d3d7
      
https://github.com/qemu/qemu/commit/d1258dd0c87d27faa5d25f8d604e030dd2a5d3d7
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-bitmap.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: autoloading dirty bitmaps

Auto loading bitmaps are bitmaps in Qcow2, with the AUTO flag set. They
are loaded when the image is opened and become BdrvDirtyBitmaps for the
corresponding drive.

Extra data in bitmaps is not supported for now.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 50bf65bab69aa6d01f759732927fbbf1c8abfe15
      
https://github.com/qemu/qemu/commit/50bf65bab69aa6d01f759732927fbbf1c8abfe15
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: refactor bdrv_reopen_commit

Add bs local variable to simplify code.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: cb9ff6c25a25179736b7d8d9ddf00d45e5112a2b
      
https://github.com/qemu/qemu/commit/cb9ff6c25a25179736b7d8d9ddf00d45e5112a2b
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  block: new bdrv_reopen_bitmaps_rw interface

Add format driver handler, which should mark loaded read-only
bitmaps as 'IN_USE' in the image and unset read_only field in
corresponding BdrvDirtyBitmap's.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 1b6b0562dbf28dcae8faa02ac09a93e6623dd5d2
      
https://github.com/qemu/qemu/commit/1b6b0562dbf28dcae8faa02ac09a93e6623dd5d2
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-bitmap.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: support .bdrv_reopen_bitmaps_rw

Realize bdrv_reopen_bitmaps_rw interface.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: a0319aacd4f5356119c23657df640049777f038c
      
https://github.com/qemu/qemu/commit/a0319aacd4f5356119c23657df640049777f038c
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/dirty-bitmap.c
    M block/qcow2-bitmap.c
    M include/block/dirty-bitmap.h

  Log Message:
  -----------
  block/dirty-bitmap: add autoload field to BdrvDirtyBitmap

Mirror AUTO flag from Qcow2 bitmap in BdrvDirtyBitmap. This will be
needed in future, to save this flag back to Qcow2 for persistent
bitmaps.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: cca43ae1e1a5e2faf42d2db778edc8e76e10dc47
      
https://github.com/qemu/qemu/commit/cca43ae1e1a5e2faf42d2db778edc8e76e10dc47
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: bdrv_close: release bitmaps after drv->bdrv_close

Release bitmaps after 'if (bs->drv) { ... }' block. This will allow
format driver to save persistent bitmaps, which will appear in following
commits.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: a88b179fdbc68e00ae5eacd49e1bccad32440b5a
      
https://github.com/qemu/qemu/commit/a88b179fdbc68e00ae5eacd49e1bccad32440b5a
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/dirty-bitmap.c
    M block/qcow2-bitmap.c
    M include/block/dirty-bitmap.h

  Log Message:
  -----------
  block: introduce persistent dirty bitmaps

New field BdrvDirtyBitmap.persistent means, that bitmap should be saved
by format driver in .bdrv_close and .bdrv_inactivate. No format driver
supports it for now.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
[mreitz: Fixed indentation]
Signed-off-by: Max Reitz <address@hidden>


  Commit: 3dd10a06d173e0904c6d47ced1de67c40139d5b1
      
https://github.com/qemu/qemu/commit/3dd10a06d173e0904c6d47ced1de67c40139d5b1
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/dirty-bitmap.c
    M include/block/dirty-bitmap.h

  Log Message:
  -----------
  block/dirty-bitmap: add bdrv_dirty_bitmap_next()

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 5f72826e7fc62167cf3a37383d1c1151bc9971fe
      
https://github.com/qemu/qemu/commit/5f72826e7fc62167cf3a37383d1c1151bc9971fe
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-bitmap.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: add persistent dirty bitmaps support

Store persistent dirty bitmaps in qcow2 image.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
[mreitz: Always assign ret in store_bitmap() in case of an error]
Signed-off-by: Max Reitz <address@hidden>


  Commit: 169b87935966791a860f59a2b17c4e0c7b953779
      
https://github.com/qemu/qemu/commit/169b87935966791a860f59a2b17c4e0c7b953779
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-bitmap.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: store bitmaps on reopening image as read-only

Store bitmaps and mark them read-only on reopening image as read-only.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 67b792f5edec49fdd4e605d7a1d3a49095cd44bc
      
https://github.com/qemu/qemu/commit/67b792f5edec49fdd4e605d7a1d3a49095cd44bc
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  block: add bdrv_can_store_new_dirty_bitmap

This will be needed to check some restrictions before making bitmap
persistent in qmp-block-dirty-bitmap-add (this functionality will be
added by future patch)

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: da0eb242ad06b9e33300da7733a582bd61436fd2
      
https://github.com/qemu/qemu/commit/da0eb242ad06b9e33300da7733a582bd61436fd2
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-bitmap.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: add .bdrv_can_store_new_dirty_bitmap

Realize .bdrv_can_store_new_dirty_bitmap interface.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: fd5ae4ccbea17971e4202bbdaba4501627b15f70
      
https://github.com/qemu/qemu/commit/fd5ae4ccbea17971e4202bbdaba4501627b15f70
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M blockdev.c
    M qapi/block-core.json

  Log Message:
  -----------
  qmp: add persistent flag to block-dirty-bitmap-add

Add optional 'persistent' flag to qmp command block-dirty-bitmap-add.
Default is false.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: eb738bb50f216db5edbbf0a59c488cd685ef9e61
      
https://github.com/qemu/qemu/commit/eb738bb50f216db5edbbf0a59c488cd685ef9e61
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M blockdev.c
    M qapi/block-core.json

  Log Message:
  -----------
  qmp: add autoload parameter to block-dirty-bitmap-add

Optional. Default is false.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: a3b52535e8a577d9b12887a34183fe9077ea24d8
      
https://github.com/qemu/qemu/commit/a3b52535e8a577d9b12887a34183fe9077ea24d8
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/dirty-bitmap.c
    M blockdev.c
    M include/block/dirty-bitmap.h
    M include/qemu/hbitmap.h
    M qapi/block-core.json
    M tests/Makefile.include
    M util/hbitmap.c

  Log Message:
  -----------
  qmp: add x-debug-block-dirty-bitmap-sha256

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: fc905d3a0cd527e70af5fcce19c43596b7f5c046
      
https://github.com/qemu/qemu/commit/fc905d3a0cd527e70af5fcce19c43596b7f5c046
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  iotests: test qcow2 persistent dirty bitmap

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 56f364e6d745e46c9f6686df9a5d512d32e182ad
      
https://github.com/qemu/qemu/commit/56f364e6d745e46c9f6686df9a5d512d32e182ad
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap

Interface for removing persistent bitmap from its storage.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 469c71edc729ada7df63063ce2d7586762f4fda7
      
https://github.com/qemu/qemu/commit/469c71edc729ada7df63063ce2d7586762f4fda7
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-bitmap.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: add .bdrv_remove_persistent_dirty_bitmap

Realize .bdrv_remove_persistent_dirty_bitmap interface.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 5c36c1af274a66e92305d2c33534337552c6bff3
      
https://github.com/qemu/qemu/commit/5c36c1af274a66e92305d2c33534337552c6bff3
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M blockdev.c
    M qapi/block-core.json

  Log Message:
  -----------
  qmp: block-dirty-bitmap-remove: remove persistent

Remove persistent bitmap from the storage on block-dirty-bitmap-remove.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 615b5dcf2decbc5f0abb512d13d7e5db2385fa23
      
https://github.com/qemu/qemu/commit/615b5dcf2decbc5f0abb512d13d7e5db2385fa23
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block.c
    M block/dirty-bitmap.c
    M include/block/dirty-bitmap.h

  Log Message:
  -----------
  block: release persistent bitmaps on inactivate

We should release them here to reload on invalidate cache.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 2c6f6006429a94fc3f1a2d2e68719f300744566d
      
https://github.com/qemu/qemu/commit/2c6f6006429a94fc3f1a2d2e68719f300744566d
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/159
    M tests/qemu-iotests/170

  Log Message:
  -----------
  iotests: skip 159 & 170 with luks format

While the qemu-img dd command does accept --image-opts
this is not sufficient to make it work with the LUKS
image yet. This is because bdrv_create() still always
requires the non-image-opts syntax.

Thus we must skip 159/170 with luks for now

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 13a1d4a71bdbc0968886ed656dee0e35dfaaf906
      
https://github.com/qemu/qemu/commit/13a1d4a71bdbc0968886ed656dee0e35dfaaf906
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/033
    M tests/qemu-iotests/120
    M tests/qemu-iotests/140
    M tests/qemu-iotests/145
    M tests/qemu-iotests/157
    M tests/qemu-iotests/157.out
    M tests/qemu-iotests/174
    M tests/qemu-iotests/181
    M tests/qemu-iotests/common.qemu

  Log Message:
  -----------
  iotests: fix remainining tests to work with LUKS

The tests 033, 140, 145 and 157 were all broken
when run with LUKS, since they did not correctly use
the required image opts args syntax to specify the
decryption secret. Further, the 120 test simply does
not make sense to run with luks, as the scenario
exercised is not relevant.

The test 181 was broken when run with LUKS because
it didn't take account of fact that $TEST_IMG was
already in image opts syntax. The launch_qemu
helper also didn't register the secret object
providing the LUKS password.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 307d999198599fe672e69379c99b6db17b961b4e
      
https://github.com/qemu/qemu/commit/307d999198599fe672e69379c99b6db17b961b4e
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/149
    M tests/qemu-iotests/149.out
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.rc

  Log Message:
  -----------
  iotests: reduce PBKDF iterations when testing LUKS

By default the PBKDF algorithm used with LUKS is tuned
based on the number of iterations to produce 1 second
of running time. This makes running the I/O test with
the LUKS format orders of magnitude slower than with
qcow2/raw formats.

When creating LUKS images, set the iteration time to
a 10ms to reduce the time overhead for LUKS, since
security does not matter in I/O tests.

Previously a full 'check -luks' would take

  $ time ./check -luks
  Passed all 22 tests

  real  23m9.988s
  user  21m46.223s
  sys   0m22.841s

Now it takes

  $ time ./check -luks
  Passed all 22 tests

  real  4m39.235s
  user  3m29.590s
  sys   0m24.234s

Still slow compared to qcow2/raw, but much improved
none the less.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: a488e71e1e3d1568eb926f80e828e0d440af916b
      
https://github.com/qemu/qemu/commit/a488e71e1e3d1568eb926f80e828e0d440af916b
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  iotests: add more LUKS hash combination tests

Add tests for sha224, sha512, sha384 and ripemd160 hash
algorithms.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: ae50b71db01df0bb0b39694ab12354b80c9c95df
      
https://github.com/qemu/qemu/commit/ae50b71db01df0bb0b39694ab12354b80c9c95df
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  iotests: chown LUKS device before qemu-io launches

On some distros, whenever you close a block device file
descriptor there is a udev rule that resets the file
permissions. This can race with the test script when
we run qemu-io multiple times against the same block
device. Occasionally the second qemu-io invocation
will find udev has reset the permissions causing failure.

Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 3190683ea322f2c779b85b3f8f59b2f11bdacb2e
      
https://github.com/qemu/qemu/commit/3190683ea322f2c779b85b3f8f59b2f11bdacb2e
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/common.config

  Log Message:
  -----------
  iotests: Use absolute paths for executables

A user may specify a relative path for accessing qemu, qemu-img, etc.
through environment variables ($QEMU_PROG and friends) or a symlink.

If a test decides to change its working directory, relative paths will
cease to work, however. Work around this by making all of the paths to
programs that should undergo testing absolute. Besides "realpath", we
also have to use "type -p" to support programs in $PATH.

As a side effect, this fixes specifying these programs as symlinks for
out-of-tree builds: Before, you would have to create two symlinks, one
in the build and one in the source tree (the first one for common.config
to find, the second one for the iotest to use). Now it is sufficient to
create one in the build tree because common.config will resolve it.

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


  Commit: 6f55dfa4a418041033f6457e4635dc3cefe10cf7
      
https://github.com/qemu/qemu/commit/6f55dfa4a418041033f6457e4635dc3cefe10cf7
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  iotests: Add test for colon handling

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: b43671f80cda8d0f11dcb929ed76fbd680c29cec
      
https://github.com/qemu/qemu/commit/b43671f80cda8d0f11dcb929ed76fbd680c29cec
  Author: Eric Blake <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M qemu-options.hx
    M tests/multiboot/run_test.sh
    M tests/qemu-iotests/051
    M tests/qemu-iotests/068
    M tests/qemu-iotests/142
    M tests/qemu-iotests/171
    M tests/qemu-iotests/check
    M tests/rocker/all
    M tests/tcg/cris/Makefile

  Log Message:
  -----------
  tests: Avoid non-portable 'echo -ARG'

POSIX says that backslashes in the arguments to 'echo', as well as
any use of 'echo -n' and 'echo -e', are non-portable; it recommends
people should favor 'printf' instead.  This is definitely true where
we do not control which shell is running (such as in makefile snippets
or in documentation examples).  But even for scripts where we
require bash (and therefore, where echo does what we want by default),
it is still possible to use 'shopt -s xpg_echo' to change bash's
behavior of echo.  And setting a good example never hurts when we are
not sure if a snippet will be copied from a bash-only script to a
general shell script (although I don't change the use of non-portable
\e for ESC when we know the running shell is bash).

Replace 'echo -n "..."' with 'printf %s "..."', and 'echo -e "..."'
with 'printf %b "...\n"', with the optimization that the %s/%b
argument can be omitted if the string being printed is a strict
literal with no '%', '$', or '`' (we could technically also make
this optimization when there are $ or `` substitutions but where
we can prove their results will not be problematic, but proving
that such substitutions are safe makes the patch less trivial
compared to just being consistent).

In the qemu-iotests check script, fix unusual shell quoting
that would result in word-splitting if 'date' outputs a space.

In test 051, take an opportunity to shorten the line.

In test 068, get rid of a pointless second invocation of bash.

CC: address@hidden
Signed-off-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 90880ff107ecaada2a06a823dc5fa652f6e37a62
      
https://github.com/qemu/qemu/commit/90880ff107ecaada2a06a823dc5fa652f6e37a62
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block.c
    M include/block/block.h
    M include/block/block_int.h
    M qapi/block-core.json

  Log Message:
  -----------
  block: add bdrv_measure() API

bdrv_measure() provides a conservative maximum for the size of a new
image.  This information is handy if storage needs to be allocated (e.g.
a SAN or an LVM volume) ahead of time.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: a843a22a82e0b2bf5841af8a074066ea1d18997a
      
https://github.com/qemu/qemu/commit/a843a22a82e0b2bf5841af8a074066ea1d18997a
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/raw-format.c

  Log Message:
  -----------
  raw-format: add bdrv_measure() support

Maximum size calculation is trivial for the raw format: it's just the
requested image size (because there is no metadata).

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 95c67e3bd747b119aa0a902778e1c20fd7fded7f
      
https://github.com/qemu/qemu/commit/95c67e3bd747b119aa0a902778e1c20fd7fded7f
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: extract preallocation calculation function

Calculating the preallocated image size will be needed to implement
.bdrv_measure().  Extract the code out into a separate function.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 7c5bcc42120119bb46d8b2a422053467bcc7291c
      
https://github.com/qemu/qemu/commit/7c5bcc42120119bb46d8b2a422053467bcc7291c
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: make refcount size calculation conservative

The refcount metadata size calculation is inaccurate and can produce
numbers that are too small.  This is bad because we should calculate a
conservative number - one that is guaranteed to be large enough.

This patch switches the approach to a fixed point calculation because
the existing equation is hard to solve when inaccuracies are taken care
of.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 0eb4a8c1df6db29e835daeb954352bfaa8994374
      
https://github.com/qemu/qemu/commit/0eb4a8c1df6db29e835daeb954352bfaa8994374
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: extract image creation option parsing

The image creation options parsed by qcow2_create() are also needed to
implement .bdrv_measure().  Extract the parsing code, including input
validation.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: c501c35220856621e9677ba9e6a556948d49778e
      
https://github.com/qemu/qemu/commit/c501c35220856621e9677ba9e6a556948d49778e
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: add bdrv_measure() support

Use qcow2_calc_prealloc_size() to get the required file size.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: fd03c2b8fbf463f92413ed70a978bf70ebbc74c7
      
https://github.com/qemu/qemu/commit/fd03c2b8fbf463f92413ed70a978bf70ebbc74c7
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M qemu-img-cmds.hx
    M qemu-img.c
    M qemu-img.texi

  Log Message:
  -----------
  qemu-img: add measure subcommand

The measure subcommand calculates the size required by a new image file.
This can be used by users or management tools that need to allocate
space on an LVM volume, SAN LUN, etc before creating or converting an
image file.

Suggested-by: Maor Lipchuk <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 217a0683b754fed7f7c7ad5c241a7ddb52506844
      
https://github.com/qemu/qemu/commit/217a0683b754fed7f7c7ad5c241a7ddb52506844
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M tests/qemu-iotests/check

  Log Message:
  -----------
  qemu-iotests: support per-format golden output files

Some tests produce format-dependent output.  Either the difference is
filtered out and ignored, or the test case is format-specific so we
don't need to worry about per-format output differences.

There is a third case: the test script is the same for all image formats
and the format-dependent output is relevant.  An ugly workaround is to
copy-paste the test into multiple per-format test cases.  This
duplicates code and is not maintainable.

This patch allows test cases to add per-format golden output files so a
single test case can work correctly when format-dependent output must be
checked:

  123.out.qcow2
  123.out.raw
  123.out.vmdk
  ...

This naming scheme is not composable with 123.out.nocache or 123.pc.out,
two other scenarios where output files are split.  I don't think it
matters since few test cases need these features.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 32a1681adc44f52e7c8a19408cd3be8452a0897b
      
https://github.com/qemu/qemu/commit/32a1681adc44f52e7c8a19408cd3be8452a0897b
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    A tests/qemu-iotests/178
    A tests/qemu-iotests/178.out.qcow2
    A tests/qemu-iotests/178.out.raw
    M tests/qemu-iotests/group

  Log Message:
  -----------
  iotests: add test 178 for qemu-img measure

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 8243ccb7433e59a3faa3cca27fb6c40d6da2b37c
      
https://github.com/qemu/qemu/commit/8243ccb7433e59a3faa3cca27fb6c40d6da2b37c
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block.c
    M block/blkdebug.c
    M block/crypto.c
    M block/file-posix.c
    M block/file-win32.c
    M block/gluster.c
    M block/iscsi.c
    M block/nfs.c
    M block/qcow2.c
    M block/qed.c
    M block/raw-format.c
    M block/rbd.c
    M block/sheepdog.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Add PreallocMode to BD.bdrv_truncate()

Add a PreallocMode parameter to the bdrv_truncate() function implemented
by each block driver. Currently, we always pass PREALLOC_MODE_OFF and no
driver accepts anything else.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 7ea37c30660d4cd6aca21a324fabefe23b89f931
      
https://github.com/qemu/qemu/commit/7ea37c30660d4cd6aca21a324fabefe23b89f931
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block.c
    M block/blkdebug.c
    M block/block-backend.c
    M block/crypto.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/raw-format.c
    M block/vhdx-log.c
    M block/vhdx.c
    M include/block/block.h

  Log Message:
  -----------
  block: Add PreallocMode to bdrv_truncate()

For block drivers that just pass a truncate request to the underlying
protocol, we can now pass the preallocation mode instead of aborting if
it is not PREALLOC_MODE_OFF.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 3a691c50f10344b052ad70a4d0ed935276ccca3c
      
https://github.com/qemu/qemu/commit/3a691c50f10344b052ad70a4d0ed935276ccca3c
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/block-backend.c
    M block/commit.c
    M block/mirror.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M blockdev.c
    M include/sysemu/block-backend.h
    M qemu-img.c
    M qemu-io-cmds.c

  Log Message:
  -----------
  block: Add PreallocMode to blk_truncate()

blk_truncate() itself will pass that value to bdrv_truncate(), and all
callers of blk_truncate() just set the parameter to PREALLOC_MODE_OFF
for now.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: dc5f690b97ccdffa79fe7169bb26b0ebf06688bf
      
https://github.com/qemu/qemu/commit/dc5f690b97ccdffa79fe7169bb26b0ebf06688bf
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  qemu-img: Expose PreallocMode for resizing

Add a --preallocation command line option to qemu-img resize which can
be used to set the PreallocMode parameter of blk_truncate().

While touching this code, fix the fact that we did not handle errors
returned by blk_getlength().

Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 7dacd8bd3d1f7eeb1850d5ad8e1898e6d314889f
      
https://github.com/qemu/qemu/commit/7dacd8bd3d1f7eeb1850d5ad8e1898e6d314889f
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  block/file-posix: Small fixes in raw_create()

Variables should be declared at the start of a block, and if a certain
parameter value is not supported it may be better to return -ENOTSUP
instead of -EINVAL.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 9f63b07ee7feefd5f5a1175614b6948264e9d7e0
      
https://github.com/qemu/qemu/commit/9f63b07ee7feefd5f5a1175614b6948264e9d7e0
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  block/file-posix: Extract raw_regular_truncate()

This functionality is part of raw_create() which we will be able to
reuse nicely in raw_truncate().

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: d0bc9e5d5e86d5dd566e2d967af8476cee351c93
      
https://github.com/qemu/qemu/commit/d0bc9e5d5e86d5dd566e2d967af8476cee351c93
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  block/file-posix: Generalize raw_regular_truncate

Currently, raw_regular_truncate() is intended for setting the size of a
newly created file. However, we also want to use it for truncating an
existing file in which case only the newly added space (when growing)
should be preallocated.

This also means that if resizing failed, we should try to restore the
original file size. This is important when using preallocation.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 35d72602ec5709b5078ff0e6361eee57fb652f98
      
https://github.com/qemu/qemu/commit/35d72602ec5709b5078ff0e6361eee57fb652f98
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  block/file-posix: Preallocation for truncate

By using raw_regular_truncate() in raw_truncate(), we can now easily
support preallocation.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 7bc45dc17265772abe5dd1d4649c7bb42e1c6df1
      
https://github.com/qemu/qemu/commit/7bc45dc17265772abe5dd1d4649c7bb42e1c6df1
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  block/qcow2: Generalize preallocate()

This patch adds two new parameters to the preallocate() function so we
will be able to use it not just for preallocating a new image but also
for preallocated image growth.

The offset parameter allows the caller to specify a virtual offset from
which to start preallocating. For newly created images this is always 0,
but for preallocating growth this will be the old image length.

The new_length parameter specifies the supposed new length of the image
(basically the "end offset" for preallocation). During image truncation,
bdrv_getlength() will return the old image length so we cannot rely on
its return value then.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 652fecd0058de7d90609c347bfdbeff76ef817a6
      
https://github.com/qemu/qemu/commit/652fecd0058de7d90609c347bfdbeff76ef817a6
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  block/qcow2: Lock s->lock in preallocate()

preallocate() is and will be called only from places that do not
otherwise need to lock s->lock: Currently that is qcow2_create2(), as of
a future patch it will be called from qcow2_truncate(), too.

It therefore makes sense to move locking that mutex into preallocate()
itself.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 95b98f343b054e100a905181cd140c653c80cbad
      
https://github.com/qemu/qemu/commit/95b98f343b054e100a905181cd140c653c80cbad
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  block/qcow2: Metadata preallocation for truncate

We can support PREALLOC_MODE_METADATA by invoking preallocate() in
qcow2_truncate().

Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 12cc30a8cbdbb4c9c90cbffb970dfa679a1e3212
      
https://github.com/qemu/qemu/commit/12cc30a8cbdbb4c9c90cbffb970dfa679a1e3212
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qcow2.h
    M tests/qemu-iotests/044.out

  Log Message:
  -----------
  block/qcow2: Add qcow2_refcount_area()

This function creates a collection of self-describing refcount
structures (including a new refcount table) at the end of a qcow2 image
file. Optionally, these structures can also describe a number of
additional clusters beyond themselves; this will be important for
preallocated truncation, which will place the data clusters and L2
tables there.

For now, we can use this function to replace the part of
alloc_refcount_block() that grows the refcount table (from which it is
actually derived).

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 60c48a29b75f3e1276bb046186476674bbc74de9
      
https://github.com/qemu/qemu/commit/60c48a29b75f3e1276bb046186476674bbc74de9
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-refcount.c

  Log Message:
  -----------
  block/qcow2: Rename "fail_block" to just "fail"

Now alloc_refcount_block() only contains a single fail label, so it
makes more sense to just name it "fail" instead of "fail_block".

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 772d1f973f87269f6a4a4ea4b880680f3779bbdf
      
https://github.com/qemu/qemu/commit/772d1f973f87269f6a4a4ea4b880680f3779bbdf
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

  Changed paths:
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  block/qcow2: falloc/full preallocating growth

Implement the preallocation modes falloc and full for growing qcow2
images.

Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: a2c7e082123a17dc1e31262ad136a3b45b3b0cb6
      
https://github.com/qemu/qemu/commit/a2c7e082123a17dc1e31262ad136a3b45b3b0cb6
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  iotests: Add preallocated resize test for raw

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: ced14843229cd42c282f0ee4b43bbcdc324c923a
      
https://github.com/qemu/qemu/commit/ced14843229cd42c282f0ee4b43bbcdc324c923a
  Author: Max Reitz <address@hidden>
  Date:   2017-07-11 (Tue, 11 Jul 2017)

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

  Log Message:
  -----------
  iotests: Add preallocated growth test for qcow2

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 76fba746ea73c752f0168e511566f74fe4d2d32c
      
https://github.com/qemu/qemu/commit/76fba746ea73c752f0168e511566f74fe4d2d32c
  Author: Peter Maydell <address@hidden>
  Date:   2017-07-13 (Thu, 13 Jul 2017)

  Changed paths:
    M block.c
    M block/Makefile.objs
    M block/blkdebug.c
    M block/block-backend.c
    M block/commit.c
    M block/crypto.c
    A block/crypto.h
    M block/dirty-bitmap.c
    M block/file-posix.c
    M block/file-win32.c
    M block/gluster.c
    M block/io.c
    M block/iscsi.c
    M block/mirror.c
    M block/nfs.c
    M block/parallels.c
    M block/qapi.c
    M block/qcow.c
    A block/qcow2-bitmap.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qcow2.h
    M block/qed.c
    M block/raw-format.c
    M block/rbd.c
    M block/sheepdog.c
    M block/vdi.c
    M block/vhdx-log.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M blockdev.c
    M crypto/block-luks.c
    M crypto/block-qcow.c
    M crypto/block.c
    M crypto/blockpriv.h
    M docs/interop/qcow2.txt
    M hmp-commands.hx
    M hmp.c
    M include/block/block.h
    M include/block/block_int.h
    M include/block/dirty-bitmap.h
    M include/crypto/block.h
    M include/monitor/monitor.h
    M include/qapi/error.h
    M include/qemu/hbitmap.h
    M include/qemu/osdep.h
    M include/sysemu/block-backend.h
    M monitor.c
    M qapi-schema.json
    M qapi/block-core.json
    M qapi/common.json
    M qemu-doc.texi
    M qemu-img-cmds.hx
    M qemu-img.c
    M qemu-img.texi
    M qemu-io-cmds.c
    M qemu-io.c
    M qemu-options.hx
    M qmp.c
    M tests/Makefile.include
    M tests/multiboot/run_test.sh
    M tests/qemu-iotests/033
    M tests/qemu-iotests/042
    M tests/qemu-iotests/044.out
    M tests/qemu-iotests/048
    M tests/qemu-iotests/049
    M tests/qemu-iotests/049.out
    M tests/qemu-iotests/051
    M tests/qemu-iotests/068
    M tests/qemu-iotests/082.out
    M tests/qemu-iotests/085.out
    M tests/qemu-iotests/087
    M tests/qemu-iotests/087.out
    A tests/qemu-iotests/106
    A tests/qemu-iotests/106.out
    M tests/qemu-iotests/120
    A tests/qemu-iotests/125
    A tests/qemu-iotests/125.out
    A tests/qemu-iotests/126
    A tests/qemu-iotests/126.out
    M tests/qemu-iotests/134
    M tests/qemu-iotests/134.out
    M tests/qemu-iotests/140
    M tests/qemu-iotests/142
    M tests/qemu-iotests/144.out
    M tests/qemu-iotests/145
    M tests/qemu-iotests/149
    M tests/qemu-iotests/149.out
    M tests/qemu-iotests/157
    M tests/qemu-iotests/157.out
    M tests/qemu-iotests/158
    M tests/qemu-iotests/158.out
    M tests/qemu-iotests/159
    A tests/qemu-iotests/165
    A tests/qemu-iotests/165.out
    M tests/qemu-iotests/170
    M tests/qemu-iotests/171
    M tests/qemu-iotests/174
    A tests/qemu-iotests/178
    A tests/qemu-iotests/178.out.qcow2
    A tests/qemu-iotests/178.out.raw
    M tests/qemu-iotests/181
    M tests/qemu-iotests/185.out
    A tests/qemu-iotests/188
    A tests/qemu-iotests/188.out
    A tests/qemu-iotests/189
    A tests/qemu-iotests/189.out
    M tests/qemu-iotests/check
    M tests/qemu-iotests/common
    M tests/qemu-iotests/common.config
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.qemu
    M tests/qemu-iotests/common.rc
    M tests/qemu-iotests/group
    M tests/rocker/all
    M tests/tcg/cris/Makefile
    M tests/test-crypto-block.c
    M tests/test-hbitmap.c
    M util/hbitmap.c
    M util/oslib-posix.c
    M util/oslib-win32.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2017-07-11' 
into staging

Block layer patches

# gpg: Signature made Tue 11 Jul 2017 17:05:56 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-07-11: (85 commits)
  iotests: Add preallocated growth test for qcow2
  iotests: Add preallocated resize test for raw
  block/qcow2: falloc/full preallocating growth
  block/qcow2: Rename "fail_block" to just "fail"
  block/qcow2: Add qcow2_refcount_area()
  block/qcow2: Metadata preallocation for truncate
  block/qcow2: Lock s->lock in preallocate()
  block/qcow2: Generalize preallocate()
  block/file-posix: Preallocation for truncate
  block/file-posix: Generalize raw_regular_truncate
  block/file-posix: Extract raw_regular_truncate()
  block/file-posix: Small fixes in raw_create()
  qemu-img: Expose PreallocMode for resizing
  block: Add PreallocMode to blk_truncate()
  block: Add PreallocMode to bdrv_truncate()
  block: Add PreallocMode to BD.bdrv_truncate()
  iotests: add test 178 for qemu-img measure
  qemu-iotests: support per-format golden output files
  qemu-img: add measure subcommand
  qcow2: add bdrv_measure() support
  ...

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


Compare: https://github.com/qemu/qemu/compare/f0d2ead97cdd...76fba746ea73

reply via email to

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