Page MenuHomeFreeBSD

bhyve vtblk: Inform guests of disk resize events.
ClosedPublic

Authored by jhb on May 27 2021, 1:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 15 2024, 6:44 PM
Unknown Object (File)
Oct 23 2024, 1:32 AM
Unknown Object (File)
Oct 18 2024, 5:02 AM
Unknown Object (File)
Oct 18 2024, 1:29 AM
Unknown Object (File)
Sep 24 2024, 9:30 AM
Unknown Object (File)
Sep 23 2024, 2:38 PM
Unknown Object (File)
Sep 22 2024, 11:08 AM
Unknown Object (File)
Sep 21 2024, 10:39 AM
Subscribers

Details

Summary

Register a resize callback with the blockif interface. When the
callback fires, update the size of the disk and notify the guest via a
configuration change interrupt.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jun 2 2021, 4:11 PM
grehan added inline comments.
usr.sbin/bhyve/pci_virtio_block.c
446

Does the lock need to be taken here ?

usr.sbin/bhyve/pci_virtio_block.c
446

Does the lock need to be taken here ?

I only did it to protect vbc_capacity, but if the lock isn't held when reading that field then it isn't doing much good. Hmm, I guess if we cared about the race we would need to grab the lock again in pci_vtblk_cfgread()? Maybe the race is such that we don't care? Or if cfg reads are rare, maybe it doesn't hurt to be paranoid and lock in the read?

jhb marked an inline comment as done.Jun 12 2021, 12:58 AM
jhb added inline comments.
usr.sbin/bhyve/pci_virtio_block.c
446

I've gone ahead and removed the lock.