From 4a7d366ad7f2ca8ee305718642e1fca1de08bd9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Tue, 14 Apr 2026 15:46:48 -0700 Subject: [PATCH] Add KRUN_FS_ROOT_TAG define and document krun_set_root alternative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- include/libkrun.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/libkrun.h b/include/libkrun.h index cdcce4c90..651c46ea5 100644 --- a/include/libkrun.h +++ b/include/libkrun.h @@ -97,9 +97,18 @@ int32_t krun_free_ctx(uint32_t ctx_id); */ int32_t krun_set_vm_config(uint32_t ctx_id, uint8_t num_vcpus, uint32_t ram_mib); +/** + * The virtiofs tag used for the root filesystem. Can be used with krun_add_virtiofs* + * for more control over root filesystem parameters (e.g. read-only, DAX window size). + */ +#define KRUN_FS_ROOT_TAG "/dev/root" + /** * Sets the path to be use as root for the microVM. Not available in libkrun-SEV. * + * For more control over the root filesystem (e.g. read-only, DAX window size), + * use krun_add_virtiofs3() with KRUN_FS_ROOT_TAG instead. + * * Arguments: * "ctx_id" - the configuration context ID. * "root_path" - a null-terminated string representing the path to be used as root.