qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 65f33b: qcow2: Fix alloc_clusters_noref() ove


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 65f33b: qcow2: Fix alloc_clusters_noref() overflow detecti...
Date: Tue, 13 May 2014 04:00:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 65f33bc0020112e7be7b8966495cd5efa2d0ab15
      
https://github.com/qemu/qemu/commit/65f33bc0020112e7be7b8966495cd5efa2d0ab15
  Author: Max Reitz <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M block/qcow2-refcount.c

  Log Message:
  -----------
  qcow2: Fix alloc_clusters_noref() overflow detection

If the very first allocation has a length of 0, the free_cluster_index
is still 0 after the for loop, which means that subtracting one from it
will underflow and signal an invalid range of clusters by returning
-EFBIG. However, there is no such range, as its length is 0.

Fix this by preventing underflows on free_cluster_index during the
check.

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


  Commit: f915db07ef9c368ea6db6430256de064fdd1525f
      
https://github.com/qemu/qemu/commit/f915db07ef9c368ea6db6430256de064fdd1525f
  Author: Max Reitz <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M configure
    M tests/qemu-iotests/031
    M tests/qemu-iotests/036
    M tests/qemu-iotests/039
    M tests/qemu-iotests/054
    M tests/qemu-iotests/060
    M tests/qemu-iotests/061
    M tests/qemu-iotests/065
    M tests/qemu-iotests/083
    M tests/qemu-iotests/check

  Log Message:
  -----------
  iotests: Use configured python

Currently, QEMU's iotests rely on /usr/bin/env to start the correct
Python (that is, at least Python 2.4, but not 3). On systems where
Python 3 is the default, the user has no clean way of making the iotests
use the correct binary.

This commit makes the iotests use the Python selected by configure.

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


  Commit: 1a443c1b8b4314d365e82bddeb1de5b4b1c15fb3
      
https://github.com/qemu/qemu/commit/1a443c1b8b4314d365e82bddeb1de5b4b1c15fb3
  Author: Mike Day <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: sort block formats in help message

The help message for qemu-img lists the supported block formats, of
which there are 27 as of version 2.0.50. The formats are printed in
the order of their driver's position in a linked list, which appears
random. This patch prints the formats in sorted order, making it
easier to read and to find a specific format in the list.

[Added suggestions from Fam Zheng <address@hidden> to declare variables
at the top of the scope in help() and to omit explicit cast for void*
opaque.
--Stefan]

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


  Commit: 5f4d5e1aa652712ea39b6fd97114378c5c15ccda
      
https://github.com/qemu/qemu/commit/5f4d5e1aa652712ea39b6fd97114378c5c15ccda
  Author: Max Reitz <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M block/nfs.c

  Log Message:
  -----------
  block/nfs: Check for NULL server part

After the URL has been parsed make sure the server part is valid in
order to avoid a segmentation fault when calling nfs_mount().

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


  Commit: ec209aca8340be1c81afe13fbe0ba135e5d3b9f4
      
https://github.com/qemu/qemu/commit/ec209aca8340be1c81afe13fbe0ba135e5d3b9f4
  Author: Peter Lieven <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: bump year in copyright notice

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


  Commit: 85f49cad879adfb5c3cbdc47ca3c3b50eb8f40bc
      
https://github.com/qemu/qemu/commit/85f49cad879adfb5c3cbdc47ca3c3b50eb8f40bc
  Author: Fam Zheng <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

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

  Log Message:
  -----------
  qemu-img: Convert by cluster size if target is compressed

If target block driver forces compression, qemu-img convert needs to
write by cluster size as well as "-c" option.

Particularly, this applies for converting to VMDK streamOptimized
format.

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


  Commit: ba0ad89e2c3316ce26ca6576a3c5051f91bfc0fe
      
https://github.com/qemu/qemu/commit/ba0ad89e2c3316ce26ca6576a3c5051f91bfc0fe
  Author: Fam Zheng <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Implement .bdrv_write_compressed

