qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 04df76: block: Add bdrv_next_node


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 04df76: block: Add bdrv_next_node
Date: Thu, 11 Dec 2014 08:00:08 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 04df765ab449df24666269b0de0caf6ff250c568
      
https://github.com/qemu/qemu/commit/04df765ab449df24666269b0de0caf6ff250c568
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  block: Add bdrv_next_node

Similar to bdrv_next, this traverses through graph_bdrv_states. Will be
useful to enumerate all the named nodes.

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


  Commit: 20a9e77dfabb3e664c0873726be1540175a4fda1
      
https://github.com/qemu/qemu/commit/20a9e77dfabb3e664c0873726be1540175a4fda1
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  block: Add bdrv_get_node_name

This returns the node name of a BDS. Remove the TODO comment and expect
the callers to be explicit.

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


  Commit: 4875a77950811631c26e156592e8b8df22208085
      
https://github.com/qemu/qemu/commit/4875a77950811631c26e156592e8b8df22208085
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  block: Include "node-name" if present in query-blockstats

Node name is a better identifier of BDS.

We will want to query statistics of a BDS node buried in the BDS graph,
so reporting the node's name if there is one will do the trick.

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


  Commit: f71eaa74c0bf2cf9da9a00b571d4b8162c61e29d
      
https://github.com/qemu/qemu/commit/f71eaa74c0bf2cf9da9a00b571d4b8162c61e29d
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/qapi.c
    M hmp.c
    M qapi/block-core.json
    M qmp-commands.hx

  Log Message:
  -----------
  qmp: Add optional switch "query-nodes" in query-blockstats

This bool option will allow query all the node names. It iterates all
the BDSes that are assigned a name, also in this case don't query up the
backing chain.

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


  Commit: 4b58554a0e60aba6f1c6f391759f148f7bca181b
      
https://github.com/qemu/qemu/commit/4b58554a0e60aba6f1c6f391759f148f7bca181b
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M qobject/qjson.c

  Log Message:
  -----------
  qjson: Drop trailing space for pretty formatting

For the pretty formatting, the functions converting QDicts and QLists to
JSON should not print a space after the comma separating objects,
because a newline will emitted immediately afterwards, making the
whitespace superfluous.

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


  Commit: 4821cd4cfd50185979d9a8c335acb62d97972dbb
      
https://github.com/qemu/qemu/commit/4821cd4cfd50185979d9a8c335acb62d97972dbb
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M qemu-options.hx
    M vl.c

  Log Message:
  -----------
  chardev: Add -qmp-pretty

Add a command line option for adding a QMP monitor using pretty JSON
formatting.

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


  Commit: cc20b07a421ba39413111813b4016745fee11f08
      
https://github.com/qemu/qemu/commit/cc20b07a421ba39413111813b4016745fee11f08
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  iotests: _filter_qmp for pretty JSON output

_filter_qmp should be able to correctly filter out the QMP version
object for pretty JSON output.

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


  Commit: 2389eeae690b68e9d6a17cb10a5a7c7ec58009a1
      
https://github.com/qemu/qemu/commit/2389eeae690b68e9d6a17cb10a5a7c7ec58009a1
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  iotests: Use -qmp-pretty in 067

067 invokes query-block, resulting in a reference output with really
long lines (which may pose a problem in email patches and always poses a
problem when the output changes, because it is hard to see what has
actually changed). Use -qmp-pretty to mitigate this issue.

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


  Commit: 4ef3982a99f9d2634588b4785c8d841605517946
      
https://github.com/qemu/qemu/commit/4ef3982a99f9d2634588b4785c8d841605517946
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev.c
    M hw/block/dataplane/virtio-blk.c

  Log Message:
  -----------
  blockdev: acquire AioContext in blockdev-snapshot-delete-internal-sync

Add dataplane support to the blockdev-snapshot-delete-internal-sync QMP
command.  By acquiring the AioContext we avoid race conditions with the
dataplane thread which may also be accessing the BlockDriverState.

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


  Commit: 0b92885420c9cf42da27c63939d388e276a7ddde
      
https://github.com/qemu/qemu/commit/0b92885420c9cf42da27c63939d388e276a7ddde
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: check for BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE

The BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE op blocker exists but was
never used!  Let's fix that so snapshot delete can be blocked.

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


  Commit: e3442099a2794925dfbe83711cd204caf80eae60
      
https://github.com/qemu/qemu/commit/e3442099a2794925dfbe83711cd204caf80eae60
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev.c
    M hw/block/dataplane/virtio-blk.c

  Log Message:
  -----------
  blockdev: acquire AioContext in eject, change, and block_passwd

By acquiring the AioContext we avoid race conditions with the dataplane
thread which may also be accessing the BlockDriverState.

Fix up eject, change, and block_passwd in a single patch because
qmp_eject() and qmp_change_blockdev() both call eject_device().  Also
fix block_passwd while we're tackling a command that takes a block
encryption password.

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


  Commit: 729962f6db43bf262a446f5e13d900ffb3c54a88
      
https://github.com/qemu/qemu/commit/729962f6db43bf262a446f5e13d900ffb3c54a88
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev.c
    M hw/block/dataplane/virtio-blk.c

  Log Message:
  -----------
  blockdev: acquire AioContext in change-backing-file

Add dataplane support to the change-backing-file QMP commands.  By
acquiring the AioContext we avoid race conditions with the dataplane
thread which may also be accessing the BlockDriverState.

