qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 5839e5: block: Use g_new() & friends where th


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 5839e5: block: Use g_new() & friends where that makes obvi...
Date: Fri, 22 Aug 2014 09:30:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 5839e53bbc0fec56021d758aab7610df421ed8c8
      
https://github.com/qemu/qemu/commit/5839e53bbc0fec56021d758aab7610df421ed8c8
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M block-migration.c
    M block.c
    M block/archipelago.c
    M block/gluster.c
    M block/iscsi.c
    M block/nfs.c
    M block/qcow.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2-snapshot.c
    M block/raw-posix.c
    M block/rbd.c
    M block/sheepdog.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vvfat.c
    M blockdev-nbd.c
    M blockdev.c
    M hw/ide/ahci.c
    M qemu-io-cmds.c
    M qemu-io.c

  Log Message:
  -----------
  block: Use g_new() & friends where that makes obvious sense

g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
for two reasons.  One, it catches multiplication overflowing size_t.
Two, it returns T * rather than void *, which lets the compiler catch
more type errors.

Patch created with Coccinelle, with two manual changes on top:

* Add const to bdrv_iterate_format() to keep the types straight

* Convert the allocation in bdrv_drop_intermediate(), which Coccinelle
  inexplicably misses

Coccinelle semantic patch:

    @@
    type T;
    @@
    -g_malloc(sizeof(T))
    +g_new(T, 1)
    @@
    type T;
    @@
    -g_try_malloc(sizeof(T))
    +g_try_new(T, 1)
    @@
    type T;
    @@
    -g_malloc0(sizeof(T))
    +g_new0(T, 1)
    @@
    type T;
    @@
    -g_try_malloc0(sizeof(T))
    +g_try_new0(T, 1)
    @@
    type T;
    expression n;
    @@
    -g_malloc(sizeof(T) * (n))
    +g_new(T, n)
    @@
    type T;
    expression n;
    @@
    -g_try_malloc(sizeof(T) * (n))
    +g_try_new(T, n)
    @@
    type T;
    expression n;
    @@
    -g_malloc0(sizeof(T) * (n))
    +g_new0(T, n)
    @@
    type T;
    expression n;
    @@
    -g_try_malloc0(sizeof(T) * (n))
    +g_try_new0(T, n)
    @@
    type T;
    expression p, n;
    @@
    -g_realloc(p, sizeof(T) * (n))
    +g_renew(T, p, n)
    @@
    type T;
    expression p, n;
    @@
    -g_try_realloc(p, sizeof(T) * (n))
    +g_try_renew(T, p, n)

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


  Commit: 02c4f26b1517d9e403ec10d6f6ca3c0276d19e43
      
https://github.com/qemu/qemu/commit/02c4f26b1517d9e403ec10d6f6ca3c0276d19e43
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M block/bochs.c
    M block/parallels.c
    M block/qcow2-cache.c
    M block/qed-check.c
    M block/rbd.c
    M block/sheepdog.c
    M hw/block/nvme.c
    M qemu-io-cmds.c

  Log Message:
  -----------
  block: Use g_new() & friends to avoid multiplying sizes

g_new(T, n) is safer than g_malloc(sizeof(*v) * n) for two reasons.
One, it catches multiplication overflowing size_t.  Two, it returns
T * rather than void *, which lets the compiler catch more type
errors.

Perhaps a conversion to g_malloc_n() would be neater in places, but
that's merely four years old, and we can't use such newfangled stuff.

This commit only touches allocations with size arguments of the form
sizeof(T), plus two that use 4 instead of sizeof(uint32_t).  We can
make the others safe by converting to g_malloc_n() when it becomes
available to us in a couple of years.

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


  Commit: 08193dd52ba911077c9a29f62157bc4f3b9564eb
      
https://github.com/qemu/qemu/commit/08193dd52ba911077c9a29f62157bc4f3b9564eb
  Author: Markus Armbruster <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M qemu-io-cmds.c

  Log Message:
  -----------
  qemu-io-cmds: g_renew() can't fail, bury dead error handling

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


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

  Changed paths:
    M block/vhdx-log.c
    M block/vvfat.c
    M hw/ide/microdrive.c

  Log Message:
  -----------
  block: Drop some superfluous casts from void *

They clutter the code.  Unfortunately, I can't figure out how to make
Coccinelle drop all of them, so I have to settle for common special
cases:

    @@
    type T;
    T *pt;
    void *pv;
    @@
    - pt = (T *)pv;
    + pt = pv;
    @@
    type T;
    @@
    - (T *)
      (\(g_malloc\|g_malloc0\|g_realloc\|g_new\|g_new0\|g_renew\|
         g_try_malloc\|g_try_malloc0\|g_try_realloc\|
         g_try_new\|g_try_new0\|g_try_renew\)(...))