Add a wrapper function to support "compressed" path in qemu-img convert.
Only support streamOptimized subformat case for now (num_extents == 1
and extent compression is true).

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


  Commit: 74fe188cd1a27a5565787152d8620f8b8d04c4f9
      
https://github.com/qemu/qemu/commit/74fe188cd1a27a5565787152d8620f8b8d04c4f9
  Author: Fam Zheng <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

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

  Log Message:
  -----------
  vmdk: Implement .bdrv_get_info()

This will return cluster_size and needs_compressed_writes to caller, if all the
extents have the same value (or there's only one extent). Otherwise return
-ENOTSUP.

cluster_size is only reported for sparse formats.

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


  Commit: 10f08a0a3435afea441db8d0981dbad49042c7cf
      
https://github.com/qemu/qemu/commit/10f08a0a3435afea441db8d0981dbad49042c7cf
  Author: Fam Zheng <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

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

  Log Message:
  -----------
  qemu-iotests: Test converting to streamOptimized from small cluster size

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


  Commit: b1e6fc0817dca14a3581d7b0979a5885608981f2
      
https://github.com/qemu/qemu/commit/b1e6fc0817dca14a3581d7b0979a5885608981f2
  Author: Kevin Wolf <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

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

  Log Message:
  -----------
  block: Fix open flags with BDRV_O_SNAPSHOT

The immediately visible effect of this patch is that it fixes committing
a temporary snapshot to its backing file. Previously, it would fail with
a "permission denied" error because bdrv_inherited_flags() forced the
backing file to be read-only, ignoring the r/w reopen of bdrv_commit().

The bigger problem this revealed is that the original open flags must
actually only be applied to the temporary snapshot, and the original
image file must be treated as a backing file of the temporary snapshot
and get the right flags for that.

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


  Commit: 02ce232c5051854bf49e6d2816c65e00f6d7e036
      
https://github.com/qemu/qemu/commit/02ce232c5051854bf49e6d2816c65e00f6d7e036
  Author: Kirill Batuzov <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M qemu-timer.c
    M vl.c

  Log Message:
  -----------
  vl.c: remove init_clocks call from main

Clocks are initialized in qemu_init_main_loop. They are not needed before it.
Initializing them twice is not only unnecessary but is harmful: it results in
memory leak and potentially can lead to a situation where different parts of
QEMU use different sets of timers.

To avoid it remove init_clocks call from main and add an assertion to
qemu_clock_init that corresponding clock has not been initialized yet.

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


  Commit: 4557117d9eed8cadc360aec23b42fc39a7011864
      
https://github.com/qemu/qemu/commit/4557117d9eed8cadc360aec23b42fc39a7011864
  Author: Peter Krempa <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M block/gluster.c

  Log Message:
  -----------
  gluster: Correctly propagate errors when volume isn't accessible

The docs for glfs_init suggest that the function sets errno on every
failure. In fact it doesn't. As other functions such as
qemu_gluster_open() in the gluster block code report their errors based
on this fact we need to make sure that errno is set on each failure.

This fixes a crash of qemu-img/qemu when a gluster brick isn't
accessible from given host while the server serving the volume
description is.

Thread 1 (Thread 0x7ffff7fba740 (LWP 203880)):
 #0  0x00007ffff77673f8 in glfs_lseek () from /usr/lib64/libgfapi.so.0
 #1  0x0000555555574a68 in qemu_gluster_getlength ()
 #2  0x0000555555565742 in refresh_total_sectors ()
 #3  0x000055555556914f in bdrv_open_common ()
 #4  0x000055555556e8e8 in bdrv_open ()
 #5  0x000055555556f02f in bdrv_open_image ()
 #6  0x000055555556e5f6 in bdrv_open ()
 #7  0x00005555555c5775 in bdrv_new_open ()
 #8  0x00005555555c5b91 in img_info ()
 #9  0x00007ffff62c9c05 in __libc_start_main () from /lib64/libc.so.6
 #10 0x00005555555648ad in _start ()

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


  Commit: 4f11aa8a40351b28c0e67c7276e0003b38cc46ac
      
https://github.com/qemu/qemu/commit/4f11aa8a40351b28c0e67c7276e0003b38cc46ac
  Author: Max Reitz <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  block/raw-posix: Try both FIEMAP and SEEK_HOLE

The current version of raw-posix always uses ioctl(FS_IOC_FIEMAP) if
FIEMAP is available; lseek with SEEK_HOLE/SEEK_DATA are not even
compiled in in this case. However, there may be implementations which
support the latter but not the former (e.g., NFSv4.2) as well as vice
versa.

To cover both cases, try FIEMAP first (as this will return -ENOTSUP if
not supported instead of returning a failsafe value (everything
allocated as a single extent)) and if that does not work, fall back to
SEEK_HOLE/SEEK_DATA.

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


  Commit: e940bc13ee15d6304f3a467961b9f33fc0f25595
      
https://github.com/qemu/qemu/commit/e940bc13ee15d6304f3a467961b9f33fc0f25595
  Author: Jeff Cody <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

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

  Log Message:
  -----------
  block: qemu-iotests - add common.qemu, for bash-controlled qemu tests

This creates some common functions for bash language qemu-iotests
to control, and communicate with, a running QEMU process.

4 functions are introduced:

    1. _launch_qemu()
  This launches the QEMU process(es), and sets up the file
  descriptors and fifos for communication.  You can choose to
  launch each QEMU process listening for either QMP or HMP
  monitor.  You can call this function multiple times, and
  save the handle returned from each.  The returned handle is
  in $QEMU_HANDLE.  You must copy this value.

Commands 2 and 3 use the handle received from _launch_qemu(), to talk
to the appropriate process.

    2. _send_qemu_cmd()
  Sends a command string, specified by $2, to QEMU.  If $3 is
  non-NULL, _send_qemu_cmd() will wait to receive $3 as a
  required result string from QEMU.  Failure to receive $3 will
  cause the test to fail.  The command can optionally be retried
  $qemu_cmd_repeat number of times.  Set $qemu_error_no_exit
  to not force the test the fail on exit; in this case,
  $QEMU_STATUS[$1] will be set to -1 on failure.

    3. _timed_wait_for()
  Waits for a response, for up to a default of 10 seconds.  If
  $2 is not seen in that time (anywhere in the response), then
  the test fails.  Primarily used by _send_qemu_cmd, but could
  be useful standalone, as well.  To prevent automatic exit
  (and therefore test failure), set $qemu_error_no_exit to a
  non-NULL value.  If $silent is a non-NULL value, then output
  to stdout will be suppressed.

    4. _cleanup_qemu()
  Kills the running QEMU processes, and removes the fifos.

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


  Commit: e86e8697708ada85ce4b8f9df00342912f7ca14c
      
https://github.com/qemu/qemu/commit/e86e8697708ada85ce4b8f9df00342912f7ca14c
  Author: Jeff Cody <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M tests/qemu-iotests/085

  Log Message:
  -----------
  block: qemu-iotests - update 085 to use common.qemu

The new functionality of common.qemu implements the QEMU control
and communication functionality that was originally in test 085.

This removes that now-duplicate functionality, and uses the
common.qemu functions.

The QEMU commandline changes slightly due to this; in addition to
monitor and qmp i/o options, the new QEMU commandline from inside
common.qemu now introduces -machine accel=qtest.

Reviewed-by: Benoit Canet <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Jeff Cody <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: fd040174ac7c302365c1d6dc5646f957972d67d6
      
https://github.com/qemu/qemu/commit/fd040174ac7c302365c1d6dc5646f957972d67d6
  Author: Jeff Cody <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

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

  Log Message:
  -----------
  block: qemu-iotests - test for live migration

This is an initial, simple live migration test from one
running VM to another, using monitor commands.

This is also an example of using the new common.qemu functions
for controlling multiple running qemu instances, for tests that
need a live qemu vm.

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


  Commit: 5a007547df76446ab891df93ebc55749716609bf
      
https://github.com/qemu/qemu/commit/5a007547df76446ab891df93ebc55749716609bf
  Author: Sangho Park <address@hidden>
  Date:   2014-05-09 (Fri, 09 May 2014)

  Changed paths:
    M include/glib-compat.h
    M util/oslib-win32.c

  Log Message:
  -----------
  glib: fix g_poll early timeout on windows

g_poll has a problem on Windows when using
timeouts < 10ms, in glib/gpoll.c:

/* If not, and we have a significant timeout, poll again with
 * timeout then. Note that this will return indication for only
 * one event, or only for messages. We ignore timeouts less than
 * ten milliseconds as they are mostly pointless on Windows, the
 * MsgWaitForMultipleObjectsEx() call will timeout right away
 * anyway.
 */
if (retval == 0 && (timeout == INFINITE || timeout >= 10))
  retval = poll_rest (poll_msgs, handles, nhandles, fds, nfds, timeout);

so whenever g_poll is called with timeout < 10ms it does
a quick poll instead of wait, this causes significant performance
degradation of QEMU, thus we should use WaitForMultipleObjectsEx
directly

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


  Commit: 1b5498f6874ad661bcd9558bc2b0a4e25643a5bf
      
https://github.com/qemu/qemu/commit/1b5498f6874ad661bcd9558bc2b0a4e25643a5bf
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-13 (Tue, 13 May 2014)

  Changed paths:
    M block.c
    M block/gluster.c
    M block/iscsi.c
    M block/nfs.c
    M block/qcow2-refcount.c
    M block/raw-posix.c
    M block/vmdk.c
    M configure
    M include/block/block.h
    M include/glib-compat.h
    M qemu-img.c
    M qemu-timer.c
    M tests/qemu-iotests/031
    M tests/qemu-iotests/036
    M tests/qemu-iotests/039
    M tests/qemu-iotests/051
    M tests/qemu-iotests/051.out
    M tests/qemu-iotests/054
    M tests/qemu-iotests/059
    M tests/qemu-iotests/059.out
    M tests/qemu-iotests/060
    M tests/qemu-iotests/061
    M tests/qemu-iotests/065
    M tests/qemu-iotests/083
    M tests/qemu-iotests/085
    A tests/qemu-iotests/091
    A tests/qemu-iotests/091.out
    M tests/qemu-iotests/check
    A tests/qemu-iotests/common.qemu
    M tests/qemu-iotests/group
    M util/oslib-win32.c
    M vl.c

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

Block pull request

# gpg: Signature made Fri 09 May 2014 19:57:53 BST 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:
  glib: fix g_poll early timeout on windows
  block: qemu-iotests - test for live migration
  block: qemu-iotests - update 085 to use common.qemu
  block: qemu-iotests - add common.qemu, for bash-controlled qemu tests
  block/raw-posix: Try both FIEMAP and SEEK_HOLE
  gluster: Correctly propagate errors when volume isn't accessible
  vl.c: remove init_clocks call from main
  block: Fix open flags with BDRV_O_SNAPSHOT
  qemu-iotests: Test converting to streamOptimized from small cluster size
  vmdk: Implement .bdrv_get_info()
  vmdk: Implement .bdrv_write_compressed
  qemu-img: Convert by cluster size if target is compressed
  block/iscsi: bump year in copyright notice
  block/nfs: Check for NULL server part
  qemu-img: sort block formats in help message
  iotests: Use configured python
  qcow2: Fix alloc_clusters_noref() overflow detection

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


Compare: https://github.com/qemu/qemu/compare/e5bfd64050e8...1b5498f6874a

reply via email to

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