Skip to content

Commit 14adce2

Browse files
committed
boot-qemu.py: Quality of life improvements around virtiofs
1. Warn the user if CONFIG_VIRTIO_FS=y cannot be found in the configuration (or if the configuration cannot be found). 2. Print information about using the shared folder within the guest. Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 5bd3cc7 commit 14adce2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

boot-qemu.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ def launch_qemu_fg(cfg):
886886
cfg (dict): The configuration dictionary generated with setup_cfg().
887887
"""
888888
interactive = cfg["interactive"]
889+
kernel_location = cfg["kernel_location"]
889890
qemu_cmd = cfg["qemu_cmd"] + ["-serial", "mon:stdio"]
890891
share_folder_with_guest = cfg["share_folder_with_guest"]
891892
timeout = cfg["timeout"]
@@ -897,6 +898,16 @@ def launch_qemu_fg(cfg):
897898
share_folder_with_guest = False
898899

899900
if share_folder_with_guest:
901+
if not get_config_val(kernel_location, 'CONFIG_VIRTIO_FS'):
902+
utils.yellow(
903+
'CONFIG_VIRTIO_FS may not be enabled in your configuration, shared folder may not work...'
904+
)
905+
906+
# Print information about using shared folder
907+
utils.green('To mount shared folder in guest (e.g. to /mnt/shared):')
908+
utils.green('\t/ # mkdir /mnt/shared')
909+
utils.green('\t/ # mount -t virtiofs shared /mnt/shared')
910+
900911
shared_folder.mkdir(exist_ok=True, parents=True)
901912

902913
virtiofsd_log = base_folder.joinpath('.vfsd.log')

0 commit comments

Comments
 (0)