qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 5a612c: block: pass bdrv_* methods to bs->fil


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 5a612c: block: pass bdrv_* methods to bs->file by default ...
Date: Thu, 07 Sep 2017 03:50:08 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 5a612c009ee538a3b32c896f9a6c5562a50efe9d
      
https://github.com/qemu/qemu/commit/5a612c009ee538a3b32c896f9a6c5562a50efe9d
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

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

  Log Message:
  -----------
  block: pass bdrv_* methods to bs->file by default in block filters

The following functions fail if bs->drv is a filter and does not
implement them:

bdrv_probe_blocksizes
bdrv_probe_geometry
bdrv_truncate
bdrv_has_zero_init
bdrv_get_info

Instead, the call should be passed to bs->file if it exists, to allow
filter drivers to support those methods without implementing them. This
commit makes `drv->is_filter = true` imply that these callbacks will be
forwarded to bs->file by default, so disabling support for these
functions must be done explicitly.

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


  Commit: f024aee8673676712f7622e814f27b0f7d5bffd5
      
https://github.com/qemu/qemu/commit/f024aee8673676712f7622e814f27b0f7d5bffd5
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

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

  Log Message:
  -----------
  block: remove unused bdrv_media_changed

This function is not used anywhere, so remove it.

Markus Armbruster adds:
The i82078 floppy device model used to call bdrv_media_changed() to
implement its media change bit when backed by a host floppy.  This
went away in 21fcf36 "fdc: simplify media change handling".
Probably broke host floppy media change.  Host floppy pass-through
was dropped in commit f709623.  bdrv_media_changed() has never been
used for anything else.  Remove it.
(Source is Message-ID: <address@hidden>)

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


  Commit: d8e12cd3227f0cb3b5558563f094088cfefb8f21
      
https://github.com/qemu/qemu/commit/d8e12cd3227f0cb3b5558563f094088cfefb8f21
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

  Changed paths:
    M block/blkdebug.c

  Log Message:
  -----------
  block: remove bdrv_truncate callback in blkdebug

Now that bdrv_truncate is passed to bs->file by default, remove the
callback from block/blkdebug.c and set is_filter to true. is_filter also gives
access to other callbacks that are forwarded automatically to bs->file for
filters.

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


  Commit: f7cc69b326850c34db5dca2f9f74898cd181f43a
      
https://github.com/qemu/qemu/commit/f7cc69b326850c34db5dca2f9f74898cd181f43a
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

  Changed paths:
    M block/blkdebug.c
    M block/commit.c
    M block/io.c
    M block/mirror.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: add default implementations for bdrv_co_get_block_status()

bdrv_co_get_block_status_from_file() and
bdrv_co_get_block_status_from_backing() set *file to bs->file and
bs->backing respectively, so that bdrv_co_get_block_status() can recurse
to them. Future block drivers won't have to duplicate code to implement
this.

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


  Commit: 56439e9d55626b65ecb887f1ac3714652555312e
      
https://github.com/qemu/qemu/commit/56439e9d55626b65ecb887f1ac3714652555312e
  Author: Eric Blake <address@hidden>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

  Changed paths:
    M block/qcow.c

  Log Message:
  -----------
  qcow: Change signature of get_cluster_offset()

The old signature has an ambiguous meaning for a return of 0:
either no allocation was requested or necessary, or an error
occurred (but any errno associated with the error is lost to
the caller, which then has to assume EIO).

Better is to follow the example of qcow2, by changing the
signature to have a separate return value that cleanly
distinguishes between failure and success, along with a
parameter that cleanly holds a 64-bit value.  Then update all
callers.

While auditing that all return paths return a negative errno
(rather than -1), I also simplified places where we can pass
NULL rather than a local Error that just gets thrown away.

Suggested-by: Kevin Wolf <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: d7a753a148d4738eef95a3b193b081a9c905399f
      
https://github.com/qemu/qemu/commit/d7a753a148d4738eef95a3b193b081a9c905399f
  Author: Eric Blake <address@hidden>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

  Changed paths:
    M block/qcow.c

  Log Message:
  -----------
  qcow: Check failure of bdrv_getlength() and bdrv_truncate()

Omitting the check for whether bdrv_getlength() and bdrv_truncate()
failed meant that it was theoretically possible to return an
incorrect offset to the caller.  More likely, conditions for either
of these functions to fail would also cause one of our other calls
(such as bdrv_pread() or bdrv_pwrite_sync()) to also fail, but
auditing that we are safe is difficult compared to just patching
things to always forward on the error rather than ignoring it.

Use osdep.h macros instead of open-coded rounding while in the
area.

Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 64182a6b8bc78a4a11902fc0c019b2092e9a9d28
      
https://github.com/qemu/qemu/commit/64182a6b8bc78a4a11902fc0c019b2092e9a9d28
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-09-05 (Tue, 05 Sep 2017)

  Changed paths:
    M include/block/block_int.h

  Log Message:
  -----------
  block: document semantics of bdrv_co_preadv|pwritev

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


  Commit: 022cdc9f407434ad6eb7ace80362a1218a009bcc
      
https://github.com/qemu/qemu/commit/022cdc9f407434ad6eb7ace80362a1218a009bcc
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-05 (Tue, 05 Sep 2017)

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

  Log Message:
  -----------
  block: move ThrottleGroup membership to ThrottleGroupMember

This commit eliminates the 1:1 relationship between BlockBackend and
throttle group state.  Users will be able to create multiple throttle
nodes, each with its own throttle group state, in the future.  The
throttle group state cannot be per-BlockBackend anymore, it must be
per-throttle node. This is done by gathering ThrottleGroup membership
details from BlockBackendPublic into ThrottleGroupMember and refactoring
existing code to use the structure.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Manos Pitsidianakis <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: c61791fc23ecd96e6a1e038c379c4033ffd5f40c
      
https://github.com/qemu/qemu/commit/c61791fc23ecd96e6a1e038c379c4033ffd5f40c
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-05 (Tue, 05 Sep 2017)

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

  Log Message:
  -----------
  block: add aio_context field in ThrottleGroupMember

timer_cb() needs to know about the current Aio context of the throttle
request that is woken up. In order to make ThrottleGroupMember backend
agnostic, this information is stored in an aio_context field instead of
accessing it from BlockBackend.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Manos Pitsidianakis <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: f738cfc843055238ad969782db69156929873832
      
https://github.com/qemu/qemu/commit/f738cfc843055238ad969782db69156929873832
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-05 (Tue, 05 Sep 2017)

  Changed paths:
    M block/block-backend.c
    M block/throttle-groups.c

  Log Message:
  -----------
  block: tidy ThrottleGroupMember initializations

Move the CoMutex and CoQueue inits inside throttle_group_register_tgm()
which is called whenever a ThrottleGroupMember is initialized. There's
no need for them to be separate.

Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Manos Pitsidianakis <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 432d889e55e2614bd0e8bb559af18a61ac217565
      
https://github.com/qemu/qemu/commit/432d889e55e2614bd0e8bb559af18a61ac217565
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-05 (Tue, 05 Sep 2017)

  Changed paths:
    M block/throttle-groups.c
    M include/block/throttle-groups.h
    M include/qemu/throttle-options.h
    M include/qemu/throttle.h
    M qapi/block-core.json
    M tests/test-throttle.c
    M util/throttle.c

  Log Message:
  -----------
  block: convert ThrottleGroup to object with QOM

ThrottleGroup is converted to an object. This will allow the future
throttle block filter drive easy creation and configuration of throttle
groups in QMP and cli.

A new QAPI struct, ThrottleLimits, is introduced to provide a shared
struct for all throttle configuration needs in QMP.

ThrottleGroups can be created via CLI as
    -object throttle-group,id=foo,x-iops-total=100,x-..
where x-* are individual limit properties. Since we can't add non-scalar
properties in -object this interface must be used instead. However,
setting these properties must be disabled after initialization because
certain combinations of limits are forbidden and thus configuration
changes should be done in one transaction. The individual properties
will go away when support for non-scalar values in CLI is implemented
and thus are marked as experimental.

ThrottleGroup also has a `limits` property that uses the ThrottleLimits
struct.  It can be used to create ThrottleGroups or set the
configuration in existing groups as follows:

{ "execute": "object-add",
  "arguments": {
    "qom-type": "throttle-group",
    "id": "foo",
    "props" : {
      "limits": {
    "iops-total": 100
      }
    }
  }
}
{ "execute" : "qom-set",
    "arguments" : {
  "path" : "foo",
  "property" : "limits",
  "value" : {
      "iops-total" : 99
  }
    }
}

This also means a group's configuration can be fetched with qom-get.

Signed-off-by: Manos Pitsidianakis <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: d8e7d87ec49c1458f516d50d109b3f201da736a1
      
https://github.com/qemu/qemu/commit/d8e7d87ec49c1458f516d50d109b3f201da736a1
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-06 (Wed, 06 Sep 2017)

  Changed paths:
    M block/Makefile.objs
    M block/throttle-groups.c
    A block/throttle.c
    M include/block/throttle-groups.h
    M include/qemu/throttle-options.h
    M qapi/block-core.json

  Log Message:
  -----------
  block: add throttle block filter driver

block/throttle.c uses existing I/O throttle infrastructure inside a
block filter driver. I/O operations are intercepted in the filter's
read/write coroutines, and referred to block/throttle-groups.c

The driver can be used with the syntax
-drive driver=throttle,file.filename=foo.qcow2,throttle-group=bar

which registers the throttle filter node with the ThrottleGroup 'bar'. The
given group must be created beforehand with object-add or -object.

Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Manos Pitsidianakis <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 1e13e2015bfd23fc2a31dcc23ebe208a4d7fc701
      
https://github.com/qemu/qemu/commit/1e13e2015bfd23fc2a31dcc23ebe208a4d7fc701
  Author: Manos Pitsidianakis <address@hidden>
  Date:   2017-09-06 (Wed, 06 Sep 2017)

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

  Log Message:
  -----------
  qemu-iotests: add 184 for throttle filter driver

Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Manos Pitsidianakis <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 83a8c775a8bf134eb18a719322939b74a818d750
      
https://github.com/qemu/qemu/commit/83a8c775a8bf134eb18a719322939b74a818d750
  Author: Pavel Butsykin <address@hidden>
  Date:   2017-09-06 (Wed, 06 Sep 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing

After calling qcow2_inactivate(), all qcow2 caches must be flushed, but this
may not happen, because the last call qcow2_store_persistent_dirty_bitmaps()
can lead to marking l2/refcont cache as dirty.

Let's move qcow2_store_persistent_dirty_bitmaps() before the caсhe flushing
to fix it.

Cc: address@hidden
Signed-off-by: Pavel Butsykin <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 8ee5f9b3ecc94e3eb7a8235f4b2c3ec9024807f6
      
https://github.com/qemu/qemu/commit/8ee5f9b3ecc94e3eb7a8235f4b2c3ec9024807f6
  Author: Peter Maydell <address@hidden>
  Date:   2017-09-07 (Thu, 07 Sep 2017)

  Changed paths:
    M block.c
    M block/Makefile.objs
    M block/blkdebug.c
    M block/block-backend.c
    M block/commit.c
    M block/io.c
    M block/mirror.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M block/raw-format.c
    M block/throttle-groups.c
    A block/throttle.c
    M blockdev.c
    M include/block/block.h
    M include/block/block_int.h
    M include/block/throttle-groups.h
    M include/qemu/throttle-options.h
    M include/qemu/throttle.h
    M include/sysemu/block-backend.h
    M qapi/block-core.json
    A tests/qemu-iotests/184
    A tests/qemu-iotests/184.out
    M tests/qemu-iotests/group
    M tests/test-throttle.c
    M util/throttle.c

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

Block layer patches

# gpg: Signature made Wed 06 Sep 2017 14:44:41 BST
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing
  qemu-iotests: add 184 for throttle filter driver
  block: add throttle block filter driver
  block: convert ThrottleGroup to object with QOM
  block: tidy ThrottleGroupMember initializations
  block: add aio_context field in ThrottleGroupMember
  block: move ThrottleGroup membership to ThrottleGroupMember
  block: document semantics of bdrv_co_preadv|pwritev
  qcow: Check failure of bdrv_getlength() and bdrv_truncate()
  qcow: Change signature of get_cluster_offset()
  block: add default implementations for bdrv_co_get_block_status()
  block: remove bdrv_truncate callback in blkdebug
  block: remove unused bdrv_media_changed
  block: pass bdrv_* methods to bs->file by default in block filters

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


Compare: https://github.com/qemu/qemu/compare/8c6a76cd2397...8ee5f9b3ecc9

reply via email to

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