Topped off with minor manual style cleanups.

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


  Commit: 9d256ca616a298495e46c64da249b1620540930a
      
https://github.com/qemu/qemu/commit/9d256ca616a298495e46c64da249b1620540930a
  Author: Maria Kustova <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M tests/image-fuzzer/runner.py

  Log Message:
  -----------
  runner: Add an argument for test duration

After the specified duration the runner stops executing new tests, but it
doesn't interrupt running ones.

Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Maria Kustova <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 18a7d0c56e1377f3d5fa1dc4d78a15dbab01cd83
      
https://github.com/qemu/qemu/commit/18a7d0c56e1377f3d5fa1dc4d78a15dbab01cd83
  Author: Maria Kustova <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M tests/image-fuzzer/runner.py

  Log Message:
  -----------
  runner: Kill a program under test by time-out

If a program under test get frozen, the test should finish and report about its
failure.
In such cases the runner waits for 10 minutes until the program ends its
execution. After this time-out the program will be terminated and the test will
be marked as failed.

For current limitation of test image size to 10 MB as a maximum an execution of
each command takes about several seconds in general, so 10 minutes is enough to
discriminate freeze, but not drastically increase an overall test duration.

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


  Commit: 440ba08aea3d841996efaf6a6b88426b0d59abf4
      
https://github.com/qemu/qemu/commit/440ba08aea3d841996efaf6a6b88426b0d59abf4
  Author: Max Reitz <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

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

  Log Message:
  -----------
  qcow2: Constant cache size in bytes

Specifying the metadata cache sizes in clusters results in less clusters
(and much less bytes) covered for small cluster sizes and vice versa.
Using a constant byte size reduces this difference, and makes it
possible to manually specify the cache size in an easily comprehensible
unit.

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


  Commit: 02004bd4ba1ace29812e977d3cd0bc20fd6bf677
      
https://github.com/qemu/qemu/commit/02004bd4ba1ace29812e977d3cd0bc20fd6bf677
  Author: Max Reitz <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M block/qcow2-cache.c

  Log Message:
  -----------
  qcow2: Use g_try_new0() for cache array

With a variable cache size, the number given to qcow2_cache_create() may
be huge. Therefore, use g_try_new0().

While at it, use g_new0() instead of g_malloc0() for allocating the
Qcow2Cache object.

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


  Commit: 6c1c8d5d3ebd2e3bcdc89255363c19a88e14ddec
      
https://github.com/qemu/qemu/commit/6c1c8d5d3ebd2e3bcdc89255363c19a88e14ddec
  Author: Max Reitz <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

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

  Log Message:
  -----------
  qcow2: Add runtime options for cache sizes

Add options for specifying the size of the metadata caches. This can
either be done directly for each cache (if only one is given, the other
will be derived according to a default ratio) or combined for both.

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


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

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

  Log Message:
  -----------
  iotests: Add test for qcow2's cache options

Add a test which tests various combinations of qcow2's cache options
(some of which are valid, some of which are not).

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


  Commit: 61ff8cfbec64f08f6955fe04649665f9f7eb0cc6
      
https://github.com/qemu/qemu/commit/61ff8cfbec64f08f6955fe04649665f9f7eb0cc6
  Author: Ming Lei <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M tests/test-coroutine.c

  Log Message:
  -----------
  test-coroutine: test cost introduced by coroutine

This test runs dummy function with coroutine by using
two enter and one yield since which is a common usage.

So we can see the cost introduced by corouting for running
one function, for example:

        Run operation 20000000 iterations 4.841071 s, 4131K operations/s
        242ns per coroutine

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


  Commit: 6ffb4cb6fd2046e2efb658fb0136e22e4cd0c670
      
https://github.com/qemu/qemu/commit/6ffb4cb6fd2046e2efb658fb0136e22e4cd0c670
  Author: Kevin Wolf <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

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

  Log Message:
  -----------
  qemu-iotests: Fix 028 reference output for qed

We need to filter out driver-specific options in the "Formatting..."
string printed by qemu when creating the backup image.

Reported-by: Peter Wu <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Tested-by: Peter Wu <address@hidden>


  Commit: 927e0e769f4008f458de8a94a809e85c1fd016eb
      
https://github.com/qemu/qemu/commit/927e0e769f4008f458de8a94a809e85c1fd016eb
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: acquire AioContext in qmp_block_resize()

Make block_resize safe for dataplane where another thread may be running
the BlockDriverState's AioContext.

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


  Commit: 466560b9fcada2656b276eb30e25da15a6e706df
      
https://github.com/qemu/qemu/commit/466560b9fcada2656b276eb30e25da15a6e706df
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

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

  Log Message:
  -----------
  virtio-blk: allow block_resize with dataplane

Now that block_resize acquires the AioContext we can safely allow
resizing the disk.

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


  Commit: 1bdb176ac5add5dc9d54a230da7511b66851f1e7
      
https://github.com/qemu/qemu/commit/1bdb176ac5add5dc9d54a230da7511b66851f1e7
  Author: zhanghailiang <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

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

  Log Message:
  -----------
  virtio-blk: fix reference a pointer which might be freed

In function virtio_blk_handle_request, it may freed memory pointed by req,
So do not access member of req after calling this function.

Cc: address@hidden
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 91af7014125895cc74141be6b60f3a3e882ed743
      
https://github.com/qemu/qemu/commit/91af7014125895cc74141be6b60f3a3e882ed743
  Author: Max Reitz <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

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

  Log Message:
  -----------
  block: Add bdrv_refresh_filename()

Some block devices may not have a filename in their BDS; and for some,
there may not even be a normal filename at all. To work around this, add
a function which tries to construct a valid filename for the
BDS.filename field.

If a filename exists or a block driver is able to reconstruct a valid
filename (which is placed in BDS.exact_filename), this can directly be
used.

If no filename can be constructed, we can still construct an options
QDict which is then converted to a JSON object and prefixed with the
"json:" pseudo protocol prefix. The QDict is placed in
BDS.full_open_options.

For most block drivers, this process can be done automatically; those
that need special handling may define a .bdrv_refresh_filename() method
to fill BDS.exact_filename and BDS.full_open_options themselves.

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


  Commit: 2c31b04c94864fda7b28321c98b904043afe3db2
      
https://github.com/qemu/qemu/commit/2c31b04c94864fda7b28321c98b904043afe3db2
  Author: Max Reitz <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M block/blkdebug.c

  Log Message:
  -----------
  blkdebug: Implement bdrv_refresh_filename()

Because blkdebug cannot simply create a configuration file, simply
refuse to reconstruct a plain filename and only generate an options
QDict from the rules instead.

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


  Commit: 74b36b2eb840c0f63d4ed2cfbfc8bb3c0d23cdd2
      
https://github.com/qemu/qemu/commit/74b36b2eb840c0f63d4ed2cfbfc8bb3c0d23cdd2
  Author: Max Reitz <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M block/blkverify.c

  Log Message:
  -----------
  blkverify: Implement bdrv_refresh_filename()

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


  Commit: 2019d68b3b4bf16228779ff50c4422c07b504824
      
https://github.com/qemu/qemu/commit/2019d68b3b4bf16228779ff50c4422c07b504824
  Author: Max Reitz <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

  Changed paths:
    M block/nbd.c

  Log Message:
  -----------
  nbd: Implement bdrv_refresh_filename()

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


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

  Changed paths:
    M block/quorum.c

  Log Message:
  -----------
  quorum: Implement bdrv_refresh_filename()

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


  Commit: 911864c6e5f58a86ac987aa4d2e5743851374c05
      
https://github.com/qemu/qemu/commit/911864c6e5f58a86ac987aa4d2e5743851374c05
  Author: Max Reitz <address@hidden>
  Date:   2014-08-20 (Wed, 20 Aug 2014)

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

  Log Message:
  -----------
  iotests: Add test for image filename construction

Testing a real in-use protocol such as NBD is hard; testing blkdebug and
blkverify in its stead is easier and tests basically the same
functionality.

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


  Commit: 13b552c2f43298a42e26d7aec7b58a5c205b75a0
      
https://github.com/qemu/qemu/commit/13b552c2f43298a42e26d7aec7b58a5c205b75a0
  Author: Michael Tokarev <address@hidden>
  Date:   2014-08-21 (Thu, 21 Aug 2014)

  Changed paths:
    M block/vvfat.c

  Log Message:
  -----------
  block/vvfat.c: remove debugging code to reinit stderr if NULL

Just log to stderr unconditionally, like other similar code does.

Signed-off-by: Michael Tokarev <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


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

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: fix memory corruption on iscsi resize

bs->total_sectors is not yet updated at this point. resulting
in memory corruption if the volume has grown and data is written
to the newly availble areas.

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


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

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  raw-posix: fix O_DIRECT short reads

