qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 88be7b: block: Fix bdrv_next() memory leak


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 88be7b: block: Fix bdrv_next() memory leak
Date: Thu, 26 May 2016 07:30:08 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 88be7b4be4aa17c88247e162bdd7577ea79db94f
      
https://github.com/qemu/qemu/commit/88be7b4be4aa17c88247e162bdd7577ea79db94f
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/io.c
    M block/snapshot.c
    M blockdev.c
    M include/block/block.h
    M migration/block.c
    M monitor.c
    M qmp.c

  Log Message:
  -----------
  block: Fix bdrv_next() memory leak

The bdrv_next() users all leaked the BdrvNextIterator after completing
the iteration. Simply changing bdrv_next() to free the iterator before
returning NULL at the end of list doesn't work because some callers exit
the loop before looking at all BDSes.

This patch moves the BdrvNextIterator from the heap to the stack of
the caller and switches to a bdrv_first()/bdrv_next() interface for
initialising the iterator.

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


  Commit: 506f8709ceddd26542824d8cb9eac80201d085f1
      
https://github.com/qemu/qemu/commit/506f8709ceddd26542824d8cb9eac80201d085f1
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Drop useless bdrv_new() call

bdrv_append_temp_snapshot() uses bdrv_new() to create an empty BDS
before invoking bdrv_open() on that BDS. This is probably a relict from
when it used to do some modifications on that empty BDS, but now that is
unnecessary, so we can just set bs_snapshot to NULL and let bdrv_open()
do the rest.

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


  Commit: 668361898e0181c74ffc23fdecfb575a7e7c0f3c
      
https://github.com/qemu/qemu/commit/668361898e0181c74ffc23fdecfb575a7e7c0f3c
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Let bdrv_open_inherit() return the snapshot

If bdrv_open_inherit() creates a snapshot BDS and *pbs is NULL, that
snapshot BDS should be returned instead of the BDS under it.

This has worked so far because (nearly) all users of BDRV_O_SNAPSHOT use
blk_new_open() to create the BDS tree. bdrv_append() (which is called by
bdrv_append_temp_snapshot()) redirects pointers from parents (i.e. the
BB in this case) to the newly appended child (i.e. the overlay),
therefore, while bdrv_open_inherit() did not return the root BDS, the BB
still pointed to it.

The only instance where BDRV_O_SNAPSHOT is used but blk_new_open() is
not is in blockdev_init() if no BDS tree is created, and instead
blk_new() is used and the flags are stored in the BB root state.
However, qmp_blockdev_change_medium() filters the BDRV_O_SNAPSHOT flag
before invoking bdrv_open(), so it will not have any effect.

In any case, it would be nicer if bdrv_open_inherit() could just always
return the root of the BDS tree that has been created.

To this end, bdrv_append_temp_snapshot() now returns the snapshot BDS
instead of just appending it on top of the snapshotted BDS. Also, it
calls bdrv_ref() before bdrv_append() (which bdrv_open_inherit() has to
undo if not returning the overlay).

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


  Commit: 21a699afc8f6dc72e70d03efdcc2eab3f4608d65
      
https://github.com/qemu/qemu/commit/21a699afc8f6dc72e70d03efdcc2eab3f4608d65
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M tests/test-throttle.c

  Log Message:
  -----------
  tests: Drop BDS from test-throttle.c

Now that throttling has been moved to the BlockBackend level, we do not
need to create a BDS along with the BB in the I/O throttling test.

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


  Commit: 28eb9b12f7280287c7b693edd351f28ae0d99e60
      
https://github.com/qemu/qemu/commit/28eb9b12f7280287c7b693edd351f28ae0d99e60
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  block: Drop blk_new_with_bs()

Its only caller is blk_new_open(), so we can just inline it there.

The bdrv_new_root() call is dropped in the process because we can just
let bdrv_open() create the BDS.

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


  Commit: 9bddf759790cf1b9c46889f8f8370c90e6ca7610
      
https://github.com/qemu/qemu/commit/9bddf759790cf1b9c46889f8f8370c90e6ca7610
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  block: Drop bdrv_new_root()

It is unused now, so we may just as well drop it.

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


  Commit: 5b3639371c3e220b41cd2eae8c34c49ad38ef527
      
