Skip to content
Snippets Groups Projects
  • Denis V. Lunev's avatar
    62a6c300
    block: add missed block_acct_setup with new block device init procedure · 62a6c300
    Denis V. Lunev authored
    
    Commit 5f76a7aa 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
    
    Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
    CC: Peter Krempa <pkrempa@redhat.com>
    CC: Markus Armbruster <armbru@redhat.com>
    CC: John Snow <jsnow@redhat.com>
    CC: Kevin Wolf <kwolf@redhat.com>
    CC: Hanna Reitz <hreitz@redhat.com>
    Message-Id: <20220824095044.166009-3-den@openvz.org>
    Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    62a6c300
    History
    block: add missed block_acct_setup with new block device init procedure
    Denis V. Lunev authored
    
    Commit 5f76a7aa 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
    
    Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
    CC: Peter Krempa <pkrempa@redhat.com>
    CC: Markus Armbruster <armbru@redhat.com>
    CC: John Snow <jsnow@redhat.com>
    CC: Kevin Wolf <kwolf@redhat.com>
    CC: Hanna Reitz <hreitz@redhat.com>
    Message-Id: <20220824095044.166009-3-den@openvz.org>
    Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>