Note that this command operates on both bs and a node in its chain
(image_bs).  The bdrv_chain_contains(bs, image_bs) check guarantees that
bs and image_bs are in the same AioContext.

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


  Commit: 9e193c5a652faff719d7186e27f680e3888925a6
      
https://github.com/qemu/qemu/commit/9e193c5a652faff719d7186e27f680e3888925a6
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/qapi.c
    M hmp.c
    M qapi/block-core.json
    M tests/qemu-iotests/051.out
    M tests/qemu-iotests/067.out

  Log Message:
  -----------
  block/qapi: Add cache information to query-block

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


  Commit: 289b276c69a8b5f90531b41917a536e16bf71837
      
https://github.com/qemu/qemu/commit/289b276c69a8b5f90531b41917a536e16bf71837
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M hmp.c

  Log Message:
  -----------
  block/hmp: Factor out print_block_info()

The new function prints the info for a single BlockDriverState.

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


  Commit: 8d6adccda25d75dc152b68d15ac75e1670e59b23
      
https://github.com/qemu/qemu/commit/8d6adccda25d75dc152b68d15ac75e1670e59b23
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M hmp.c

  Log Message:
  -----------
  block/hmp: Allow info = NULL in print_block_info()

This allows printing infos of BlockDriverStates that aren't at the root
of the graph (and logically implementing a BlockBackend).

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


  Commit: e6bb31ec6f7ef7c78c897390ecc6c6a34a7f9f5a
      
https://github.com/qemu/qemu/commit/e6bb31ec6f7ef7c78c897390ecc6c6a34a7f9f5a
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M hmp.c
    M monitor.c

  Log Message:
  -----------
  block/hmp: Allow node-name in 'info block'

The optional parameter specifying a block device allows now to use a
node-name instead of a drive name (and therefore to inspect any node in
the graph). The new -n options allows listing all named nodes instead of
BlockBackends.

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


  Commit: 48fe86f6400574165979e0db6f5937ad487b6888
      
https://github.com/qemu/qemu/commit/48fe86f6400574165979e0db6f5937ad487b6888
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: Fix HMP tab completion

Commands with multiple boolean flag options (like 'info block') didn't
provide correct completion because only the first one was skipped.

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


  Commit: 8779441b1b0e03bd3e5213dee447ab0c955e374b
      
https://github.com/qemu/qemu/commit/8779441b1b0e03bd3e5213dee447ab0c955e374b
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  blkdebug: Simplify and improve filename generation

Instead of actually recreating the options from scratch, just reuse the
options given for creating the BDS, which are the configuration file
name and additional options. In case there are no additional options we
can thus create a plain filename.

This obviously results in a different output for qemu-iotest 099 which
exactly tests this filename generation. Fix it up as well.

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


  Commit: f48a33b608b6d98cbe2eaba27cbae925fc221284
      
https://github.com/qemu/qemu/commit/f48a33b608b6d98cbe2eaba27cbae925fc221284
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  iotests: Plain blkdebug filename generation

Add one test whether blkdebug is able to generate a plain filename if
given a configuration file and a file to be tested only; and add another
test whether blkdebug is able to do the same without being given a
configuration file.

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


  Commit: 192cf55cc02dc0838bbfa5ac17feb7f6c1651441
      
https://github.com/qemu/qemu/commit/192cf55cc02dc0838bbfa5ac17feb7f6c1651441
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M hw/ide/ahci.c

  Log Message:
  -----------
  ahci: avoid #ifdef DEBUG_AHCI bitrot

Debug code using #ifdef is susceptible to bitrot because the compiler
never checks the debug code.

This is easy to avoid, change the DPRINTF() macro to use if (DEBUG_AHCI)
and always give it a 0 or 1 value.

This also allows us to drop an #ifdef DEBUG_AHCI in ahci_start_dma()
since the compiler can now see the local variable is used.

The motivation for this change is a recent DEBUG_AHCI build failure due
to an outdated DPRINTF() format string.  From now on the compiler will
catch these errors.

Cc: John Snow <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 17fcb74af922ba9f761d11e874314c32a3445e97
      
https://github.com/qemu/qemu/commit/17fcb74af922ba9f761d11e874314c32a3445e97
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M hw/ide/ahci.c
    M hw/ide/ahci.h

  Log Message:
  -----------
  ahci: replace SATA FIS type magic numbers with constants

SATA 3.0 "10.3.1 FIS Type values" defines the constants used to
differentiate between FIS types.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 2bb0dce76245762dbc0a8fe12516faa127a64e5b
      
https://github.com/qemu/qemu/commit/2bb0dce76245762dbc0a8fe12516faa127a64e5b
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  block: Lift more functions into BlockBackend

There are already some blk_aio_* functions, so we might as well have
blk_co_* functions (as far as we need them). This patch adds
blk_co_flush(), blk_co_discard(), and also blk_invalidate_cache() (which
is not a blk_co_* function but is needed nonetheless).

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


  Commit: 2019ba0a0197afc85495546f337345a7150710fc
      
https://github.com/qemu/qemu/commit/2019ba0a0197afc85495546f337345a7150710fc
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  block: Add AioContextNotifier functions to BB

Because all BlockDriverStates behind a single BlockBackend reside in a
single AioContext, it is fine to just pass these functions
(blk_add_aio_context_notifier() and blk_remove_aio_context_notifier())
through to the root BlockDriverState.

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


  Commit: 2c28b21f7c97ae4e2082536f36e97b1337e3d195
      
