qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 65a9bb: block: New bdrv_nb_sectors()


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 65a9bb: block: New bdrv_nb_sectors()
Date: Fri, 15 Aug 2014 09:00:08 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 65a9bb25d6b7a4bb41edb102fa0363d81800b417
      
https://github.com/qemu/qemu/commit/65a9bb25d6b7a4bb41edb102fa0363d81800b417
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

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

  Log Message:
  -----------
  block: New bdrv_nb_sectors()

A call to retrieve the image size converts between bytes and sectors
several times:

* BlockDriver method bdrv_getlength() returns bytes.

* refresh_total_sectors() converts to sectors, rounding up, and stores
  in total_sectors.

* bdrv_getlength() converts total_sectors back to bytes (now rounded
  up to a multiple of the sector size).

* Callers wanting sectors rather bytes convert it right back.
  Example: bdrv_get_geometry().

bdrv_nb_sectors() provides a way to omit the last two conversions.
It's exactly bdrv_getlength() with the conversion to bytes omitted.
It's functionally like bdrv_get_geometry() without its odd error
handling.

Reimplement bdrv_getlength() and bdrv_get_geometry() on top of
bdrv_nb_sectors().

The next patches will convert some users of bdrv_getlength() to
bdrv_nb_sectors().

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d32f7c101b37c03f222008331db3b1d09493a4a3
      
https://github.com/qemu/qemu/commit/d32f7c101b37c03f222008331db3b1d09493a4a3
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Use bdrv_nb_sectors() in bdrv_make_zero()

Instead of bdrv_getlength().

Variable target_size is initially in bytes, then changes meaning to
sectors.  Ugh.  Replace by target_sectors.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 4049082c4b489959850743ec22d1fec125752038
      
https://github.com/qemu/qemu/commit/4049082c4b489959850743ec22d1fec125752038
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Use bdrv_nb_sectors() in bdrv_aligned_preadv()

Instead of bdrv_getlength().  Eliminate variable len.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 30a7f2fc9178080a0ce22c12767ce994f882937e
      
https://github.com/qemu/qemu/commit/30a7f2fc9178080a0ce22c12767ce994f882937e
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Use bdrv_nb_sectors() in bdrv_co_get_block_status()

Instead of bdrv_getlength().

Replace variables length, length2 by total_sectors, nb_sectors2.
Bonus: use total_sectors instead of the slightly unclean
bs->total_sectors.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 43716fa8058a9095b9c1f9be4397dbaf7c521ee0
      
https://github.com/qemu/qemu/commit/43716fa8058a9095b9c1f9be4397dbaf7c521ee0
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  block: Use bdrv_nb_sectors() in img_convert()

Instead of bdrv_getlength().  Replace variable output_length by
output_sectors.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 57322b7811a9136507742bb7ebc2215dd8c2e911
      
https://github.com/qemu/qemu/commit/57322b7811a9136507742bb7ebc2215dd8c2e911
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block-migration.c
    M block.c
    M block/qcow2.c
    M block/vmdk.c

  Log Message:
  -----------
  block: Use bdrv_nb_sectors() where sectors, not bytes are wanted

Instead of bdrv_getlength().

Aside: a few of these callers don't handle errors.  I didn't
investigate whether they should.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 75d3d21f9ed9fc66a56d4d7cf491d504541fc6ac
      
https://github.com/qemu/qemu/commit/75d3d21f9ed9fc66a56d4d7cf491d504541fc6ac
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

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

  Log Message:
  -----------
  block: Drop superfluous aligning of bdrv_getlength()'s value

It returns a multiple of the sector size.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d739f1c41094141268a33fa8fc6715fbab714fbe
      
https://github.com/qemu/qemu/commit/d739f1c41094141268a33fa8fc6715fbab714fbe
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Make img_convert() get image size just once per image

Chiefly so I don't have to do the error checking in quadruplicate in
the next commit.  Moreover, replacing the frequently updated
bs_sectors by an array assigned just once makes the code easier to
understand.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 52bf1e722d996d1accfc35e29283f172d003d9b2
      
