Skip to content

block: add missed block_acct_setup with new block device init procedure

Denis V. Lunev qemu-devel 5 versions – Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 4 repliesApplied
  2. v42 patches 2 repliesSuperseded
  3. v32 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v21 patch0 repliesSuperseded
v11 patch7 repliesSuperseded

Changes in v5 from the cover letter

* removed hunk to QAPI which was used to test old initialization path
* added R-b: Vladimir

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/2block: pass OnOffAuto instead of bool to block_acct_setup()block/accounting.c blockdev.c include/block/accounting.h+35 -100 replies
2/2block: add missed block_acct_setup with new block device init procedureblock/accounting.c hw/block/block.c include/hw/block/block.h +1 more+90 -30 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchVladimir Sementsov-Ogievskiy
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/2] block: add missed block_acct_setup with new block device init procedure

Commit 5f76a7aac156ca75680dad5df4a385fd0b58f6b1 is looking harmless from the first glance, but it has changed things a lot. 'libvirt' uses it to detect that it should follow new initialization way and this changes things considerably. With this procedure followed, blockdev_init() is not called anymore and thus block_acct_setup() helper is not called.

This means in particular that defaults for block accounting statistics are changed and account_invalid/account_failed are actually initialized as false instead of true originally.

This commit changes things to match original world. There are the following constraints:
* new default value in block_acct_init() is set to true
* block_acct_setup() inside blockdev_init() is called before blkconf_apply_backend_options()
* thus newly created option in block device properties has precedence if specified

Changes from v4:
* removed hunk to QAPI which was used to test old initialization path
* added R-b: Vladimir

Changes from v3:
* fixed accidentally wrong submission. Contains changes which should be sent as v3

Changes from v2:
* called bool_from_onoffauto(account_..., true) in the first patch to preserve original semantics before patch 2

Changes from v1:
* set account_invalid/account_failed to true by default
* pass OnOffAuto to block_acct_init() to handle double initialization (patch 1)
* changed properties on BLK device to OnOffAuto

CC Peter Krempa <[email protected]>
CC Markus Armbruster <[email protected]>
CC John Snow <[email protected]>
CC Kevin Wolf <[email protected]>
CC Hanna Reitz <[email protected]>
CC Vladimir Sementsov-Ogievskiy <[email protected]>