https://github.com/qemu/qemu/commit/2c28b21f7c97ae4e2082536f36e97b1337e3d195
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  block: Add blk_add_close_notifier() for BB

Adding something like a "delete notifier" to a BlockBackend would not
make much sense, because whoever is interested in registering there will
probably hold a reference to that BlockBackend; therefore, the notifier
will never be called (or only when the notifiee already relinquished its
reference and thus most probably is no longer interested in that
notification).

Therefore, this patch just passes through the close notifier interface
of the root BDS. This will be called when the device is ejected, for
instance, and therefore does make sense.

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


  Commit: e140177d9cd067050004be6f725c3a0750ccdd94
      
https://github.com/qemu/qemu/commit/e140177d9cd067050004be6f725c3a0750ccdd94
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev-nbd.c
    M include/block/nbd.h
    M nbd.c
    M qemu-nbd.c

  Log Message:
  -----------
  nbd: Change external interface to BlockBackend

Substitute BlockDriverState by BlockBackend in every globally visible
function provided by nbd.

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


  Commit: aadf99a792be864c8feb1cc61e2c8fd225fa7c01
      
https://github.com/qemu/qemu/commit/aadf99a792be864c8feb1cc61e2c8fd225fa7c01
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M nbd.c

  Log Message:
  -----------
  nbd: Use BlockBackend internally

With all externally visible functions changed to use BlockBackend, this
patch makes nbd use BlockBackend for everything internally as well.

While touching them, substitute 512 by BDRV_SECTOR_SIZE in the calls to
blk_read(), blk_write() and blk_co_discard().

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


  Commit: 4c58e80acd61e24f307c1b2557079cc77dc9150a
      
https://github.com/qemu/qemu/commit/4c58e80acd61e24f307c1b2557079cc77dc9150a
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M qemu-nbd.c

  Log Message:
  -----------
  qemu-nbd: Use BlockBackend where reasonable

Because qemu-nbd creates the BlockBackend by itself, it should create
the according BlockDriverState tree by itself as well; that means, it
has call bdrv_open() on its own. This is one of the places where
qemu-nbd still needs to use a BlockDriverState directly (the root BDS
below the BB); other places are the configuration of zero detection
(which may be lifted into the BB eventually, but is not yet) and
temporarily loading a snapshot.

Everywhere else, though, qemu-nbd can and thus should use BlockBackend.

Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: e465ce7d09939d631f1861e0bd8873417c1c0d65
      
https://github.com/qemu/qemu/commit/e465ce7d09939d631f1861e0bd8873417c1c0d65
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  tests: Use "command -v" instead of which(1) in shell scripts

When which(1) is not installed, we would complain "perl not found"
because it's the first set_prog_path check. The error message is
wrong.

Fix it by using "command -v", a native way to query the existence of a
command.

Suggested-by: Eric Blake <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: be6273da9e31d30fc95a65b09a0b819a89f1cc62
      
https://github.com/qemu/qemu/commit/be6273da9e31d30fc95a65b09a0b819a89f1cc62
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M qemu-io.c

  Log Message:
  -----------
  qemu-io: Allow explicitly specifying format

This adds a -f option to qemu-io which allows to explicitly specify the
block driver to use for the given image.

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


  Commit: 8f9e835fd2e687d2bfe936819c3494af4343614d
      
https://github.com/qemu/qemu/commit/8f9e835fd2e687d2bfe936819c3494af4343614d
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M tests/qemu-iotests/016
    M tests/qemu-iotests/048
    M tests/qemu-iotests/058
    M tests/qemu-iotests/071
    M tests/qemu-iotests/071.out
    M tests/qemu-iotests/077
    M tests/qemu-iotests/081
    M tests/qemu-iotests/081.out
    M tests/qemu-iotests/089
    M tests/qemu-iotests/common

  Log Message:
  -----------
  qemu-iotests: Use qemu-io -f $IMGFMT

This patch changes $QEMU_IO so that all tests by default pass a format
argument to qemu-io.

There are a few cases where -f $IMGFMT is not wanted because it selects
the wrong driver or json: filenames including a driver are used. They
are changed to use $QEMU_IO_PROG, which doesn't include any options.

Tests 071 and 081 have output changes because now the actual request
fails instead of reading the 2k probing buffer.

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


  Commit: 90c9b1671e79a978b918ed4f93f9aa0d2d2bb72f
      
https://github.com/qemu/qemu/commit/90c9b1671e79a978b918ed4f93f9aa0d2d2bb72f
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M tests/qemu-iotests/030
    M tests/qemu-iotests/040
    M tests/qemu-iotests/055

  Log Message:
  -----------
  qemu-iotests: Add qemu-io format option in Python tests

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


  Commit: b8e665e4d8c6aece216e373da062ee60c82e0b6f
      
https://github.com/qemu/qemu/commit/b8e665e4d8c6aece216e373da062ee60c82e0b6f
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M tests/ahci-test.c
    M tests/bios-tables-test.c
    M tests/drive_del-test.c
    M tests/fdc-test.c
    M tests/hd-geo-test.c
    M tests/i440fx-test.c
    M tests/ide-test.c
    M tests/nvme-test.c
    M tests/usb-hcd-uhci-test.c
    M tests/usb-hcd-xhci-test.c
    M tests/virtio-blk-test.c
    M tests/virtio-scsi-test.c

  Log Message:
  -----------
  qtests: Specify image format explicitly

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


  Commit: c6684249fd35f7e692bcf3039d2fc4b13dd32308
      