https://github.com/qemu/qemu/commit/52bf1e722d996d1accfc35e29283f172d003d9b2
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c
    M block/qapi.c
    M qemu-img.c

  Log Message:
  -----------
  block: Avoid bdrv_get_geometry() where errors should be detected

bdrv_get_geometry() hides errors.  Use bdrv_nb_sectors() or
bdrv_getlength() instead where that's obviously inappropriate.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 8e436ec1f307a01882fd9166477667370c9dbfff
      
https://github.com/qemu/qemu/commit/8e436ec1f307a01882fd9166477667370c9dbfff
  Author: Maria Kustova <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M docs/specs/qcow2.txt

  Log Message:
  -----------
  docs: Make the recommendation for the backing file name position a requirement

The current version of the qcow2 specification recommends to save the backing
file name in the end of the first cluster. It follows that the backing file
name can be saved somewhere in the image, but the first cluster, which
contradicts the current QEMU implementation.

The patch makes the backing file name required to be placed after the header
extensions in the first image cluster.

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


  Commit: 8efc936336ea7e572b117ed7049ce0136952c003
      
https://github.com/qemu/qemu/commit/8efc936336ea7e572b117ed7049ce0136952c003
  Author: Hu Tao <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M configure

  Log Message:
  -----------
  configure: explicitly state version requirements to devel packages

Signed-off-by: Hu Tao <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 8cced121436a3298e5866dbfaec91cd475ad59cf
      
https://github.com/qemu/qemu/commit/8cced121436a3298e5866dbfaec91cd475ad59cf
  Author: Gonglei (Arei) <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M hw/block/xen_disk.c

  Log Message:
  -----------
  xen_disk:  fix possible null-ptr dereference

Signed-off-by: Gonglei <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ef558696b5c688a8a3bef4ab8f6b27937cc24c89
      
https://github.com/qemu/qemu/commit/ef558696b5c688a8a3bef4ab8f6b27937cc24c89
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    A docs/multiple-iothreads.txt

  Log Message:
  -----------
  docs/multiple-iothreads.txt: add documentation on IOThread programming

This document explains how IOThreads and the main loop are related,
especially how to write code that can run in an IOThread.  Currently
only virtio-blk-data-plane uses these techniques.  The next obvious
target is virtio-scsi; there has also been work on virtio-net.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 4115dd6527fbdf49dbd1eba24ad68e0fae1e305a
      
https://github.com/qemu/qemu/commit/4115dd6527fbdf49dbd1eba24ad68e0fae1e305a
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M qmp.c

  Log Message:
  -----------
  qmp: hide "hotplugged" device property from device-list-properties

