Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • libvirt libvirt
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 164
    • Issues 164
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libvirtlibvirt
  • libvirtlibvirt
  • Issues
  • #519

Missing documentation `disk type='dir'`

Description of problem

I was looking for a way to get a folder (btrfs subvolume) from another server mounted as a disk of a KVM VM. I had little hope for this working, but when reading the documentation I found the disk type "dir", but the documentation didn't elaborate on it further. When looking through this repository I found one example (but still no documentation or elaboration neither about how or when to use it nor about how exactly it works). Also when I looked at this example I noticed that the driver name='qemu' type='fat' is currently not mentioned in the documentation at all.

Also from playing around with this example a bit, I noticed that it does only work as read-only. I was looking for a read-write alternative, but that's probably very hard to emulate...

  • Example: https://gitlab.com/libvirt/libvirt/-/blob/master/tests/qemublocktestdata/xml2json/dir-fat-cache.xml
  • Documentation: https://libvirt.org/formatdomain.html#hard-drives-floppy-disks-cdroms

Edit: Also the restriction to read-only (removing the read-only attribute throws an error when saving via virt-manager), is probably outdated (soonish), as the QEMU documentation mentions read-write being in beta. https://www.qemu.org/docs/master/system/images.html#virtual-fat-disk-images

Additional information

<disk type='dir' device='disk'>
  <driver name='qemu' type='fat' cache='directsync'/>
  <source dir='/var/somefiles'>
    <privateData>
      <nodenames>
        <nodename type='storage' name='node-s'/>
        <nodename type='format' name='node-f'/>
      </nodenames>
    </privateData>
  </source>
  <target dev='vda'/>
  <readonly/>
</disk>
Edited Aug 10, 2023 by Klaus Frank
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking