Skip to content

[Feature Request]: support FS DISCARD for virtio-blk #360

Open
@ihexon

Description

@ihexon

I observed that the virtio-blk device in libkrun does not support the discard command, which results in the following error when I run:

fstrim -v /mnt/vda/
fstrim: /mnt/vda/: the discard operation is not supported

In Orbstack there is no issue when I do fstrim.

I used krun_add_disk to add a sparse file (which created by truncate -s 10G ~/data1.img) as /dev/vda to the guest.

and I found that krun_add_disk does not expose discard related control parameters. In qemu, I can pass the discard=unmap like this:

<disk>
  <driver  name='qemu' type='qcow2' discard='unmap' detect_zeroes='unmap'>
  <target dev='...' bus='scsi'>
</disk>

Does libkrun's virtio-blk implementation support the DISCARD instruction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions