VirtIO: Make sure the guest knows the TRIM alignment requirements
If bhyve is used to emulate 512e access in guest OS, then discard addresses should be properly aligned. Otherwise ioctl DIOCGDELETE fails for 512b requires on devices with 4K sector size. see g_dev_ioctl() in sys/geom/geom_dev.c Submitted by: Vitaliy Gusev <gusev.vitaliy@gmail.com> MFC after: 1 week Sponsored by: vStack.com Differential Revision: https://reviews.freebsd.org/D27075
This commit is contained in:
parent
926da0492a
commit
cc3568c1d0
@ -523,7 +523,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
|
||||
sc->vbsc_cfg.vbc_writeback = 0;
|
||||
sc->vbsc_cfg.max_discard_sectors = VTBLK_MAX_DISCARD_SECT;
|
||||
sc->vbsc_cfg.max_discard_seg = VTBLK_MAX_DISCARD_SEG;
|
||||
sc->vbsc_cfg.discard_sector_alignment = sectsz / VTBLK_BSIZE;
|
||||
sc->vbsc_cfg.discard_sector_alignment = MAX(sectsz, sts) / VTBLK_BSIZE;
|
||||
|
||||
/*
|
||||
* Should we move some of this into virtio.c? Could
|
||||
|
Loading…
x
Reference in New Issue
Block a user