The "hotplugged" device property was not reported before commit
f4eb32b590bf58c1c67570775eb78beb09964fad ("qmp: show QOM properties in
device-list-properties").  Fix this difference.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: ef523587da4f213ca17133a90402d0815ecf08ee
      
https://github.com/qemu/qemu/commit/ef523587da4f213ca17133a90402d0815ecf08ee
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M qdev-monitor.c

  Log Message:
  -----------
  qdev-monitor: include QOM properties in -device FOO, help output

Update -device FOO,help to include QOM properties in addition to qdev
properties.  Devices are gradually adding more QOM properties that are
not reflected as qdev properties.

It is important to report all device properties since management tools
like libvirt use this information (and device-list-properties QMP) to
detect the presence of QEMU features.

This patch reuses the device-list-properties QMP machinery to avoid code
duplication.

Reported-by: Cole Robinson <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Tested-by: Cole Robinson <address@hidden>


  Commit: a8d8a1a06c8ebf630f39bb7263bc711b8297d367
      
https://github.com/qemu/qemu/commit/a8d8a1a06c8ebf630f39bb7263bc711b8297d367
  Author: Fam Zheng <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M tests/qemu-iotests/059
    M tests/qemu-iotests/059.out
    M tests/qemu-iotests/sample_images/iotest-version3.vmdk.bz2

  Log Message:
  -----------
  qemu-iotests: Add data pattern in version3 VMDK sample image in 059

It's possible that we diverge from the specification with our
implementation.  Having a reference image in the test cases may detect
such problems when we introduce a bug that can read what it creates, but
can't handle a real VMDK.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: c6ac36e14569794b3f3e66f796dea19bc0f0b8d3
      
https://github.com/qemu/qemu/commit/c6ac36e14569794b3f3e66f796dea19bc0f0b8d3
  Author: Fam Zheng <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Optimize cluster allocation

This drops the unnecessary bdrv_truncate() from, and also improves,
cluster allocation code path.

Before, when we need a new cluster, get_cluster_offset truncates the
image to bdrv_getlength() + cluster_size, and returns the offset of
added area, i.e. the image length before truncating.

This is not efficient, so it's now rewritten as:

  - Save the extent file length when opening.

  - When allocating cluster, use the saved length as cluster offset.

  - Don't truncate image, because we'll anyway write data there: just
    write any data at the EOF position, in descending priority:

    * New user data (cluster allocation happens in a write request).

    * Filling data in the beginning and/or ending of the new cluster, if
      not covered by user data: either backing file content (COW), or
      zero for standalone images.

One major benifit of this change is, on host mounted NFS images, even
over a fast network, ftruncate is slow (see the example below). This
change significantly speeds up cluster allocation. Comparing by
converting a cirros image (296M) to VMDK on an NFS mount point, over
1Gbe LAN:

    $ time qemu-img convert cirros-0.3.1.img /mnt/a.raw -O vmdk

    Before:
  real    0m21.796s
  user    0m0.130s
  sys     0m0.483s

    After:
  real    0m2.017s
  user    0m0.047s
  sys     0m0.190s

We also get rid of unchecked bdrv_getlength() and bdrv_truncate(), and
get a little more documentation in function comments.

Tested that this passes qemu-iotests for all VMDK subformats.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 000c4dfff4d7686e2fba3066a477a1290ed60622
      
https://github.com/qemu/qemu/commit/000c4dfff4d7686e2fba3066a477a1290ed60622
  Author: Chunyan Liu <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

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

  Log Message:
  -----------
  qemu-img info: show nocow info

Add nocow info in 'qemu-img info' output to show whether the file
currently has NOCOW flag set or not.

Signed-off-by: Chunyan Liu <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: c9a12e751b9f18afbc1b1db4197d9d13893a4c89
      
https://github.com/qemu/qemu/commit/c9a12e751b9f18afbc1b1db4197d9d13893a4c89
  Author: Chrysostomos Nanakos <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M MAINTAINERS
    M block/Makefile.objs
    A block/archipelago.c
    M configure

  Log Message:
  -----------
  block: Support Archipelago as a QEMU block backend

VM Image on Archipelago volume is specified like this:

file.driver=archipelago,file.volume=<volumename>[,file.mport=<mapperd_port>[,
file.vport=<vlmcd_port>][,file.segment=<segment_name>]]

'archipelago' is the protocol.

'mport' is the port number on which mapperd is listening. This is optional
and if not specified, QEMU will make Archipelago to use the default port.

'vport' is the port number on which vlmcd is listening. This is optional
and if not specified, QEMU will make Archipelago to use the default port.

'segment' is the name of the shared memory segment Archipelago stack is using.
This is optional and if not specified, QEMU will make Archipelago to use the
default value, 'archipelago'.

Examples:

file.driver=archipelago,file.volume=my_vm_volume
file.driver=archipelago,file.volume=my_vm_volume,file.mport=123
file.driver=archipelago,file.volume=my_vm_volume,file.mport=123,
file.vport=1234
file.driver=archipelago,file.volume=my_vm_volume,file.mport=123,
file.vport=1234,file.segment=my_segment

Signed-off-by: Chrysostomos Nanakos <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 70537a8506d5fd098dbb7a739e882fca18476d09
      
https://github.com/qemu/qemu/commit/70537a8506d5fd098dbb7a739e882fca18476d09
  Author: Chrysostomos Nanakos <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/archipelago.c

  Log Message:
  -----------
  block/archipelago: Implement bdrv_parse_filename()

VM Image on Archipelago volume can also be specified like this:

file=archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>][:
segment=<segment_name>]]

Examples:

file=archipelago:my_vm_volume
file=archipelago:my_vm_volume/mport=123
file=archipelago:my_vm_volume/mport=123:vport=1234
file=archipelago:my_vm_volume/mport=123:vport=1234:segment=my_segment

Signed-off-by: Chrysostomos Nanakos <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 76d3d83a377aea9d3117a56de707df489c801b1a
      
https://github.com/qemu/qemu/commit/76d3d83a377aea9d3117a56de707df489c801b1a
  Author: Chrysostomos Nanakos <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/archipelago.c

  Log Message:
  -----------
  block/archipelago: Add support for creating images

qemu-img archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>]
 [:segment=<segment_name>]] [size]

Signed-off-by: Chrysostomos Nanakos <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b1de5f439d46d690518e067faa429d4cd131ada5
      
https://github.com/qemu/qemu/commit/b1de5f439d46d690518e067faa429d4cd131ada5
  Author: Chrysostomos Nanakos <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M qapi/block-core.json

  Log Message:
  -----------
  QMP: Add support for Archipelago

Introduce new enum BlockdevOptionsArchipelago.

@volume:              #Name of the Archipelago volume image

@mport:               #'mport' is the port number on which mapperd is
                listening. This is optional and if not specified,
                QEMU will make Archipelago to use the default port.

@vport:               #'vport' is the port number on which vlmcd is
                listening. This is optional and if not specified,
                QEMU will make Archipelago to use the default port.

@segment:             #optional The name of the shared memory segment
                Archipelago stack is using. This is optional
                and if not specified, QEMU will make Archipelago
                use the default value, 'archipelago'.

Signed-off-by: Chrysostomos Nanakos <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 746ebfa77aa7a9550d11d3e7c8c10ecb8393ec76
      
https://github.com/qemu/qemu/commit/746ebfa77aa7a9550d11d3e7c8c10ecb8393ec76
  Author: Chrysostomos Nanakos <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

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

  Log Message:
  -----------
  qemu-iotests: add support for Archipelago protocol

Signed-off-by: Chrysostomos Nanakos <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ac2662a913ee5854b1269256adbdc14e57ba480a
      
https://github.com/qemu/qemu/commit/ac2662a913ee5854b1269256adbdc14e57ba480a
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

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

  Log Message:
  -----------
  coroutine: make pool size dynamic

Allow coroutine users to adjust the pool size.  For example, if the
guest has multiple emulated disk drives we should keep around more
coroutines.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 2a87151fb2725658f7419038a80f91065159f34b
      
https://github.com/qemu/qemu/commit/2a87151fb2725658f7419038a80f91065159f34b
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: bump coroutine pool size for drives

When a BlockDriverState is associated with a storage controller
DeviceState we expect guest I/O.  Use this opportunity to bump the
coroutine pool size by 64.

This patch ensures that the coroutine pool size scales with the number
of drives attached to the guest.  It should increase coroutine pool
usage (which makes qemu_coroutine_create() fast) without hogging too
much memory when fewer drives are attached.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: c2e50e3d11a0bf4c973cc30478c1af0f2d5f8e81
      
https://github.com/qemu/qemu/commit/c2e50e3d11a0bf4c973cc30478c1af0f2d5f8e81
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M thread-pool.c

  Log Message:
  -----------
  thread-pool: avoid per-thread-pool EventNotifier

EventNotifier is implemented using an eventfd or pipe.  It therefore
consumes file descriptors, which can be limited by rlimits and should
therefore be used sparingly.

Switch from EventNotifier to QEMUBH in thread-pool.c.  Originally
EventNotifier was used because qemu_bh_schedule() was not thread-safe
yet.

Reported-by: Christian Borntraeger <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3c80ca158c96ff902a30883a8933e755988948b1
      
https://github.com/qemu/qemu/commit/3c80ca158c96ff902a30883a8933e755988948b1
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M thread-pool.c

  Log Message:
  -----------
  thread-pool: avoid deadlock in nested aio_poll() calls

The thread pool has a race condition if two elements complete before
thread_pool_completion_bh() runs:

  If element A's callback waits for element B using aio_poll() it will
  deadlock since pool->completion_bh is not marked scheduled when the
  nested aio_poll() runs.

Fix this by marking the BH scheduled while thread_pool_completion_bh()
is executing.  This way any nested aio_poll() loops will enter
thread_pool_completion_bh() and complete the remaining elements.

Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 349592e0b9112171500e940dd921bb96cfc496d2
      
https://github.com/qemu/qemu/commit/349592e0b9112171500e940dd921bb96cfc496d2
  Author: Jeff Cody <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vhdx-log.c

  Log Message:
  -----------
  block: vhdx - add error check

This add an error check for an invalid descriptor entry signature,
when flushing the log descriptor entries.

Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 4f75b52a07e0a0e71c1c81d0cb0ddf9c52c8e1bc
      
https://github.com/qemu/qemu/commit/4f75b52a07e0a0e71c1c81d0cb0ddf9c52c8e1bc
  Author: Jeff Cody <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vhdx-endian.c
    M block/vhdx-log.c
    M block/vhdx.c
    M block/vhdx.h

  Log Message:
  -----------
  block: VHDX endian fixes

This patch contains several changes for endian conversion fixes for
VHDX, particularly for big-endian machines (multibyte values in VHDX are
all on disk in LE format).

Tests were done with existing qemu-iotests on an IBM POWER7 (8406-71Y).
This includes sample images created by Hyper-V, both with dirty logs and
without.

In addition, VHDX image files created (and written to) on a BE machine
were tested on a LE machine, and vice-versa.

Reported-by: Markus Armburster <address@hidden>
Reported-by: Paolo Bonzini <address@hidden>
Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 58803ce74f986785badfb2ef0f630e1cd97f52e5
      
https://github.com/qemu/qemu/commit/58803ce74f986785badfb2ef0f630e1cd97f52e5
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M tests/test-coroutine.c

  Log Message:
  -----------
  test-coroutine: add baseline test that times the cost of function calls

This can be used to compute the cost of coroutine operations.  In the
end the cost of the function call is a few clock cycles, so it's pretty
cheap for now, but it may become more relevant as the coroutine code
is optimized.

For example, here are the results on my machine:

   Function call 100000000 iterations: 0.173884 s
   Yield 100000000 iterations: 8.445064 s
   Lifecycle 1000000 iterations: 0.098445 s
   Nesting 10000 iterations of 1000 depth each: 7.406431 s

One yield takes 83 nanoseconds, one enter takes 97 nanoseconds,
one coroutine allocation takes (roughly, since some of the allocations
in the nesting test do hit the pool) 739 nanoseconds:

   (8.445064 - 0.173884) * 10^9 / 100000000 = 82.7
   (0.098445 * 100 - 0.173884) * 10^9 / 100000000 = 96.7
   (7.406431 * 10 - 0.173884) * 10^9 / 100000000 = 738.9

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


  Commit: 9a4d5ca60772e09d0cbac01f1b4778aa68e00eaa
      
https://github.com/qemu/qemu/commit/9a4d5ca60772e09d0cbac01f1b4778aa68e00eaa
  Author: Jeff Cody <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: allow bdrv_unref() to be passed NULL pointers

If bdrv_unref() is passed a NULL BDS pointer, it is safe to
exit with no operation.  This will allow cleanup code to blindly
call bdrv_unref() on a BDS that has been initialized to NULL.

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


  Commit: 70747862f129ea0af5e3910f204cc93174c549e4
      
https://github.com/qemu/qemu/commit/70747862f129ea0af5e3910f204cc93174c549e4
  Author: Jeff Cody <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vdi.c

  Log Message:
  -----------
  block: vdi - use block layer ops in vdi_create, instead of posix calls

Use the block layer to create, and write to, the image file in the
VDI .bdrv_create() operation.

This has a couple of benefits: Images can now be created over protocols,
and hacks such as NOCOW are not needed in the image format driver, and
the underlying file protocol appropriate for the host OS can be relied
upon.

Also some minor cleanup for error handling.

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


  Commit: dddc7750d68c3ea86d88b060a77acb60d2eeb4a7
      
https://github.com/qemu/qemu/commit/dddc7750d68c3ea86d88b060a77acb60d2eeb4a7
  Author: Jeff Cody <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vdi.c

  Log Message:
  -----------
  block: use the standard 'ret' instead of 'result'

Most QEMU code uses 'ret' for function return values. The VDI driver
uses a mix of 'result' and 'ret'.  This cleans that up, switching over
to the standard 'ret' usage.

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


  Commit: fef6070eff233400015cede968b0afe46c80bb0f
      
https://github.com/qemu/qemu/commit/fef6070eff233400015cede968b0afe46c80bb0f
  Author: Jeff Cody <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vpc.c

  Log Message:
  -----------
  block: vpc - use block layer ops in vpc_create, instead of posix calls

Use the block layer to create, and write to, the image file in the VPC
.bdrv_create() operation.

This has a couple of benefits: Images can now be created over protocols,
and hacks such as NOCOW are not needed in the image format driver, and
the underlying file protocol appropriate for the host OS can be relied
upon.

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


  Commit: 23d20b5b4fb7bde102e6779b7a13b88375e4db66
      
https://github.com/qemu/qemu/commit/23d20b5b4fb7bde102e6779b7a13b88375e4db66
  Author: Jeff Cody <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

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

  Log Message:
  -----------
  block: iotest - update 084 to test static VDI image creation

This updates the VDI corruption test to also test static VDI image
creation, as well as the default dynamic image creation.

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


  Commit: 7d2a35cc921ea4832083a7e8598461868bb538ce
      
https://github.com/qemu/qemu/commit/7d2a35cc921ea4832083a7e8598461868bb538ce
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c
    M include/block/block.h
    M include/qemu/osdep.h
    M util/oslib-posix.c
    M util/oslib-win32.c

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

This function returns NULL instead of aborting when an allocation fails.

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


  Commit: 857d4f46c31d2f4d57d2f0fad9dfb584262bf9b9
      
https://github.com/qemu/qemu/commit/857d4f46c31d2f4d57d2f0fad9dfb584262bf9b9
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses bounce buffer allocations in block.c. While at it,
convert bdrv_commit() from plain g_malloc() to qemu_try_blockalign().

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


  Commit: 7bf665ee3504ab0ca4b8c29e1f603829a8272a26
      
https://github.com/qemu/qemu/commit/7bf665ee3504ab0ca4b8c29e1f603829a8272a26
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/bochs.c

  Log Message:
  -----------
  bochs: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the bochs block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: 4ae7a52e435e4e50a27e0ccc441da80a7fccbc21
      
https://github.com/qemu/qemu/commit/4ae7a52e435e4e50a27e0ccc441da80a7fccbc21
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/cloop.c

  Log Message:
  -----------
  cloop: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the cloop block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: 8dc7a7725bd6db2aa7e3c09b49bc21a1a25f40cb
      
https://github.com/qemu/qemu/commit/8dc7a7725bd6db2aa7e3c09b49bc21a1a25f40cb
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/curl.c

  Log Message:
  -----------
  curl: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the curl block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: b546a944749f963c5b4e27765354df10ac531853
      
https://github.com/qemu/qemu/commit/b546a944749f963c5b4e27765354df10ac531853
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/dmg.c

  Log Message:
  -----------
  dmg: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the dmg block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: 4d5a3f888c7dbdd1bf892bab2a3fb5c1455ccc78
      
https://github.com/qemu/qemu/commit/4d5a3f888c7dbdd1bf892bab2a3fb5c1455ccc78
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  iscsi: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the iscsi block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 2347dd7b6841c1543ceb49cb232d596eb5dd1ca3
      
https://github.com/qemu/qemu/commit/2347dd7b6841c1543ceb49cb232d596eb5dd1ca3
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/nfs.c

  Log Message:
  -----------
  nfs: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the nfs block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: f7b593d93746ff1032a809542152212246e24fa7
      
https://github.com/qemu/qemu/commit/f7b593d93746ff1032a809542152212246e24fa7
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/parallels.c

  Log Message:
  -----------
  parallels: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the parallels block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: 0df93305f21712e975ab5df260cc5a91e5daafca
      
https://github.com/qemu/qemu/commit/0df93305f21712e975ab5df260cc5a91e5daafca
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/qcow.c

  Log Message:
  -----------
  qcow1: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the qcow1 block driver.

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


  Commit: de82815db1c89da058b7fb941dab137d6d9ab738
      
