Repository navigation
Conversation
The VM configuration file can only configure the root virtiofs export. Add a "virtiofs" array whose entries give a tag, a path inside the container, and a DAX shm_size, and add each one with krun_add_virtiofs2() after the root export, in array order. crun checks only that each entry has the expected JSON types and a positive shm_size. Tag length and uniqueness are left to libkrun. Signed-off-by: Joseph Kogut <joseph@anodize.com>
Let the container creator add virtiofs devices through the krun.virtiofs annotation, a JSON array in the same format as the "virtiofs" field of .krun_vm.json. Unlike the other krun annotations, this one does not override the configuration file. The image and the container creator can each supply devices, so both lists are added: first the devices from .krun_vm.json, then the devices from the annotation. Signed-off-by: Joseph Kogut <joseph@anodize.com>
0a9ee92 to
69ec09b
Compare
|
@slp PTAL |
|
@slp can this open security holes given the file is coming from an untrusted source? |
The virtio-fs in libkrun can only access filesystems within the container mount namespace. This only allows exposing things such as the container's The problem here is managing user's expectations. The krun handler was always intended to provide a context as close as possible as the container context, but while running inside a VM. But then, it's clear some users have different expectations, and could imaging some people not liking the idea of the guest having visibility of the container's I guess the safest approach would be only supporting this as annotations, which are exclusively controlled by the host owner. |
Add configuration for additional virtiofs devices through
.krun_vm.jsonas well as the annotationkrun.virtiofs. This can be useful for mappingdevshmfrom the host (useful for shared memory backing, such as the mechanism muvm-bridge uses to export X11 shared memory fences), as well as other filesystems and directories.