qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] ac3a87: util: introduce MIN_NON_ZERO


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] ac3a87: util: introduce MIN_NON_ZERO
Date: Mon, 03 Nov 2014 12:30:06 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ac3a8726644d4783eacf54212d23db01d1d30044
      
https://github.com/qemu/qemu/commit/ac3a8726644d4783eacf54212d23db01d1d30044
  Author: Peter Lieven <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M include/qemu/osdep.h

  Log Message:
  -----------
  util: introduce MIN_NON_ZERO

at least in block layer we have the case of limits being defined for a
BlockDriverState. However, in this context often zero (0) has the special
meanining of undefined which means no limit. If two of those limits are
combined and the minimum is needed the minimum function should only return
zero if both parameters are zero.

Signed-off-by: Peter Lieven <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 2647fab57d5d5e38b36f8dbda367d688045e6a2d
      
https://github.com/qemu/qemu/commit/2647fab57d5d5e38b36f8dbda367d688045e6a2d
  Author: Peter Lieven <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  BlockLimits: introduce max_transfer_length

Signed-off-by: Peter Lieven <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 52f6fa1430209125d1c13fec7d6bbb501aedf322
      
https://github.com/qemu/qemu/commit/52f6fa1430209125d1c13fec7d6bbb501aedf322
  Author: Peter Lieven <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: set max_transfer_length

Copy the max_xfer_len from the BlockLimits VPD or use the
maximum value fitting in the CDB.

The helper function sector_limits_lun2qemu is introduced to convert
and cap the limits from the VPD to the maximum power of two fitting
in an integer; integer is the range for nb_sectors throughout
the block layer.

Signed-off-by: Peter Lieven <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6c5a42ac344306bb3711140a3267c61276c1567b
      
https://github.com/qemu/qemu/commit/6c5a42ac344306bb3711140a3267c61276c1567b
  Author: Peter Lieven <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: avoid creating oversized writes in multiwrite_merge

Signed-off-by: Peter Lieven <address@hidden>
Reviewed-by: Ronnie Sahlberg <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3dab155154b97eadd44342f9c94d1508337a0667
      
https://github.com/qemu/qemu/commit/3dab155154b97eadd44342f9c94d1508337a0667
  Author: Peter Lieven <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: use sector_limits_lun2qemu throughout iscsi_refresh_limits

As Max pointed out there is a hidden cast from int64_t to int for all
limits. So use the newly introduced sector_limits_lun2qemu for all
limits received from the target.

Signed-off-by: Peter Lieven <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: dc9e716369282ed687821d52cb3170369626f99f
      
https://github.com/qemu/qemu/commit/dc9e716369282ed687821d52cb3170369626f99f
  Author: Peter Lieven <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: check for oversized requests

Cancel oversized requests early. They would generate
an iSCSI protocol error anyway; after having transferred
possibly a lot of data over the wire.

Suggested-By: Max Reitz <address@hidden>
Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 7b8bad1b6abde7612940900dd1092dad873f1a11
      
https://github.com/qemu/qemu/commit/7b8bad1b6abde7612940900dd1092dad873f1a11
  Author: John Snow <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M hw/ide/ahci.c

  Log Message:
  -----------
  ahci: Correct PIO/D2H FIS responses

Currently, the D2H FIS packets AHCI generates simply parrot back
the LBA that the guest sent to us in the cmd_fis. However, some
commands (like READ NATIVE MAX) modify the LBA registers as a
return value, through which the AHCI D2H FIS is the only response
mechanism. Thus, the D2H response should use the current register
values, not the initial ones.

This patch adjusts the LBA and drive select register responses for
PIO Setup and D2H FIS response packets.

Additionally, the PIO and D2H FIS responses copy too many bytes
from the command FIS that it is being generated from. Specifically,
byte 11 which is the Features(15:8) field for Register Host to
Device FIS packets, is instead reserved for the PIO Setup FIS and
should always be 0.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Tested-by: Michael S. Tsirkin <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 659142ecf71a0da240ab0ff7cf929ee25c32b9bc
      
https://github.com/qemu/qemu/commit/659142ecf71a0da240ab0ff7cf929ee25c32b9bc
  Author: John Snow <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  ahci: Update byte count after DMA completion

Currently, DMA read/write operations neglect to update
the byte count after a successful transfer like ATAPI
DMA read or PIO read/write operations do.

We correct this oversight by adding another callback into
the IDEDMAOps structure. The commit callback is called
whenever we are cleaning up a scatter-gather list.
AHCI can register this callback in order to update post-
transfer information such as byte count updates.