https://github.com/qemu/qemu/commit/5b3639371c3e220b41cd2eae8c34c49ad38ef527
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  block: Make bdrv_open() return a BDS

There are no callers to bdrv_open() or bdrv_open_inherit() left that
pass a pointer to a non-NULL BDS pointer as the first argument of these
functions, so we can finally drop that parameter and just make them
return the new BDS.

Generally, the following pattern is applied:

    bs = NULL;
    ret = bdrv_open(&bs, ..., &local_err);
    if (ret < 0) {
  error_propagate(errp, local_err);
  ...
    }

by

    bs = bdrv_open(..., errp);
    if (!bs) {
  ret = -EINVAL;
  ...
    }

Of course, there are only a few instances where the pattern is really
pure.

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


  Commit: 30f55fb81ff65473d673e79ca7175672e859fa2f
      
https://github.com/qemu/qemu/commit/30f55fb81ff65473d673e79ca7175672e859fa2f
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Assert !bs->refcnt in bdrv_close()

The only caller of bdrv_close() left is bdrv_delete(). We may as well
assert that, in a way (there are some things in bdrv_close() that make
more sense under that assumption, such as the call to
bdrv_release_all_dirty_bitmaps() which in turn assumes that no frozen
bitmaps are attached to the BDS).

In addition, being called only in bdrv_delete() means that we can drop
bdrv_close()'s forward declaration at the top of block.c.

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


  Commit: 6b574e09b34a10dbf8d9fb58aeaad77493826b97
      
https://github.com/qemu/qemu/commit/6b574e09b34a10dbf8d9fb58aeaad77493826b97
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Drop bdrv_parent_cb_...() from bdrv_close()

bdrv_close() now asserts that the BDS's refcount is 0, therefore it
cannot have any parents and the bdrv_parent_cb_change_media() call is a
no-op.

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


  Commit: 109525ad6a2f5d720ee0802df7ab1e3decbeeb21
      
https://github.com/qemu/qemu/commit/109525ad6a2f5d720ee0802df7ab1e3decbeeb21
  Author: Max Reitz <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/block-backend.c
    M blockdev.c
    M include/sysemu/block-backend.h
    M tests/test-throttle.c

  Log Message:
  -----------
  block: Drop errp parameter from blk_new()

blk_new() cannot fail so its Error ** parameter has become superfluous.

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


  Commit: e9740bc6d466df53efe4b8f797e99d16212799d0
      
https://github.com/qemu/qemu/commit/e9740bc6d466df53efe4b8f797e99d16212799d0
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block.c

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

This adds a common function that is called when attaching a new child to
a parent, removing a child from a parent and when reconfiguring the
graph so that an existing child points to a different node now.

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


  Commit: 6820643fdbe0d4e2ab6a188dee4782c003a4bb68
      
https://github.com/qemu/qemu/commit/6820643fdbe0d4e2ab6a188dee4782c003a4bb68
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Make bdrv_drain() use bdrv_drained_begin/end()

Until now, bdrv_drained_begin() used bdrv_drain() internally to drain
the queue. This is kind of backwards and caused quiescing code to be
duplicated because bdrv_drained_begin() had to ensure that no new
requests come in even after bdrv_drain() returns, whereas bdrv_drain()
had to have them because it could be called from other places.

Instead move the bdrv_drain() code to bdrv_drained_begin() and make
bdrv_drain() a simple wrapper around bdrv_drained_begin/end().

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


  Commit: 36fe13317bfc3414745528c6c08cea2904ca49ec
      
https://github.com/qemu/qemu/commit/36fe13317bfc3414745528c6c08cea2904ca49ec
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  block: Fix reconfiguring graph with drained nodes

When changing the BlockDriverState that a BdrvChild points to while the
node is currently drained, we must call the .drained_end() parent
callback. Conversely, when this means attaching a new node that is
already drained, we need to call .drained_begin().

bdrv_root_attach_child() takes now an opaque parameter, which is needed
because the callbacks must also be called if we're attaching a new child
to the BlockBackend when the root node is already drained, and they need
a way to identify the BlockBackend. Previously, child->opaque was set
too late and the callbacks would still see it as NULL.

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


  Commit: 20018e12cfde4847a0e90f0f9942804c20c14894
      
