Page MenuHomeFreeBSD

bhyve: [snapshot] Do not flush readonly device at blockif_pause()
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Mar 2 2023, 6:08 PM.
Tags
Referenced Files
F174334094: D38855.diff
Fri, Oct 2, 11:51 AM
Unknown Object (File)
Sat, Sep 26, 6:49 PM
Unknown Object (File)
Thu, Sep 24, 1:20 PM
Unknown Object (File)
Tue, Sep 22, 12:15 AM
Unknown Object (File)
Sat, Sep 19, 4:41 PM
Unknown Object (File)
Fri, Sep 18, 6:59 PM
Unknown Object (File)
Wed, Sep 16, 3:30 AM
Unknown Object (File)
Wed, Sep 16, 12:02 AM

Details

Summary

Part of Capsicum integration for snapshots.

Eliminates error:

blockif_pause: [WARN] failed to flush backing file.

Sponsored by: vStack

Test Plan

Compile, run VM, suspend/resume.

Diff Detail

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

Event Timeline

markj added inline comments.
usr.sbin/bhyve/block_if.c
1012

BTW, the BOP_FLUSH handler does not check whether the device is read-only before calling blockif_flush_bc(). Perhaps it should be a no-op in that situation?

This revision is now accepted and ready to land.Mar 2 2023, 9:55 PM
gusev.vitaliy_gmail.com added inline comments.
usr.sbin/bhyve/block_if.c
1012

BOP_FLUSH() is called when emulated device directly calls blockif_flush(). Look at ahci_handle_flush() and nvme_opc_flush()) or pci_vtblk_proc().
In all cases it is just handle of guest's requests. So guest is aware about readonly device and shouldn't call flush commands.