https://github.com/qemu/qemu/commit/c6684249fd35f7e692bcf3039d2fc4b13dd32308
  Author: Markus Armbruster <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Factor bdrv_probe_all() out of find_image_format()

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


  Commit: 7cddd3728e964164e99c59e5c9443508d9ee0161
      
https://github.com/qemu/qemu/commit/7cddd3728e964164e99c59e5c9443508d9ee0161
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  block: Read only one sector for format probing

The only image format driver that even potentially accesses anything
after 512 bytes in its bdrv_probe() implementation is VMDK, which reads
a plain-text descriptor file. In practice, the field it's looking for
seems to come first and will be well within the first 512 bytes, too.

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


  Commit: 38f3ef574b48afc507c6f636ae4393fd36bda072
      
https://github.com/qemu/qemu/commit/38f3ef574b48afc507c6f636ae4393fd36bda072
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  raw: Prohibit dangerous writes for probed images

If the user neglects to specify the image format, QEMU probes the
image to guess it automatically, for convenience.

Relying on format probing is insecure for raw images (CVE-2008-2004).
If the guest writes a suitable header to the device, the next probe
will recognize a format chosen by the guest.  A malicious guest can
abuse this to gain access to host files, e.g. by crafting a QCOW2
header with backing file /etc/shadow.

Commit 1e72d3b (April 2008) provided -drive parameter format to let
users disable probing.  Commit f965509 (March 2009) extended QCOW2 to
optionally store the backing file format, to let users disable backing
file probing.  QED has had a flag to suppress probing since the
beginning (2010), set whenever a raw backing file is assigned.

All of these additions that allow to avoid format probing have to be
specified explicitly. The default still allows the attack.

In order to fix this, commit 79368c8 (July 2010) put probed raw images
in a restricted mode, in which they wouldn't be able to overwrite the
first few bytes of the image so that they would identify as a different
image. If a write to the first sector would write one of the signatures
of another driver, qemu would instead zero out the first four bytes.
This patch was later reverted in commit 8b33d9e (September 2010) because
it didn't get the handling of unaligned qiov members right.

Today's block layer that is based on coroutines and has qiov utility
functions makes it much easier to get this functionality right, so this
patch implements it.

The other differences of this patch to the old one are that it doesn't
silently write something different than the guest requested by zeroing
out some bytes (it fails the request instead) and that it doesn't
maintain a list of signatures in the raw driver (it calls the usual
probe function instead).

Note that this change doesn't introduce new breakage for false positive
cases where the guest legitimately writes data into the first sector
that matches the signatures of an image format (e.g. for nested virt):
These cases were broken before, only the failure mode changes from
corruption after the next restart (when the wrong format is probed) to
failing the problematic write request.

Also note that like in the original patch, the restrictions only apply
if the image format has been guessed by probing. Explicitly specifying a
format allows guests to write anything they like.

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


  Commit: d71a8b0686b87e54587a2219ab0e502f0a889839
      
https://github.com/qemu/qemu/commit/d71a8b0686b87e54587a2219ab0e502f0a889839
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  qemu-iotests: Fix stderr handling in common.qemu

The original intention was to pipe stderr of qemu into $fifo_out.
However, the redirections were specified in the wrong order for this.
This patch fixes it.

Now qemu's output on stderr can be retrieved with _send_qemu_cmd, which
applies several useful filters on the output that were missing before.

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


  Commit: 00e047926e0e90cf25e39d6a5b3b1e4f3701d69c
      
https://github.com/qemu/qemu/commit/00e047926e0e90cf25e39d6a5b3b1e4f3701d69c
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    A tests/qemu-iotests/109
    A tests/qemu-iotests/109.out
    M tests/qemu-iotests/group
    A tests/qemu-iotests/sample_images/grub_mbr.raw.bz2

  Log Message:
  -----------
  qemu-iotests: Test writing non-raw image headers to raw image

This is forbidden if the raw driver was probed.

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


  Commit: b756b9ce8a81cd0d95ae691cee541a149463c8c9
      
https://github.com/qemu/qemu/commit/b756b9ce8a81cd0d95ae691cee541a149463c8c9
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: update outdated qmp_transaction() comments

Originally the transaction QMP command was just for taking snapshots.
The command became more general when drive-backup and abort were added.

It is more accurate to say the command is about performing operations on
an atomic group than to say it is about snapshots.

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


  Commit: 73f1f7564d58963fc692334bcf0c529e1e3536fb
      
https://github.com/qemu/qemu/commit/73f1f7564d58963fc692334bcf0c529e1e3536fb
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: drop unnecessary DriveBackupState field assignment

drive_backup_prepare() assigns DriveBackupState fields to NULL in the
error path.  This is unnecessary because the DriveBackupState is
allocated using g_malloc0() and other functions like
external_snapshot_prepare() already rely on this.

Do not explicitly assign fields to NULL so that the error path is
concise and does not require modification when fields are added to
DriveBackupState.

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


  Commit: 5d6e96efb81f94f39a50110e8178584fb1817f66
      
https://github.com/qemu/qemu/commit/5d6e96efb81f94f39a50110e8178584fb1817f66
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev.c
    M hw/block/dataplane/virtio-blk.c

  Log Message:
  -----------
  blockdev: acquire AioContext in QMP 'transaction' actions