https://github.com/qemu/qemu/commit/de82815db1c89da058b7fb941dab137d6d9ab738
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

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

  Log Message:
  -----------
  qcow2: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the qcow2 block driver.

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


  Commit: 4f4896db5fb2285df016ff927508560c89b845a4
      
https://github.com/qemu/qemu/commit/4f4896db5fb2285df016ff927508560c89b845a4
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/qed-check.c
    M block/qed.c

  Log Message:
  -----------
  qed: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the qed block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: 50d4a858e62b1d864227d13f07d2c79c118d046a
      
https://github.com/qemu/qemu/commit/50d4a858e62b1d864227d13f07d2c79c118d046a
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  raw-posix: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the raw-posix block driver.

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


  Commit: 4b6af3d58a73193017926dd59de3b3e7b4890323
      
https://github.com/qemu/qemu/commit/4b6af3d58a73193017926dd59de3b3e7b4890323
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/win32-aio.c

  Log Message:
  -----------
  raw-win32: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the raw-win32 block driver.

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


  Commit: 0f7a02379bb672666e21dfcd6b549c3506f8d784
      
https://github.com/qemu/qemu/commit/0f7a02379bb672666e21dfcd6b549c3506f8d784
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/rbd.c

  Log Message:
  -----------
  rbd: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the rbd block driver.

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


  Commit: 17cce735780f0ff6a2ef173c34614bd47acd56e5
      
https://github.com/qemu/qemu/commit/17cce735780f0ff6a2ef173c34614bd47acd56e5
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vdi.c

  Log Message:
  -----------
  vdi: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the vdi block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: a67e128a4f40cf07abd86f92d0d3c913db2ad885
      
https://github.com/qemu/qemu/commit/a67e128a4f40cf07abd86f92d0d3c913db2ad885
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vhdx-log.c
    M block/vhdx.c

  Log Message:
  -----------
  vhdx: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the vhdx block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: d6e5993197990ff55c660714526681fa7028299e
      
https://github.com/qemu/qemu/commit/d6e5993197990ff55c660714526681fa7028299e
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the vmdk block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: 5fb09cd5867aabf26d5b85b0913dccd496b71421
      
https://github.com/qemu/qemu/commit/5fb09cd5867aabf26d5b85b0913dccd496b71421
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/vpc.c

  Log Message:
  -----------
  vpc: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the vpc block driver.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: 7504edf477d2bac9cbf53225811ec595abf045e4
      
https://github.com/qemu/qemu/commit/7504edf477d2bac9cbf53225811ec595abf045e4
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/mirror.c

  Log Message:
  -----------
  mirror: Handle failure for potentially large allocations

Some code in the block layer makes potentially huge allocations. Failure
is not completely unexpected there, so avoid aborting qemu and handle
out-of-memory situations gracefully.

This patch addresses the allocations in the mirror block job.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>


  Commit: 8fcffa9853473ab148d36858f15c5531161a1824
      
https://github.com/qemu/qemu/commit/8fcffa9853473ab148d36858f15c5531161a1824
  Author: Max Reitz <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/qcow2-refcount.c

  Log Message:
  -----------
  qcow2: Return useful error code in refcount_init()

If bdrv_pread() returns an error, it is very unlikely that it was
ENOMEM. In this case, the return value should be passed along; as
bdrv_pread() will always either return the number of bytes read or a
negative value (the error code), the condition for checking whether
bdrv_pread() failed can be simplified (and clarified) as well.

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


  Commit: ff52aab2df5c5e10f231481961b88d25a3021724
      
https://github.com/qemu/qemu/commit/ff52aab2df5c5e10f231481961b88d25a3021724
  Author: Max Reitz <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Catch !*host_offset for data allocation

qcow2_alloc_cluster_offset() uses host_offset == 0 as "no preferred
offset" for the (data) cluster range to be allocated. However, this
offset is actually valid and may be allocated on images with a corrupted
refcount table or first refcount block.

In this case, the corruption prevention should normally catch that
write anyway (because it would overwrite the image header). But since 0
is a special value here, the function assumes that nothing has been
allocated at all which it asserts against.

Because this condition is not qemu's fault but rather that of a broken
image, it shouldn't throw an assertion but rather mark the image corrupt
and show an appropriate message, which this patch does by calling the
corruption check earlier than it would be called normally (before the
assertion).

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


  Commit: a42f8a3d05c5598cee893c9cf5ffeee48bacb83e
      
https://github.com/qemu/qemu/commit/a42f8a3d05c5598cee893c9cf5ffeee48bacb83e
  Author: Max Reitz <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

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

  Log Message:
  -----------
  iotests: Add test for image header overlap

Add a test for an image with an unallocated image header; instead of an
assertion, this should result in the image being marked corrupt.

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


  Commit: 908bcd540f489f7adf2d804347905b0025d808d3
      
https://github.com/qemu/qemu/commit/908bcd540f489f7adf2d804347905b0025d808d3
  Author: Max Reitz <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Catch !bs->drv in bdrv_check()

qemu-img check calls bdrv_check() twice if the first run repaired some
inconsistencies. If the first run however again triggered corruption
prevention (on qcow2) due to very bad inconsistencies, bs->drv may be
NULL afterwards. Thus, bdrv_check() should check whether bs->drv is set.

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


  Commit: f2fb1da9412ae7b4cb512cfbd86c0185f191e2f9
      
https://github.com/qemu/qemu/commit/f2fb1da9412ae7b4cb512cfbd86c0185f191e2f9
  Author: Peter Maydell <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M MAINTAINERS
    M block-migration.c
    M block.c
    M block/Makefile.objs
    A block/archipelago.c
    M block/bochs.c
    M block/cloop.c
    M block/curl.c
    M block/dmg.c
    M block/iscsi.c
    M block/mirror.c
    M block/nfs.c
    M block/parallels.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2-cache.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2-snapshot.c
    M block/qcow2.c
    M block/qed-check.c
    M block/qed.c
    M block/raw-posix.c
    M block/rbd.c
    M block/vdi.c
    M block/vhdx-endian.c
    M block/vhdx-log.c
    M block/vhdx.c
    M block/vhdx.h
    M block/vmdk.c
    M block/vpc.c
    M block/win32-aio.c
    M configure
    A docs/multiple-iothreads.txt
    M docs/specs/qcow2.txt
    M hw/block/xen_disk.c
    M include/block/block.h
    M include/block/coroutine.h
    M include/qemu/osdep.h
    M qapi/block-core.json
    M qdev-monitor.c
    M qemu-coroutine.c
    M qemu-img.c
    M qmp.c
    M tests/qemu-iotests/059
    M tests/qemu-iotests/059.out
    M tests/qemu-iotests/060
    M tests/qemu-iotests/060.out
    M tests/qemu-iotests/084
    M tests/qemu-iotests/084.out
    M tests/qemu-iotests/common
    M tests/qemu-iotests/common.rc
    M tests/qemu-iotests/sample_images/iotest-version3.vmdk.bz2
    M tests/test-coroutine.c
    M thread-pool.c
    M util/oslib-posix.c
    M util/oslib-win32.c

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

Block patches

# gpg: Signature made Fri 15 Aug 2014 14:07:42 BST using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"

* remotes/kevin/tags/for-upstream: (59 commits)
  block: Catch !bs->drv in bdrv_check()
  iotests: Add test for image header overlap
  qcow2: Catch !*host_offset for data allocation
  qcow2: Return useful error code in refcount_init()
  mirror: Handle failure for potentially large allocations
  vpc: Handle failure for potentially large allocations
  vmdk: Handle failure for potentially large allocations
  vhdx: Handle failure for potentially large allocations
  vdi: Handle failure for potentially large allocations
  rbd: Handle failure for potentially large allocations
  raw-win32: Handle failure for potentially large allocations
  raw-posix: Handle failure for potentially large allocations
  qed: Handle failure for potentially large allocations
  qcow2: Handle failure for potentially large allocations
  qcow1: Handle failure for potentially large allocations
  parallels: Handle failure for potentially large allocations
  nfs: Handle failure for potentially large allocations
  iscsi: Handle failure for potentially large allocations
  dmg: Handle failure for potentially large allocations
  curl: Handle failure for potentially large allocations
  ...

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


Compare: https://github.com/qemu/qemu/compare/f083201667fd...f2fb1da9412a

reply via email to

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