The following O_DIRECT read from a <512 byte file fails:

  $ truncate -s 320 test.img
  $ qemu-io -n -c 'read -P 0 0 512' test.img
  qemu-io: can't open device test.img: Could not read image for determining its 
format: Invalid argument

Note that qemu-io completes successfully without the -n (O_DIRECT)
option.

This patch fixes qemu-iotests ./check -nocache -vmdk 059.

Cc: address@hidden
Suggested-by: Kevin Wolf <address@hidden>
Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


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

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

  Log Message:
  -----------
  qemu-iotests: add test case 101 for short file I/O

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


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

  Changed paths:
    M block/blkdebug.c

  Log Message:
  -----------
  blkdebug: Delete BH in bdrv_aio_cancel

Otherwise error_callback_bh will access the already released acb.

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


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

  Changed paths:
    M block/vmdk.c

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

Instead of bdrv_getlength().

Commit 57322b7 did this all over block, but one more bdrv_getlength()
has crept in since.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: BenoƮt Canet <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


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

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

  Log Message:
  -----------
  qemu-img: Allow source cache mode specification

Many qemu-img subcommands only read the source file(s) once. For these
use cases, a full write-back cache is unnecessary and mainly clutters
host cache memory. Though this is generally no concern as cache memory
is freely available and can be scaled by the host OS, it may become a
concern with thin provisioning.

For these cases, it makes sense to allow users to freely specify the
source cache mode (e.g. use no cache at all).

This commit adds a new switch (-T) for the qemu-img subcommands check,
compare, convert and rebase to specify the cache to be used for source
images (the backing file in case of rebase).

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


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

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

  Log Message:
  -----------
  qemu-img: Allow cache mode specification for amend

qemu-img amend may extensively modify the target image, depending on the
options to be amended (e.g. conversion to qcow2 compat level 0.10 from
1.1 for an image with many unallocated zero clusters). Therefore it
makes sense to allow the user to specify the cache mode to be used.

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


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

  Changed paths:
    M block-migration.c
    M block.c
    M block/archipelago.c
    M block/blkdebug.c
    M block/blkverify.c
    M block/bochs.c
    M block/gluster.c
    M block/iscsi.c
    M block/nbd.c
    M block/nfs.c
    M block/parallels.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/qcow2.h
    M block/qed-check.c
    M block/quorum.c
    M block/raw-posix.c
    M block/rbd.c
    M block/sheepdog.c
    M block/vdi.c
    M block/vhdx-log.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vvfat.c
    M blockdev-nbd.c
    M blockdev.c
    M hw/block/dataplane/virtio-blk.c
    M hw/block/nvme.c
    M hw/block/virtio-blk.c
    M hw/ide/ahci.c
    M hw/ide/microdrive.c
    M include/block/block.h
    M include/block/block_int.h
    M qemu-img-cmds.hx
    M qemu-img.c
    M qemu-img.texi
    M qemu-io-cmds.c
    M qemu-io.c
    M tests/image-fuzzer/runner.py
    M tests/qemu-iotests/028
    M tests/qemu-iotests/028.out
    A tests/qemu-iotests/099
    A tests/qemu-iotests/099.out
    A tests/qemu-iotests/101
    A tests/qemu-iotests/101.out
    A tests/qemu-iotests/103
    A tests/qemu-iotests/103.out
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.rc
    M tests/qemu-iotests/group
    M tests/test-coroutine.c

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

Block patches

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

* remotes/kevin/tags/for-upstream: (29 commits)
  qemu-img: Allow cache mode specification for amend
  qemu-img: Allow source cache mode specification
  vmdk: Use bdrv_nb_sectors() where sectors, not bytes are wanted
  blkdebug: Delete BH in bdrv_aio_cancel
  qemu-iotests: add test case 101 for short file I/O
  raw-posix: fix O_DIRECT short reads
  block/iscsi: fix memory corruption on iscsi resize
  block/vvfat.c: remove debugging code to reinit stderr if NULL
  iotests: Add test for image filename construction
  quorum: Implement bdrv_refresh_filename()
  nbd: Implement bdrv_refresh_filename()
  blkverify: Implement bdrv_refresh_filename()
  blkdebug: Implement bdrv_refresh_filename()
  block: Add bdrv_refresh_filename()
  virtio-blk: fix reference a pointer which might be freed
  virtio-blk: allow block_resize with dataplane
  block: acquire AioContext in qmp_block_resize()
  qemu-iotests: Fix 028 reference output for qed
  test-coroutine: test cost introduced by coroutine
  iotests: Add test for qcow2's cache options
  ...

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


Compare: https://github.com/qemu/qemu/compare/43fe62757b0b...33886ebeec0c

reply via email to

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