Skip to content

Commit 62e71f4

Browse files
d-e-s-omtjhrc
authored andcommitted
Add KRUN_FS_ROOT_TAG define and document krun_set_root alternative
Expose the virtiofs tag we use internally to krun_set_root() so that users are able to use it with APIs such as krun_add_virtiofs3() (recently added via #623). This way, they can gain control over the read-only state of the root file system (among other properties) without having to guess the tag to use. Signed-off-by: Daniel Müller <[email protected]>
1 parent aed6f76 commit 62e71f4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

include/libkrun.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,18 @@ int32_t krun_free_ctx(uint32_t ctx_id);
9797
*/
9898
int32_t krun_set_vm_config(uint32_t ctx_id, uint8_t num_vcpus, uint32_t ram_mib);
9999

100+
/**
101+
* The virtiofs tag used for the root filesystem. Can be used with krun_add_virtiofs*
102+
* for more control over root filesystem parameters (e.g. read-only, DAX window size).
103+
*/
104+
#define KRUN_FS_ROOT_TAG "/dev/root"
105+
100106
/**
101107
* Sets the path to be use as root for the microVM. Not available in libkrun-SEV.
102108
*
109+
* For more control over the root filesystem (e.g. read-only, DAX window size),
110+
* use krun_add_virtiofs3() with KRUN_FS_ROOT_TAG instead.
111+
*
103112
* Arguments:
104113
* "ctx_id" - the configuration context ID.
105114
* "root_path" - a null-terminated string representing the path to be used as root.

0 commit comments

Comments
 (0)