https://github.com/qemu/qemu/commit/20018e12cfde4847a0e90f0f9942804c20c14894
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Propagate .drained_begin/end callbacks

When draining intermediate nodes (i.e. nodes that aren't the root node
for at least one of their parents; with node references, the user can
always configure the graph to create this situation), we need to
propagate the .drained_begin/end callbacks all the way up to the root
for the drain to be effective.

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


  Commit: cbe0ed6247a0589e4f72b25984b8afcfa9c26b1c
      
https://github.com/qemu/qemu/commit/cbe0ed6247a0589e4f72b25984b8afcfa9c26b1c
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M dma-helpers.c
    M hw/block/nvme.c
    M hw/ide/ahci.c
    M hw/ide/core.c
    M hw/scsi/scsi-disk.c
    M include/sysemu/dma.h
    M trace-events

  Log Message:
  -----------
  dma-helpers: change interface to byte-based

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


  Commit: 8a8e63ebdd5a6605af6a9df07c62b2214e1a650c
      
https://github.com/qemu/qemu/commit/8a8e63ebdd5a6605af6a9df07c62b2214e1a650c
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M dma-helpers.c
    M hw/ide/core.c
    M hw/ide/internal.h
    M hw/ide/macio.c
    M include/sysemu/dma.h

  Log Message:
  -----------
  dma-helpers: change BlockBackend to opaque value in DMAIOFunc

Callers of dma_blk_io have no way to pass extra data to the DMAIOFunc,
because the original callback and opaque are gone by the time DMAIOFunc
is called.  On the other hand, the BlockBackend is usually derived
from those extra data that you could pass to the DMAIOFunc (in the
next patch, that would be the SCSIRequest).

So change DMAIOFunc's prototype, decoupling it from blk_aio_readv
and blk_aio_writev's.  The new prototype loses the BlockBackend
and gains an extra opaque value which, in the case of dma_blk_readv
and dma_blk_writev, is of course used for the BlockBackend.

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


  Commit: d004bd52aacbe9bf43c38fa6cb20a6f241ac64be
      
https://github.com/qemu/qemu/commit/d004bd52aacbe9bf43c38fa6cb20a6f241ac64be
  Author: Eric Blake <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/block-backend.c
    M block/parallels.c
    M hw/scsi/scsi-disk.c
    M include/sysemu/block-backend.h
    M qemu-img.c
    M qemu-io-cmds.c

  Log Message:
  -----------
  block: Rename blk_write_zeroes()

Commit 983a1600 changed the semantics of blk_write_zeroes() to
be byte-based rather than sector-based, but did not change the
name, which is an open invitation for other code to misuse the
function.  Renaming to pwrite_zeroes() makes it more in line
with other byte-based interfaces, and will help make it easier
to track which remaining write_zeroes interfaces still need
conversion.

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


  Commit: a7112795c14d99b81600f8809fda5ce18b430830
      
https://github.com/qemu/qemu/commit/a7112795c14d99b81600f8809fda5ce18b430830
  Author: Alberto Garcia <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  block: keep a list of block jobs

The current way to obtain the list of existing block jobs is to
iterate over all root nodes and check which ones own a job.

Since we want to be able to support block jobs in other nodes as well,
this patch keeps a list of jobs that is updated every time one is
created or destroyed.

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


  Commit: a1a2af075647bb61e1435ce4c78d99e3f36d928b
      
https://github.com/qemu/qemu/commit/a1a2af075647bb61e1435ce4c78d99e3f36d928b
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  block: Cancel jobs first in bdrv_close_all()

So far, bdrv_close_all() first removed all root BlockDriverStates of
BlockBackends and monitor owned BDSes, and then assumed that the
remaining BDSes must be related to jobs and cancelled these jobs.

This order doesn't work that well any more when block jobs use
BlockBackends internally because then they will lose their BDS before
being cancelled.

This patch changes bdrv_close_all() to first cancel all jobs and then
remove all root BDSes from the remaining BBs.

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


  Commit: 0c3169dffa68fcdc71ad42e9a60faa4778de0397
      
https://github.com/qemu/qemu/commit/0c3169dffa68fcdc71ad42e9a60faa4778de0397
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/block-backend.c

  Log Message:
  -----------
  block: Default to enabled write cache in blk_new()

The existing users of the function are:

1. blk_new_open(), which already enabled the write cache
2. Some test cases that don't care about the setting
3. blockdev_init() for empty drives, where the cache mode is overridden
   with the value from the options when a medium is inserted

Therefore, this patch doesn't change the current behaviour. It will be
convenient, however, for additional users of blk_new() (like block
jobs) if the most sensible WCE setting is the default.

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


  Commit: b6d2e59995fa82c7fe469d47dfc22cf9bf2f8a5e
      
https://github.com/qemu/qemu/commit/b6d2e59995fa82c7fe469d47dfc22cf9bf2f8a5e
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  block: Convert block job core to BlockBackend

This adds a new BlockBackend field to the BlockJob struct, which
coexists with the BlockDriverState while converting the individual jobs.

When creating a block job, a new BlockBackend is created on top of the
given BlockDriverState, and it is destroyed when the BlockJob ends. The
reference to the BDS is now held by the BlockBackend instead of calling
bdrv_ref/unref manually.

We have to be careful when we use bdrv_replace_in_backing_chain() in
block jobs because this changes the BDS that job->blk points to. At the
moment block jobs are too tightly coupled with their BDS, so that moving
a job to another BDS isn't easily possible; therefore, we need to just
manually undo this change afterwards.

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


  Commit: 1e98fefd95ff604b48fe3ea71825449c187a7dd7
      
https://github.com/qemu/qemu/commit/1e98fefd95ff604b48fe3ea71825449c187a7dd7
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  block: Make blk_co_preadv/pwritev() public

Also add trace points now that the function can be directly called.

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


  Commit: 03e35d820d18f23606b4cc821a36cda1f7936170
      
https://github.com/qemu/qemu/commit/03e35d820d18f23606b4cc821a36cda1f7936170
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/io.c
    M block/stream.c
    M include/block/block.h
    M trace-events

  Log Message:
  -----------
  stream: Use BlockBackend for I/O

This changes the streaming block job to use the job's BlockBackend for
performing the COR reads. job->bs isn't used by the streaming code any
more afterwards.

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


  Commit: b8804815799eb8e924f015de6d1710cbd5b932ee
      
https://github.com/qemu/qemu/commit/b8804815799eb8e924f015de6d1710cbd5b932ee
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/mirror.c
    M blockdev.c
    M tests/qemu-iotests/041
    M tests/qemu-iotests/041.out

  Log Message:
  -----------
  mirror: Allow target that already has a BlockBackend

We had to forbid mirroring to a target BDS that already had a BB
attached because the node swapping at job completion would add a second
BB and we didn't support multiple BBs on a single BDS at the time. Now
we do, so we can lift the restriction.

As we allow additional BlockBackends for the target, we must expect
other users to be sending requests. There may no requests be in flight
during the graph modification, so we have to drain those users now.

The core part of this patch is a revert of commit 40365552.

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


  Commit: e253f4b89796967d03a455d1df2ae6bda8cc7d01
      
https://github.com/qemu/qemu/commit/e253f4b89796967d03a455d1df2ae6bda8cc7d01
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

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

  Log Message:
  -----------
  mirror: Use BlockBackend for I/O

This changes the mirror block job to use the job's BlockBackend for
performing its I/O. job->bs isn't used by the mirroring code any more
afterwards.

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


  Commit: 91ab68837933232bcef99da7c968e6d41900419b
      
https://github.com/qemu/qemu/commit/91ab68837933232bcef99da7c968e6d41900419b
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/backup.c

  Log Message:
  -----------
  backup: Don't leak BackupBlockJob in error path

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


  Commit: 12b3e52e4875ca018e033c66f1825437a005c239
      
https://github.com/qemu/qemu/commit/12b3e52e4875ca018e033c66f1825437a005c239
  Author: John Snow <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/backup.c

  Log Message:
  -----------
  backup: Pack Notifier within BackupBlockJob

Instead of relying on peeking at bs->job, we want to explicitly get
a reference to the job that was involved in this notifier callback.

Pack the Notifier inside of the BackupBlockJob so we can use
container_of to get a reference back to the BackupBlockJob object.

This cuts out one more case where we rely unnecessarily on bs->job.

Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 8543c274141ade048c6a6070a095761a65acbb82
      
https://github.com/qemu/qemu/commit/8543c274141ade048c6a6070a095761a65acbb82
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/backup.c

  Log Message:
  -----------
  backup: Remove bs parameter from backup_do_cow()

Now that we pass the job to the function, bs is implied by that.

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


  Commit: 5c438bc68c5dd9671c234eb86ebf026b016b6e35
      
https://github.com/qemu/qemu/commit/5c438bc68c5dd9671c234eb86ebf026b016b6e35
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/backup.c
    M block/io.c
    M blockdev.c
    M include/block/block.h
    M trace-events

  Log Message:
  -----------
  backup: Use BlockBackend for I/O

This changes the backup block job to use the job's BlockBackend for
performing its I/O. job->bs isn't used by the backup code any more
afterwards.

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


  Commit: 4653456a5f60cbedaa0d4638252967e2248c570b
      
https://github.com/qemu/qemu/commit/4653456a5f60cbedaa0d4638252967e2248c570b
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M block/commit.c

  Log Message:
  -----------
  commit: Use BlockBackend for I/O

This changes the commit block job to use the job's BlockBackend for
performing its I/O. job->bs isn't used by the commit code any more
afterwards.

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


  Commit: b75536c9fa742f887304769d0608557bb8e3a27f
      
https://github.com/qemu/qemu/commit/b75536c9fa742f887304769d0608557bb8e3a27f
  Author: Kevin Wolf <address@hidden>
  Date:   2016-05-25 (Wed, 25 May 2016)

  Changed paths:
    M blockjob.c
    M include/block/blockjob.h
    M qemu-img.c
    M tests/test-blockjob-txn.c

  Log Message:
  -----------
  blockjob: Remove BlockJob.bs

There is a single remaining user in qemu-img, and another one in a test
case, both of which can be trivially converted to using BlockJob.blk
instead.

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


  Commit: 2c56d06bafd8933d2a9c6e0aeb5d45f7c1fb5616
      
https://github.com/qemu/qemu/commit/2c56d06bafd8933d2a9c6e0aeb5d45f7c1fb5616
  Author: Peter Maydell <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M block.c
    M block/backup.c
    M block/block-backend.c
    M block/commit.c
    M block/io.c
    M block/mirror.c
    M block/parallels.c
    M block/snapshot.c
    M block/stream.c
    M block/vvfat.c
    M blockdev.c
    M blockjob.c
    M dma-helpers.c
    M hw/block/nvme.c
    M hw/ide/ahci.c
    M hw/ide/core.c
    M hw/ide/internal.h
    M hw/ide/macio.c
    M hw/scsi/scsi-disk.c
    M include/block/block.h
    M include/block/block_int.h
    M include/block/blockjob.h
    M include/sysemu/block-backend.h
    M include/sysemu/dma.h
    M migration/block.c
    M monitor.c
    M qemu-img.c
    M qemu-io-cmds.c
    M qmp.c
    M tests/qemu-iotests/041
    M tests/qemu-iotests/041.out
    M tests/test-blockjob-txn.c
    M tests/test-throttle.c
    M trace-events

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

Block layer patches

# gpg: Signature made Wed 25 May 2016 18:32:40 BST using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"

* remotes/kevin/tags/for-upstream: (31 commits)
  blockjob: Remove BlockJob.bs
  commit: Use BlockBackend for I/O
  backup: Use BlockBackend for I/O
  backup: Remove bs parameter from backup_do_cow()
  backup: Pack Notifier within BackupBlockJob
  backup: Don't leak BackupBlockJob in error path
  mirror: Use BlockBackend for I/O
  mirror: Allow target that already has a BlockBackend
  stream: Use BlockBackend for I/O
  block: Make blk_co_preadv/pwritev() public
  block: Convert block job core to BlockBackend
  block: Default to enabled write cache in blk_new()
  block: Cancel jobs first in bdrv_close_all()
  block: keep a list of block jobs
  block: Rename blk_write_zeroes()
  dma-helpers: change BlockBackend to opaque value in DMAIOFunc
  dma-helpers: change interface to byte-based
  block: Propagate .drained_begin/end callbacks
  block: Fix reconfiguring graph with drained nodes
  block: Make bdrv_drain() use bdrv_drained_begin/end()
  ...

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


Compare: https://github.com/qemu/qemu/compare/a62c89117fa1...2c56d06bafd8

reply via email to

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