The transaction QMP command performs operations atomically on a group of
drives.  This command needs to acquire AioContext in order to work
safely when virtio-blk dataplane IOThreads are accessing drives.

The transactional nature of the command means that actions are split
into prepare, commit, abort, and clean functions.  Acquire the
AioContext in prepare and don't release it until one of the other
functions is called.  This prevents the IOThread from running the
AioContext before the transaction has completed.

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


  Commit: 3dc7ca3c97dff8732e38828b38e0497efba0fedf
      
https://github.com/qemu/qemu/commit/3dc7ca3c97dff8732e38828b38e0497efba0fedf
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: check for BLOCK_OP_TYPE_INTERNAL_SNAPSHOT

The BLOCK_OP_TYPE_INTERNAL_SNAPSHOT op blocker exists but was never
used!  Let's fix that so internal snapshots can be blocked.

[Fixed s/external/internal/ typo as pointed out by Paolo Bonzini and Max
Reitz.
--Stefan]

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


  Commit: 2ebafc854d109ff09b66fb4dd62c2c53fc29754a
      
https://github.com/qemu/qemu/commit/2ebafc854d109ff09b66fb4dd62c2c53fc29754a
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  qcow2: Fix header extension size check

After reading the extension header, offset is incremented, but not
checked against end_offset any more. This way an integer overflow could
happen when checking whether the extension end is within the allowed
range, effectively disabling the check.

This patch adds the missing check and a test case for it.

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


  Commit: 8884dd1bbc5ce42cd657ffcbef3a477443468974
      
https://github.com/qemu/qemu/commit/8884dd1bbc5ce42cd657ffcbef3a477443468974
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  qcow2.py: Add required padding for header extensions

The qcow2 specification requires that the header extension data be
padded to round up the extension size to the next multiple of 8 bytes.

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


  Commit: c5f6e493bb5339d244eae5d3f21c5b6d73996739
      
https://github.com/qemu/qemu/commit/c5f6e493bb5339d244eae5d3f21c5b6d73996739
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block.c
    A tests/qemu-iotests/114
    A tests/qemu-iotests/114.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  block: Don't probe for unknown backing file format

If a qcow2 image specifies a backing file format that doesn't correspond
to any format driver that qemu knows, we shouldn't fall back to probing,
but simply error out.

Not looking up the backing file driver in bdrv_open_backing_file(), but
just filling in the "driver" option if it isn't there moves us closer to
the goal of having everything in QDict options and gets us the error
handling of bdrv_open(), which correctly refuses unknown drivers.

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


  Commit: a56ebc6ba4be1b6060d87b115c48ff57236c8def
      
https://github.com/qemu/qemu/commit/a56ebc6ba4be1b6060d87b115c48ff57236c8def
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/accounting.c
    M block/raw-posix.c

  Log Message:
  -----------
  block: do not use get_clock()

Use the external qemu-timer API instead.

No one else should be calling cpu_get_clock(), get_clock() and
get_clock_realtime() directly; they are internal functions and they
should be confined to qemu-timer.c and cpus.c (where the icount
implementation resides).  All accesses should go through
qemu_clock_get_ns.

Cc: address@hidden
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: e800e5d4e25192a6783c1a17e4df8261d9357e01
      
https://github.com/qemu/qemu/commit/e800e5d4e25192a6783c1a17e4df8261d9357e01
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  qemu-iotests: 060: Filter the real disk size

The real on-disk size of an image depends on things like the host
filesystem. _img_info already filters it out, use the function in 060.

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


  Commit: d11032315ac652d9283ffada7f9b679f368ee175
      
https://github.com/qemu/qemu/commit/d11032315ac652d9283ffada7f9b679f368ee175
  Author: Michael Mueller <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  qemu-iotests: 082: Filter the real disk size

The real on-disk size of an image depends on things like the host
filesystem. _img_info already filters it out, use the function in 082.

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


  Commit: be0677a93cd4578122955db3c377c3de7e81fcd0
      
https://github.com/qemu/qemu/commit/be0677a93cd4578122955db3c377c3de7e81fcd0
  Author: Anton Blanchard <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M hw/block/nvme.c
    M hw/block/nvme.h

  Log Message:
  -----------
  nvme: 64kB page size fixes

Initialise our maximum page size capability to 64kB and increase
the page_size variable from 16 to 32 bits.

Signed-off-by: Anton Blanchard <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: d20051856cd2fa8f10fed2d2a0b2751de5f7b20d
      
https://github.com/qemu/qemu/commit/d20051856cd2fa8f10fed2d2a0b2751de5f7b20d
  Author: Kevin Wolf <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M hw/ide/qdev.c

  Log Message:
  -----------
  ide: Check validity of logical block size

Our IDE emulation can't handle logical block sizes other than 512. Check
for it.

The original assumption was that other values would silently be ignored
(which is bad enough), but it's not quite true: The physical block size
is exposed in IDENTIFY DEVICE as a multiple of the logical block size.
Setting a logical block size therefore also corrupts the physical block
size (4096/4096 doesn't silently downgrade to 4096/512, but 512/512).

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: John Snow <address@hidden>


  Commit: b89689f5b2d2686ef83d2be0c854a5ef6e961e13
      
https://github.com/qemu/qemu/commit/b89689f5b2d2686ef83d2be0c854a5ef6e961e13
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M tests/qemu-iotests/059

  Log Message:
  -----------
  iotests: Specify qcow2 format for qemu-io in 059

There are two instances of iotest 059 using qemu-io on a qcow2 image. As
of "qemu-iotests: Use qemu-io -f $IMGFMT" the iotests can no longer rely
on $QEMU_IO doing probing, therefore the qcow2 format has to be
specified explicitly here.

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


  Commit: 5f535a941e52229d81e55603eb69b2bd449b937a
      
https://github.com/qemu/qemu/commit/5f535a941e52229d81e55603eb69b2bd449b937a
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/qcow2.c
    M block/raw-posix.c
    M block/raw-win32.c
    M block/raw_bsd.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Make essential BlockDriver objects public

There are some block drivers which are essential to QEMU and may not be
removed: These are raw, file and qcow2 (as the default non-raw format).
Make their BlockDriver objects public so they can be directly referenced
throughout the block layer without needing to call bdrv_find_format()
and having to deal with an error at runtime, while the real problem
occurred during linking (where raw, file or qcow2 were not linked into
qemu).

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


  Commit: ef8104378c4a0497be079e48ee5ac5a89c68f978
      
https://github.com/qemu/qemu/commit/ef8104378c4a0497be079e48ee5ac5a89c68f978
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block.c
    M block/qcow2.c

  Log Message:
  -----------
  block: Omit bdrv_find_format for essential drivers

We can always assume raw, file and qcow2 being available; so do not use
bdrv_find_format() to locate their BlockDriver objects but statically
reference the respective objects.

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


  Commit: 1bcb15cf776a57e8963072c1919a59a90aea8e94
      
https://github.com/qemu/qemu/commit/1bcb15cf776a57e8963072c1919a59a90aea8e94
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vvfat.c

  Log Message:
  -----------
  block/vvfat: qcow driver may not be found

Although virtually impossible right now, bdrv_find_format("qcow") may
fail. The vvfat block driver should heed that case.

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


  Commit: fd752801ae1cc729359a37f29e32265de6948d37
      
https://github.com/qemu/qemu/commit/fd752801ae1cc729359a37f29e32265de6948d37
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/nfs.c

  Log Message:
  -----------
  block/nfs: Add create_opts

The nfs protocol driver is capable of creating images, but did not
specify any creation options. Fix it.

A way to test this issue is the following:

$ qemu-img create -f nfs nfs://127.0.0.1/foo.qcow2 64M

Without this patch, it segfaults. With this patch, it does not. However,
this is not something that should really work; qemu-img should check
whether the parameter for the -f option (and -O for convert) is indeed a
format, and error out if it is not. Therefore, I am not making it an
iotest.

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


  Commit: c6149724080af7b3d5d61eac8942655e6d212783
      
https://github.com/qemu/qemu/commit/c6149724080af7b3d5d61eac8942655e6d212783
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Check create_opts before image creation

If a driver supports image creation, it needs to set the .create_opts
field. We can use that to make sure .create_opts for both drivers
involved is not NULL in bdrv_img_create(), which is important so that
the create_opts pointer in that function is not NULL after the
qemu_opts_append() calls and when going into qemu_opts_create().

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


  Commit: f75613cf2488a37fb8019bc32a06ddbcd477d0ce
      
https://github.com/qemu/qemu/commit/f75613cf2488a37fb8019bc32a06ddbcd477d0ce
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Check create_opts before image creation

If a driver supports image creation, it needs to set the .create_opts
field. We can use that to make sure .create_opts for both drivers
involved is not NULL for the target image in qemu-img convert, which is
important so that the create_opts pointer in img_convert() is not NULL
after the qemu_opts_append() calls and when going into
qemu_opts_create().

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


  Commit: b2439d26f078c826e5e06b34d978a6f6d5c7c56f
      
https://github.com/qemu/qemu/commit/b2439d26f078c826e5e06b34d978a6f6d5c7c56f
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Check create_opts before image amendment

The image options which can be amended are described by the .create_opts
field for every driver. This field must therefore be non-NULL so that
anything can be amended in the first place. Check that this holds true
before going into qemu_opts_create() (because if .create_opts is NULL,
the create_opts pointer in img_amend() will be NULL after
qemu_opts_append()).

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


  Commit: f798068c565918ead63218d083ff814b7635be72
      
https://github.com/qemu/qemu/commit/f798068c565918ead63218d083ff814b7635be72
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  iotests: Only kill NBD server if it runs

There may be NBD tests which do not create a sample image and simply
test whether wrong usage of the protocol is rejected as expected. In
this case, there will be no NBD server and trying to kill it during
clean-up will fail.

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


  Commit: 2247798d13e5295a097da0a42f9d0d70d88690a4
      
https://github.com/qemu/qemu/commit/2247798d13e5295a097da0a42f9d0d70d88690a4
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

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

  Log Message:
  -----------
  iotests: Add test for unsupported image creation

Add a test for creating and amending images (amendment uses the creation
options) with formats not supporting creation over protocols not
supporting creation.

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


  Commit: 11c89769dc3e638ef72915d97058411ddf79b64b
      
https://github.com/qemu/qemu/commit/11c89769dc3e638ef72915d97058411ddf79b64b
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Prevent numerical overflow

In qcow2_alloc_cluster_offset(), *num is limited to
INT_MAX >> BDRV_SECTOR_BITS by all callers. However, since remaining is
of type uint64_t, we might as well cast *num to that type before
performing the shift.

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


  Commit: 3b5e14c76a6bb142bf250ddf99e24a0ac8c7bc12
      
https://github.com/qemu/qemu/commit/3b5e14c76a6bb142bf250ddf99e24a0ac8c7bc12
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/qcow2.c
    M tests/qemu-iotests/026.out
    M tests/qemu-iotests/071.out
    M tests/qemu-iotests/089.out

  Log Message:
  -----------
  qcow2: Flushing the caches in qcow2_close may fail

qcow2_cache_flush() may fail; if one of the caches failed to be flushed
successfully to disk in qcow2_close() the image should not be marked
clean, and we should emit a warning.

This breaks the (qcow2-specific) iotests 026, 071 and 089; change their
output accordingly.

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


  Commit: 6a69b9620ac1562a067990d87284a85552bfd61b
      
https://github.com/qemu/qemu/commit/6a69b9620ac1562a067990d87284a85552bfd61b
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: Respect bdrv_truncate() error

bdrv_truncate() may fail and qcow2_write_compressed() should return the
error code in that case.

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


  Commit: 01212d4ed68fc8daa29062a9a38650cf8febe392
      
https://github.com/qemu/qemu/commit/01212d4ed68fc8daa29062a9a38650cf8febe392
  Author: Max Reitz <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  block/raw-posix: Fix ret in raw_open_common()

The return value must be negative on error; there is one place in
raw_open_common() where errp is set, but ret remains 0. Fix it.

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


  Commit: 0fc9b0d16265033403334a5fa7863dde6129a3cd
      
https://github.com/qemu/qemu/commit/0fc9b0d16265033403334a5fa7863dde6129a3cd
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M tests/qemu-iotests/099

  Log Message:
  -----------
  qemu-iotests: Skip 099 for VMDK subformats with desc file

VMDK extent parsing code doesn't handle the JSON file name, so the case
fails for these subformats. Disabled them.

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


  Commit: 0d0d7f47b4c0fa4908e1747a94f96d4d9668f4aa
      
https://github.com/qemu/qemu/commit/0d0d7f47b4c0fa4908e1747a94f96d4d9668f4aa
  Author: Jeff Cody <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vdi.c

  Log Message:
  -----------
  block: remove BLOCK_OPT_NOCOW from vdi_create_opts

In commit 7074786, the need for NOCOW was removed from the vdi driver,
as we removed the the posix calls.  However, the BLOCK_OPT_NOCOW was not
removed from vdi_create_opts.  This was a mistake - remove the opt from
there as well.

Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Weil <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 625fa9fe6fbf9d45607d2c0144e1a44712d0cefc
      
https://github.com/qemu/qemu/commit/625fa9fe6fbf9d45607d2c0144e1a44712d0cefc
  Author: Jeff Cody <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vpc.c

  Log Message:
  -----------
  block: remove BLOCK_OPT_NOCOW from vpc_create_opts

In commit fef6070, the need for NOCOW was removed from the vpc driver,
as we removed the the posix calls.  However, the BLOCK_OPT_NOCOW was not
removed from vpc_create_opts.  This was a mistake - remove the opt from
there as well.

Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Stefan Weil <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 3ba235a02284c39b34a68a2a588508ffb52a7b55
      
https://github.com/qemu/qemu/commit/3ba235a02284c39b34a68a2a588508ffb52a7b55
  Author: Markus Armbruster <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M aio-posix.c
    M aio-win32.c
    M async.c

  Log Message:
  -----------
  block: Use g_new0() for a bit of extra type checking

g_new(T, 1) is safer than g_malloc(sizeof(T)), because it returns T *
rather than void *, which lets the compiler catch more type errors.

Missed in commit 02c4f26.

Signed-off-by: Markus Armbruster <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: e5dc64b8ff09cc4c186273e4461c7479739db2ae
      
https://github.com/qemu/qemu/commit/e5dc64b8ff09cc4c186273e4461c7479739db2ae
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Use g_random_int to generate CID

This replaces two "time(NULL)" invocations with "g_random_int()".
According to VMDK spec, CID "is a random 32‐bit value updated the first
time the content of the virtual disk is modified after the virtual disk
is opened". Using "seconds since epoch" is just a "lame way" to generate
it, and not completely safe because of the low precision.

Suggested-by: Markus Armbruster <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Don Koch <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 8a3e0bc370de9274170b82f48b0393204c3fb43b
      
https://github.com/qemu/qemu/commit/8a3e0bc370de9274170b82f48b0393204c3fb43b
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Fix comment to match code of extent lines

commit 04d542c8b (vmdk: support vmfs files) added support of VMFS extent
type but the comment above the changed code is left out. Update the
comment so they are consistent.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Don Koch <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 73b7bcad439e0edaced05049897090cc10d84b5b
      
https://github.com/qemu/qemu/commit/73b7bcad439e0edaced05049897090cc10d84b5b
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Clean up descriptor file reading

Zeroing a buffer that will be filled right after is not necessary, and
allocating a power of two + 1 is naughty.

Suggested-by: Markus Armbruster <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Don Koch <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 03c3359dfc490eaf922f88955d6a8cc51a37ce92
      
https://github.com/qemu/qemu/commit/03c3359dfc490eaf922f88955d6a8cc51a37ce92
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Check descriptor file length when reading it

Since a too small file cannot be a valid VMDK image, and also since the
buffer's first 4 bytes will be unconditionally examined by
vmdk_open_sparse, let's error out the small file case to be clear.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Don Koch <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 9aeecbbc62ce52a94b2621a0d53567b5d4ed915d
      
https://github.com/qemu/qemu/commit/9aeecbbc62ce52a94b2621a0d53567b5d4ed915d
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Remove unnecessary initialization

It will be assigned to the return value of vmdk_read_desc.

Suggested-by: Markus Armbruster <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Don Koch <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: d899d2e248b900c53dd9081bde9f110e05747433
      
https://github.com/qemu/qemu/commit/d899d2e248b900c53dd9081bde9f110e05747433
  Author: Fam Zheng <address@hidden>
  Date:   2014-12-10 (Wed, 10 Dec 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Set errp on failures in vmdk_open_vmdk4

Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Don Koch <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 7c3843332db39c2f27405b882a505144d62b3664
      
https://github.com/qemu/qemu/commit/7c3843332db39c2f27405b882a505144d62b3664
  Author: Peter Maydell <address@hidden>
  Date:   2014-12-11 (Thu, 11 Dec 2014)

  Changed paths:
    M aio-posix.c
    M aio-win32.c
    M async.c
    M block.c
    M block/accounting.c
    M block/blkdebug.c
    M block/block-backend.c
    M block/nfs.c
    M block/qapi.c
    M block/qcow2-cluster.c
    M block/qcow2.c
    M block/raw-posix.c
    M block/raw-win32.c
    M block/raw_bsd.c
    M block/vdi.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M blockdev-nbd.c
    M blockdev.c
    M hmp.c
    M hw/block/dataplane/virtio-blk.c
    M hw/block/nvme.c
    M hw/block/nvme.h
    M hw/ide/ahci.c
    M hw/ide/ahci.h
    M hw/ide/qdev.c
    M include/block/block.h
    M include/block/block_int.h
    M include/block/nbd.h
    M include/sysemu/block-backend.h
    M monitor.c
    M nbd.c
    M qapi/block-core.json
    M qemu-img.c
    M qemu-io.c
    M qemu-nbd.c
    M qemu-options.hx
    M qmp-commands.hx
    M qobject/qjson.c
    M tests/ahci-test.c
    M tests/bios-tables-test.c
    M tests/drive_del-test.c
    M tests/fdc-test.c
    M tests/hd-geo-test.c
    M tests/i440fx-test.c
    M tests/ide-test.c
    M tests/nvme-test.c
    M tests/qemu-iotests/016
    M tests/qemu-iotests/026.out
    M tests/qemu-iotests/030
    M tests/qemu-iotests/040
    M tests/qemu-iotests/048
    M tests/qemu-iotests/051.out
    M tests/qemu-iotests/055
    M tests/qemu-iotests/058
    M tests/qemu-iotests/059
    M tests/qemu-iotests/060
    M tests/qemu-iotests/060.out
    M tests/qemu-iotests/067
    M tests/qemu-iotests/067.out
    M tests/qemu-iotests/071
    M tests/qemu-iotests/071.out
    M tests/qemu-iotests/077
    M tests/qemu-iotests/080
    M tests/qemu-iotests/080.out
    M tests/qemu-iotests/081
    M tests/qemu-iotests/081.out
    M tests/qemu-iotests/082
    M tests/qemu-iotests/082.out
    M tests/qemu-iotests/089
    M tests/qemu-iotests/089.out
    M tests/qemu-iotests/099
    M tests/qemu-iotests/099.out
    A tests/qemu-iotests/109
    A tests/qemu-iotests/109.out
    A tests/qemu-iotests/113
    A tests/qemu-iotests/113.out
    A tests/qemu-iotests/114
    A tests/qemu-iotests/114.out
    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/qemu-iotests/qcow2.py
    A tests/qemu-iotests/sample_images/grub_mbr.raw.bz2
    M tests/usb-hcd-uhci-test.c
    M tests/usb-hcd-xhci-test.c
    M tests/virtio-blk-test.c
    M tests/virtio-scsi-test.c
    M vl.c

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

Block patches for 2.3

# gpg: Signature made Wed 10 Dec 2014 09:31:53 GMT using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"

* remotes/kevin/tags/for-upstream: (73 commits)
  vmdk: Set errp on failures in vmdk_open_vmdk4
  vmdk: Remove unnecessary initialization
  vmdk: Check descriptor file length when reading it
  vmdk: Clean up descriptor file reading
  vmdk: Fix comment to match code of extent lines
  vmdk: Use g_random_int to generate CID
  block: Use g_new0() for a bit of extra type checking
  block: remove BLOCK_OPT_NOCOW from vpc_create_opts
  block: remove BLOCK_OPT_NOCOW from vdi_create_opts
  qemu-iotests: Skip 099 for VMDK subformats with desc file
  block/raw-posix: Fix ret in raw_open_common()
  qcow2: Respect bdrv_truncate() error
  qcow2: Flushing the caches in qcow2_close may fail
  qcow2: Prevent numerical overflow
  iotests: Add test for unsupported image creation
  iotests: Only kill NBD server if it runs
  qemu-img: Check create_opts before image amendment
  qemu-img: Check create_opts before image creation
  block: Check create_opts before image creation
  block/nfs: Add create_opts
  ...

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


Compare: https://github.com/qemu/qemu/compare/a09f2d16f6b9...7c3843332db3

reply via email to

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