Project

General

Profile

Actions

Feature #14374

closed

Improve bhyve mevent EVF_VNODE monitoring

Added by Andy Fiddaman over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bhyve
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

#14081 introduced a feature allowing notification callbacks when the attributes of a file changed and this is used to inform some drivers of a size change - initially this was only available for virtio block devices but work is in progress to allow for a size change to trigger an AEN on nvme too.

When this was ported to illumos, the attribute monitoring was implemented via event ports. However, this only currently works for file-backed storage devices and not those utilising ZFS volumes, since those do not support event ports.

We should add a fallback mechanism to watch for changes in the size of a ZVOL that underlies a storage backend so that size change notifications work properly.
This will also remove the warning that is currently output by bhyve when booting a VM that uses a ZVOL.


Related issues

Related to illumos gate - Feature #14469: nvme could raise dynamic lun expansion syseventsClosedAndy Fiddaman

Actions
Related to illumos gate - Bug #14517: bhyve EVF_VNODE mevent on plain file fires on every data changeClosedAndy Fiddaman

Actions
Actions #1

Updated by Electric Monk over 2 years ago

  • Gerrit CR set to 1930
Actions #2

Updated by Andy Fiddaman over 2 years ago

I've been testing this using the existing support in bhyve to notify a guest of vioblk device size changes. Prior to this change, it only worked if the vioblk was backed by a file, but now it also works with a zvol there.

# zadm show bhyvetest disk,diskif
{
   "disk" : [
      {
         "blocksize" : "8K",
         "path" : "data/vm/bhyvetest/disk0",
         "size" : "11G",
         "sparse" : "true" 
      }
   ],
   "diskif" : "virtio" 
}

# zfs set volsize=11G data/vm/bhyvetest/disk0

and in the guest (Debian Linux)

[   97.628012] virtio_blk virtio1: [vdb] new size: 23068672 512-byte logical blocks (11.8 GB/11.0 GiB)
[   97.632698] vdb: detected capacity change from 10737418240 to 11811160064

I've also tested it along with #14372 which adds device size notification to the emulated NVMe driver.

The new tests that accompany this change exercise mevent vnode monitoring for both files and ZFS volumes, and pass.

Actions #3

Updated by Andy Fiddaman over 2 years ago

  • Related to Feature #14469: nvme could raise dynamic lun expansion sysevents added
Actions #4

Updated by Electric Monk over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 251becc882939aaf03088561add2c257a7a92424

commit  251becc882939aaf03088561add2c257a7a92424
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2022-02-07T20:51:44.000Z

    14374 Improve bhyve mevent EVF_VNODE monitoring
    Reviewed by: Patrick Mooney <pmooney@pfmooney.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions #5

Updated by Andy Fiddaman over 2 years ago

  • Related to Bug #14517: bhyve EVF_VNODE mevent on plain file fires on every data change added
Actions

Also available in: Atom PDF