We use this callback in AHCI to consolidate where we delete
the SGlist as generated from the PRDT, as well as update the
byte count after the transfer is complete.

The QEMUSGList structure has an init flag added to it in order
to make qemu_sglist_destroy a nop if it is called when
there is no sglist, which simplifies cleanup and error paths.

This patch fixes several AHCI problems, notably Non-NCQ modes
of operation for Windows 7 as well as Hibernate support for Windows 7.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Tested-by: Michael S. Tsirkin <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 54a7f8f38ddf4711ee8bf773b5066337b045a343
      
https://github.com/qemu/qemu/commit/54a7f8f38ddf4711ee8bf773b5066337b045a343
  Author: John Snow <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  ahci: Fix SDB FIS Construction

The SDB FIS creation was mangled;
We were writing the error byte to byte 0,
and omitting the SDB FIS magic byte.

Though the SDB packet layout states that:
byte 0: Must be 0xA1 to indicate SDB FIS.
byte 1: Port multiplier select & other flags
byte 2: status byte.
byte 3: error byte.

This patch adds an SDB FIS structure with
human-readable names, and ensures that we
are filling the structure appropriately.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Tested-by: Michael S. Tsirkin <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ba2b22888c43fdf36f3ae0553c89013616e9c44a
      
https://github.com/qemu/qemu/commit/ba2b22888c43fdf36f3ae0553c89013616e9c44a
  Author: Chris Spiegel <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M savevm.c

  Log Message:
  -----------
  snapshot: Reset err to NULL to avoid double free

If an error occurs in bdrv_snapshot_delete_by_id_or_name(), "err" is
freed.  If "err" is not set to NULL before calling
bdrv_snapshot_delete_by_id_or_name() again, it will not be updated on
error, and will be freed again.

This can be triggered by starting a VM with at least two drives and then
attempting to delete a non-existent snapshot.

Broken in commit a89d89d.

Signed-off-by: Chris Spiegel <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 285030b0de5575289084a50f4534af5b0a48b834
      
https://github.com/qemu/qemu/commit/285030b0de5575289084a50f4534af5b0a48b834
  Author: Denis V. Lunev <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M tests/qemu-iotests/076
    M tests/qemu-iotests/076.out
    R tests/qemu-iotests/sample_images/fake.parallels.bz2
    A tests/qemu-iotests/sample_images/parallels-v1.bz2

  Log Message:
  -----------
  iotests: replace fake parallels image with authentic one

The image was generated using http://openvz.org/Ploop utility and properly
filled with the same content as original one.

Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
CC: Jeff Cody <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 76823c6e79583c926d127c33926aaf39475e5cda
      
https://github.com/qemu/qemu/commit/76823c6e79583c926d127c33926aaf39475e5cda
  Author: Denis V. Lunev <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M tests/qemu-iotests/076
    M tests/qemu-iotests/076.out
    A tests/qemu-iotests/sample_images/parallels-v2.bz2

  Log Message:
  -----------
  iotests: add v2 parallels sample image and simple test for it

This is simple test image for the following commit made by me.

    commit d25d59802021a747812472780d80a0e792078f40
    Author: Denis V. Lunev <address@hidden>
    Date:   Mon Jul 28 20:23:55 2014 +0400
    parallels: 2TB+ parallels images support

Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
CC: Jeff Cody <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: da725d0b0e843ab496e0be6b9ead3cdd55cc0e3d
      
https://github.com/qemu/qemu/commit/da725d0b0e843ab496e0be6b9ead3cdd55cc0e3d
  Author: Denis V. Lunev <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/parallels.c

  Log Message:
  -----------
  block/parallels: fix access to not initialized memory in catalog_bitmap

found by valgrind.

Command: ./qemu-img convert -f parallels -O qcow2 1.hds 1.img
Invalid read of size 4
   at 0x17D0EF: parallels_co_read (parallels.c:357)
   by 0x11FEE4: bdrv_aio_rw_vector (block.c:4640)
   by 0x11FFBF: bdrv_aio_readv_em (block.c:4652)
   by 0x11F55F: bdrv_co_readv_em (block.c:4862)
   by 0x123428: bdrv_aligned_preadv (block.c:3056)
   by 0x1239FA: bdrv_co_do_preadv (block.c:3162)
   by 0x125424: bdrv_rw_co_entry (block.c:2706)
   by 0x155DD9: coroutine_trampoline (coroutine-ucontext.c:118)
   by 0x6975B6F: ??? (in /lib/x86_64-linux-gnu/libc-2.19.so)

The problem is that s->catalog_bitmap is allocated/filled as
gmalloc(s->catalog_size) thus index validity check must be
inclusive, i.e. index >= s->catalog_size is invalid.

Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
CC: Jeff Cody <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: be21788495fdc8251b04dd4bfd0cdce95c49d75b
      
https://github.com/qemu/qemu/commit/be21788495fdc8251b04dd4bfd0cdce95c49d75b
  Author: Adam Crume <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/rbd.c

  Log Message:
  -----------
  rbd: Add support for bdrv_invalidate_cache

This fixes Ceph issue 2467: ttp://tracker.ceph.com/issues/2467

[Dropped return r in void function as suggested by Josh Durgin
<address@hidden>.
--Stefan]

Signed-off-by: Adam Crume <address@hidden>
Reviewed-by: Josh Durgin <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 573742a5431a99ceaba6968ae269cee247727cce
      
https://github.com/qemu/qemu/commit/573742a5431a99ceaba6968ae269cee247727cce
  Author: Peter Maydell <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block.c: Fix type of IoOperationType variable in send_qmp_error_event()

The local variable 'ac' in send_qmp_error_event() is declared with the
wrong type, which causes clang to complain when it is initialized
and again when it is used:

block.c:3655:20: warning: implicit conversion from enumeration type 'enum 
IoOperationType' to different enumeration type 'BlockErrorAction' (aka 'enum 
BlockErrorAction') [-Wenum-conversion]
    ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
       ~           ^~~~~~~~~~~~~~~~~~~~~~
block.c:3655:45: warning: implicit conversion from enumeration type 'enum 
IoOperationType' to different enumeration type 'BlockErrorAction' (aka 'enum 
BlockErrorAction') [-Wenum-conversion]
    ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
       ~                                    ^~~~~~~~~~~~~~~~~~~~~~~
block.c:3656:62: warning: implicit conversion from enumeration type 
'BlockErrorAction' (aka 'enum BlockErrorAction') to different enumeration type 
'IoOperationType' (aka 'enum IoOperationType') [-Wenum-conversion]
    qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                           ^~

Correct the type to IoOperationType, and rename the variable
to 'optype' to match its correct type.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3432a1929ee18e08787ce35476abd74f2c93a17c
      
https://github.com/qemu/qemu/commit/3432a1929ee18e08787ce35476abd74f2c93a17c
  Author: Zhang Haoyu <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/snapshot.c

  Log Message:
  -----------
  snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency 
problem

If there are still pending i/o while deleting snapshot,
because deleting snapshot is done in non-coroutine context, and
the pending i/o read/write (bdrv_co_do_rw) is done in coroutine context,
so it's possible to cause concurrency problem between above two operations.
Add bdrv_drain_all() to bdrv_snapshot_delete() to avoid this problem.

Signed-off-by: Zhang Haoyu <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f76faeda4bd59f972d09dd9d954297f17c21dd60
      
https://github.com/qemu/qemu/commit/f76faeda4bd59f972d09dd9d954297f17c21dd60
  Author: Richard W.M. Jones <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/curl.c

  Log Message:
  -----------
  block/curl: Improve type safety of s->timeout.

qemu_opt_get_number returns a uint64_t, and curl_easy_setopt expects a
long (not an int).  There is no warning about the latter type error
because curl_easy_setopt uses a varargs argument.

Store the timeout (which is a positive number of seconds) as a
uint64_t.  Check that the number given by the user is reasonable.
Zero is permissible (meaning no timeout is enforced by cURL).

Cast it to long before calling curl_easy_setopt to fix the type error.

Example error message after this change has been applied:

$ ./qemu-img create -f qcow2 /tmp/test.qcow2 \
    -b 'json: { "file.driver":"https",
          "file.url":"https://foo/bar";,
          "file.timeout":-1 }'
qemu-img: /tmp/test.qcow2: Could not open 'json: { "file.driver":"https", 
"file.url":"https://foo/bar";, "file.timeout":-1 }': timeout parameter is too 
large or negative: Invalid argument

Signed-off-by: Richard W.M. Jones <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Gonglei <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e6d7ec32dd315422a023ed3425fe36df8c274eeb
      
https://github.com/qemu/qemu/commit/e6d7ec32dd315422a023ed3425fe36df8c274eeb
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  raw-posix: Fix raw_co_get_block_status() after EOF

As its comment states, raw_co_get_block_status() should unconditionally
return 0 and set *pnum to 0 for after EOF.

An assertion after lseek(..., SEEK_HOLE) tried to catch this case by
asserting that errno != -ENXIO (which would indicate a position after
the EOF); but it should be errno != ENXIO instead. Regardless of that,
there should be no such assertion at all. If bdrv_getlength() returned
an outdated value and the image has been resized outside of qemu,
lseek() will return with errno == ENXIO. Just return that value as an
error then.

Setting *pnum to 0 and returning 0 should not be done here, as in that
case we should update the device length as well. So, from qemu's
perspective, the file has not been resized; it's just that there was an
error querying sectors beyond a certain point (the actual file size).

Additionally, nb_sectors should be clamped against the image end. This
was probably not an issue if FIEMAP or SEEK_HOLE/SEEK_DATA worked, but
the fallback did not take this case into account.

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


  Commit: d7f62751a14d1d34c7d388431a3e403ef1fe28a5
      
https://github.com/qemu/qemu/commit/d7f62751a14d1d34c7d388431a3e403ef1fe28a5
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  raw-posix: raw_co_get_block_status() return value

Instead of generating the full return value thrice in try_fiemap(),
try_seek_hole() and as a fall-back in raw_co_get_block_status() itself,
generate the value only in raw_co_get_block_status().

While at it, also remove the pnum parameter from try_fiemap() and
try_seek_hole().

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


  Commit: 70a5ff6bdd2f0d4c22e216cab921f9288cb1656e
      
https://github.com/qemu/qemu/commit/70a5ff6bdd2f0d4c22e216cab921f9288cb1656e
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  iotests: Add test for external image truncation

It should not be happening, but it is possible to truncate an image
outside of qemu while qemu is running (or any of the qemu tools using
the block layer. raw_co_get_block_status() should not break then.

While touching this test, replace the existing "truncate" invocation by
"$QEMU_IMG convert -f raw".

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


  Commit: 808c4b6f30d77295292cef8ee38c462957a6b9ca
      
https://github.com/qemu/qemu/commit/808c4b6f30d77295292cef8ee38c462957a6b9ca
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  qcow2: Allow "full" discard

Normally, discarded sectors should read back as zero. However, there are
cases in which a sector (or rather cluster) should be discarded as if
they were never written in the first place, that is, reading them should
fall through to the backing file again.

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


  Commit: 491d27e2af4f6e157c4b29d43269c5cb0d191171
      
https://github.com/qemu/qemu/commit/491d27e2af4f6e157c4b29d43269c5cb0d191171
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: Implement bdrv_make_empty()

Implement this function by making all clusters in the image file fall
through to the backing file (by using the recently extended discard).

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


  Commit: 94054183daffaa41cd77ced9301c01a01027923a
      
https://github.com/qemu/qemu/commit/94054183daffaa41cd77ced9301c01a01027923a
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  qcow2: Optimize bdrv_make_empty()

bdrv_make_empty() is currently only called if the current image
represents an external snapshot that has been committed to its base
image; it is therefore unlikely to have internal snapshots. In this
case, bdrv_make_empty() can be greatly sped up by emptying the L1 and
refcount table (while having the dirty flag set, which only works for
compat=1.1) and creating a trivial refcount structure.

If there are snapshots or for compat=0.10, fall back to the simple
implementation (discard all clusters).

[Applied s/clusters/cluster/ typo fix suggested by Eric Blake
--Stefan]

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


  Commit: 345f9e1b04ee18dcb1454dcec49781d5e06ecb60
      
https://github.com/qemu/qemu/commit/345f9e1b04ee18dcb1454dcec49781d5e06ecb60
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  blockjob: Introduce block_job_complete_sync()

Implement block_job_complete_sync() by doing the exact same thing as
block_job_cancel_sync() does, only with calling block_job_complete()
instead of block_job_cancel().

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


  Commit: ef6dbf1e46ebd1d41ab669df5bba0bbdec6bd374
      
https://github.com/qemu/qemu/commit/ef6dbf1e46ebd1d41ab669df5bba0bbdec6bd374
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  blockjob: Add "ready" field

When a block job signals readiness, this is currently reported only
through QMP. If qemu wants to use block jobs for internal tasks, there
needs to be another way to correctly detect when a block job may be
completed.

For this reason, introduce a bool "ready" which is set when the block
job may be completed.

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


  Commit: 1d3ba15accf56b08f436d8ca92f5a0abce2d54ee
      
https://github.com/qemu/qemu/commit/1d3ba15accf56b08f436d8ca92f5a0abce2d54ee
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  iotests: Omit length/offset test in 040 and 041

As of a follow-up patch to this one, the length of a mirror block job
will no longer directly depend on the size of the block device;
therefore, drop these checks from this test. Instead, just check whether
the final offset equals the block job length.

As 041 uses the wait_until_completed function from iotests.py, the same
applies there as well which in turn affects tests 030, 055 and 056. On
the other hand, a block job's length does not have to be related to the
length of the image file in the first place, so that check was
questionable anyway.

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


  Commit: b21c76529d55bf7bb02ac736b312f5f8bf033ea2
      
https://github.com/qemu/qemu/commit/b21c76529d55bf7bb02ac736b312f5f8bf033ea2
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/mirror.c

  Log Message:
  -----------
  block/mirror: Improve progress report

Instead of taking the total length of the block device as the block
job's length, use the number of dirty sectors. The progress is now the
number of sectors mirrored to the target block device. Note that this
may result in the job's length increasing during operation, which is
however in fact desirable.

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


  Commit: d4a3238af567939f4c51bb074af1ce8839e2ce2d
      
https://github.com/qemu/qemu/commit/d4a3238af567939f4c51bb074af1ce8839e2ce2d
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/Makefile.objs
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Implement commit like QMP

qemu-img should use QMP commands whenever possible in order to ensure
feature completeness of both online and offline image operations. As
qemu-img itself has no access to QMP (since this would basically require
just everything being linked into qemu-img), imitate QMP's
implementation of block-commit by using commit_active_start() and then
waiting for the block job to finish.

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


  Commit: 9a86fe489552d47b57c92782471ddfb9e7f702e2
      
https://github.com/qemu/qemu/commit/9a86fe489552d47b57c92782471ddfb9e7f702e2
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  qemu-img: Empty image after commit

After the top image has been committed, it should be emptied unless
specified otherwise.

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


  Commit: 687fa1d83013d56f7c7f9c008c956f4c26d8ba5c
      
https://github.com/qemu/qemu/commit/687fa1d83013d56f7c7f9c008c956f4c26d8ba5c
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  qemu-img: Enable progress output for commit

Implement progress output for the commit command by querying the
progress of the block job.

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


  Commit: 1b22bffd829ee3db4ddcfbd7e66c7a7921123f3e
      
https://github.com/qemu/qemu/commit/1b22bffd829ee3db4ddcfbd7e66c7a7921123f3e
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  qemu-img: Specify backing file for commit

Introduce a new parameter for qemu-img commit which may be used to
explicitly specify the backing file into which an image should be
committed if the backing chain has more than a single layer.

[Applied Eric Blake's qemu-img.texi documentation rewording
--Stefan]

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


  Commit: f67ac71edb42f764004a3d4564d2a9f3cdfe59bc
      
https://github.com/qemu/qemu/commit/f67ac71edb42f764004a3d4564d2a9f3cdfe59bc
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  iotests: Add _filter_qemu_img_map

As different image formats most probably map guest addresses to
different host addresses, add a filter to filter the host addresses out;
also, the image filename should be filtered.

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


  Commit: e6ea23126c6d4350c7eb034f42ef27460190ef21
      
https://github.com/qemu/qemu/commit/e6ea23126c6d4350c7eb034f42ef27460190ef21
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  iotests: Add test for backing-chain commits

Add a test for qemu-img commit on backing chains with more than two
images. This test also checks whether the top image is emptied (unless
this is prevented by specifying either -d or -b) and does therefore not
work for qed and vmdk which requires it to be separate from 020.

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


  Commit: 7d90030196d8e08fb13ff9c081fb6343d7bcb8c5
      
https://github.com/qemu/qemu/commit/7d90030196d8e08fb13ff9c081fb6343d7bcb8c5
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  iotests: Add test for qcow2's bdrv_make_empty

Add a test for qcow2's fast bdrv_make_empty implementation on images
without internal snapshots.

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


  Commit: 9ea92c210675b0d2b0ff3ccd2f7a360d1f6c5129
      
https://github.com/qemu/qemu/commit/9ea92c210675b0d2b0ff3ccd2f7a360d1f6c5129
  Author: Peter Lieven <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M tests/qemu-iotests/107

  Log Message:
  -----------
  block: qemu-iotest 107 supports NFS

As discussed during review a follow up for Max's fix.

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


  Commit: 77485434206bbbfbb7f6a446866f6a327b062d5e
      
https://github.com/qemu/qemu/commit/77485434206bbbfbb7f6a446866f6a327b062d5e
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  block: Add status callback to bdrv_amend_options()

Depending on the changed options and the image format,
bdrv_amend_options() may take a significant amount of time. In these
cases, a way to be informed about the operation's status is desirable.

Since the operation is rather complex and may fundamentally change the
image, implementing it as AIO or a coroutine does not seem feasible. On
the other hand, implementing it as a block job would be significantly
more difficult than a simple callback and would not add benefits other
than progress report to the amending operation, because it should not
actually be run as a block job at all.

A callback may not be very pretty, but it's very easy to implement and
perfectly fits its purpose here.

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


  Commit: 76a3a34dcefbaac3103148e9c3437749b0732cfe
      
https://github.com/qemu/qemu/commit/76a3a34dcefbaac3103148e9c3437749b0732cfe
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  qemu-img: Add progress output for amend

Now that bdrv_amend_options() supports a status callback, use it to
display a progress report.

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


  Commit: b2f27e4438bb9eb302a0976e5b988bdfd55e65dc
      
https://github.com/qemu/qemu/commit/b2f27e4438bb9eb302a0976e5b988bdfd55e65dc
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Fix insignificant memleak

As soon as options is set in img_amend(), it needs to be freed before
the function returns. This leak is rather insignificant, as qemu-img
will exit subsequently anyway, but there's no point in not fixing it.

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


  Commit: 4057a2b24a5f5dae826d438217f77332c3a6842e
      
https://github.com/qemu/qemu/commit/4057a2b24a5f5dae826d438217f77332c3a6842e
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  block/qcow2: Implement status CB for amend

The only really time-consuming operation potentially performed by
qcow2_amend_options() is zero cluster expansion when downgrading qcow2
images from compat=1.1 to compat=0.10, so report status of that
operation and that operation only through the status CB.

For this, approximate the progress as the number of L1 entries visited
during the operation.

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


  Commit: 44751917db7466739af358fdb60ae5fb84ed89df
      
https://github.com/qemu/qemu/commit/44751917db7466739af358fdb60ae5fb84ed89df
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  block/qcow2: Make get_refcount() global

Reading the refcount of a cluster is an operation which can be useful in
all of the qcow2 code, so make that function globally available.

While touching this function, amend the comment describing the "addend"
parameter: It is (no longer, if it ever was) necessary to have it set to
-1 or 1; any value is fine.

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


  Commit: ecf58777c5ff242f656dd3836475a5ded9c2eaa5
      
https://github.com/qemu/qemu/commit/ecf58777c5ff242f656dd3836475a5ded9c2eaa5
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  block/qcow2: Simplify shared L2 handling in amend

Currently, we have a bitmap for keeping track of which clusters have
been created during the zero cluster expansion process. This was
necessary because we need to properly increase the refcount for shared
L2 tables.

However, now we can simply take the L2 refcount and use it for the
cluster allocated for expansion. This will be the correct refcount and
therefore we don't have to remember that cluster having been allocated
any more.

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


  Commit: 78fa65821dd581f375bf8bce47d6e00e64a8066a
      
https://github.com/qemu/qemu/commit/78fa65821dd581f375bf8bce47d6e00e64a8066a
  Author: Max Reitz <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  iotests: Expand test 061

Add some tests for progress output to 061.

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


  Commit: 3d948cdf3760b52238038626a7ffa7d30913060b
      
https://github.com/qemu/qemu/commit/3d948cdf3760b52238038626a7ffa7d30913060b
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: acquire AioContext in generic blockjob QMP commands

block-job-set-speed, block-job-cancel, block-job-pause,
block-job-resume, and block-job-complete must acquire the
BlockDriverState AioContext so that it is safe to access bs.

At the moment bs->job is always NULL when dataplane is active because op
blockers prevent blockjobs from starting.  Once the rest of the blockjob
API has been made aware of AioContext we can drop the op blocker.

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


  Commit: 69691e72708603592b1618f1a68d2a3f07db853d
      
https://github.com/qemu/qemu/commit/69691e72708603592b1618f1a68d2a3f07db853d
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: acquire AioContext in do_qmp_query_block_jobs_one()

Make sure that query-block-jobs acquires the BlockDriverState
AioContext so that the blockjob isn't running in another thread while we
access its state.

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


  Commit: 91fddb0db6fee207ccdcca22dd996cf0154a1004
      
https://github.com/qemu/qemu/commit/91fddb0db6fee207ccdcca22dd996cf0154a1004
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: acquire AioContext in blockdev_mark_auto_del()

When an emulated storage controller is unrealized it will call
blockdev_mark_auto_del().  This will cancel any running block job (and
that eventually releases its reference to the BDS so it can be freed).

Since the block job may be executing in another AioContext we must
acquire/release to ensure thread safety.

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


  Commit: 723c5d93c51bdb3adbc238ce90195c0864aa6cd5
      
https://github.com/qemu/qemu/commit/723c5d93c51bdb3adbc238ce90195c0864aa6cd5
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: add note that block_job_cb() must be thread-safe

This function is correct but we should document the constraint that
everything must be thread-safe.

Emitting QMP events and scheduling BHs are both thread-safe so nothing
needs to be done here.

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


  Commit: dec7d421f85578b0949292336f784f55ac84812d
      
https://github.com/qemu/qemu/commit/dec7d421f85578b0949292336f784f55ac84812d
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  blockjob: add block_job_defer_to_main_loop()

Block jobs will run in the BlockDriverState's AioContext, which may not
always be the QEMU main loop.

There are some block layer APIs that are either not thread-safe or risk
lock ordering problems.  This includes bdrv_unref(), bdrv_close(), and
anything that calls bdrv_drain_all().

The block_job_defer_to_main_loop() API allows a block job to schedule a
function to run in the main loop with the BlockDriverState AioContext
held.

This function will be used to perform cleanup and backing chain
manipulations in block jobs.

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


  Commit: 5b98db0ad3ad2919c71572085d104765bad6c658
      
https://github.com/qemu/qemu/commit/5b98db0ad3ad2919c71572085d104765bad6c658
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  block: add bdrv_drain()

Now that op blockers are in use, we can ensure that no other sources are
generating I/O on a BlockDriverState.  Therefore it is possible to drain
requests for a single BDS.

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


  Commit: 761731b1805f6ef64eb615e5b82a0801db3cde78
      
https://github.com/qemu/qemu/commit/761731b1805f6ef64eb615e5b82a0801db3cde78
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/backup.c
    M blockdev.c

  Log Message:
  -----------
  block: let backup blockjob run in BDS AioContext

The backup block job must run in the BlockDriverState AioContext so that
it works with dataplane.

The basics of acquiring the AioContext are easy in blockdev.c.

The completion code in block/backup.c must call bdrv_unref() from the
main loop.  Use block_job_defer_to_main_loop() to achieve that.

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


  Commit: f3e69beb942103ccd5248273e4d95e76b64ab64c
      
https://github.com/qemu/qemu/commit/f3e69beb942103ccd5248273e4d95e76b64ab64c
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/stream.c
    M blockdev.c

  Log Message:
  -----------
  block: let stream blockjob run in BDS AioContext

The stream block job must run in the BlockDriverState AioContext so that
it works with dataplane.

The basics of acquiring the AioContext are easy in blockdev.c.

The tricky part is the completion code which drops part of the backing
file chain.  This must be done in the main loop where bdrv_unref() and
bdrv_close() are safe to call.  Use block_job_defer_to_main_loop() to
achieve that.

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


  Commit: 5a7e7a0bad17c96e03f55ed7019e2d7545e21a96
      
https://github.com/qemu/qemu/commit/5a7e7a0bad17c96e03f55ed7019e2d7545e21a96
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block.c
    M block/mirror.c
    M blockdev.c

  Log Message:
  -----------
  block: let mirror blockjob run in BDS AioContext

The mirror block job must run in the BlockDriverState AioContext so that
it works with dataplane.

Acquire the AioContext in blockdev.c so starting the block job is safe.

Note that to_replace is treated separately from other BlockDriverStates
in that it does not need to be in the same AioContext.  Explicitly
acquire/release to_replace's AioContext when accessing it.

The completion code in block/mirror.c must perform BDS graph
manipulation and bdrv_reopen() from the main loop.  Use
block_job_defer_to_main_loop() to achieve that.

The bdrv_drain_all() call is not allowed outside the main loop since it
could lead to lock ordering problems.  Use bdrv_drain(bs) instead
because we have acquired the AioContext so nothing else can sneak in
I/O.

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


  Commit: 9e85cd5ce0d3fc99d910428c9fd9d267764d341b
      
https://github.com/qemu/qemu/commit/9e85cd5ce0d3fc99d910428c9fd9d267764d341b
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block/commit.c
    M blockdev.c

  Log Message:
  -----------
  block: let commit blockjob run in BDS AioContext

The commit block job must run in the BlockDriverState AioContext so that
it works with dataplane.

Acquire the AioContext in blockdev.c so starting the block job is safe.
One detail here is that the bdrv_drain_all() must be moved inside the
aio_context_acquire() region so requests cannot sneak in between the
drain and acquire.

The completion code in block/commit.c must perform backing chain
manipulation and bdrv_reopen() from the main loop.  Use
block_job_defer_to_main_loop() to achieve that.

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


  Commit: b112a65c52aa45a23b83b1e0d56db3b7cc44597e
      
https://github.com/qemu/qemu/commit/b112a65c52aa45a23b83b1e0d56db3b7cc44597e
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

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

  Log Message:
  -----------
  block: declare blockjobs and dataplane friends!

Now that blockjobs use AioContext they are safe for use with dataplane.
Unblock them!

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


  Commit: 9a33c0c851829d876fe6c2c7a7f2f415e27f9386
      
https://github.com/qemu/qemu/commit/9a33c0c851829d876fe6c2c7a7f2f415e27f9386
  Author: Peter Maydell <address@hidden>
  Date:   2014-11-03 (Mon, 03 Nov 2014)

  Changed paths:
    M block.c
    M block/Makefile.objs
    M block/backup.c
    M block/blkdebug.c
    M block/commit.c
    M block/curl.c
    M block/iscsi.c
    M block/mirror.c
    M block/parallels.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2-snapshot.c
    M block/qcow2.c
    M block/qcow2.h
    M block/raw-posix.c
    M block/rbd.c
    M block/snapshot.c
    M block/stream.c
    M blockdev.c
    M blockjob.c
    M hw/block/dataplane/virtio-blk.c
    M hw/ide/ahci.c
    M hw/ide/ahci.h
    M hw/ide/core.c
    M hw/ide/internal.h
    M include/block/block.h
    M include/block/block_int.h
    M include/block/blockjob.h
    M include/qemu/osdep.h
    M qapi/block-core.json
    M qemu-img-cmds.hx
    M qemu-img.c
    M qemu-img.texi
    M savevm.c
    M tests/qemu-iotests/040
    M tests/qemu-iotests/041
    M tests/qemu-iotests/061
    M tests/qemu-iotests/061.out
    M tests/qemu-iotests/076
    M tests/qemu-iotests/076.out
    A tests/qemu-iotests/097
    A tests/qemu-iotests/097.out
    A tests/qemu-iotests/098
    A tests/qemu-iotests/098.out
    M tests/qemu-iotests/102
    M tests/qemu-iotests/102.out
    M tests/qemu-iotests/107
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/group
    M tests/qemu-iotests/iotests.py
    R tests/qemu-iotests/sample_images/fake.parallels.bz2
    A tests/qemu-iotests/sample_images/parallels-v1.bz2
    A tests/qemu-iotests/sample_images/parallels-v2.bz2

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into 
staging

# gpg: Signature made Mon 03 Nov 2014 11:50:53 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"

* remotes/stefanha/tags/block-pull-request: (53 commits)
  block: declare blockjobs and dataplane friends!
  block: let commit blockjob run in BDS AioContext
  block: let mirror blockjob run in BDS AioContext
  block: let stream blockjob run in BDS AioContext
  block: let backup blockjob run in BDS AioContext
  block: add bdrv_drain()
  blockjob: add block_job_defer_to_main_loop()
  blockdev: add note that block_job_cb() must be thread-safe
  blockdev: acquire AioContext in blockdev_mark_auto_del()
  blockdev: acquire AioContext in do_qmp_query_block_jobs_one()
  block: acquire AioContext in generic blockjob QMP commands
  iotests: Expand test 061
  block/qcow2: Simplify shared L2 handling in amend
  block/qcow2: Make get_refcount() global
  block/qcow2: Implement status CB for amend
  qemu-img: Fix insignificant memleak
  qemu-img: Add progress output for amend
  block: Add status callback to bdrv_amend_options()
  block: qemu-iotest 107 supports NFS
  iotests: Add test for qcow2's bdrv_make_empty
  ...

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


Compare: https://github.com/qemu/qemu/compare/eb5f222b5c12...9a33c0c85182

reply via email to

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