Skip to content

Commit e6e34b0

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 f3dcc2f commit e6e34b0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

boot-qemu.py

+11
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ def launch_qemu_fg(cfg):
874874
cfg (dict): The configuration dictionary generated with setup_cfg().
875875
"""
876876
interactive = cfg["interactive"]
877+
kernel_location = cfg["kernel_location"]
877878
qemu_cmd = cfg["qemu_cmd"] + ["-serial", "mon:stdio"]
878879
share_folder_with_guest = cfg["share_folder_with_guest"]
879880
timeout = cfg["timeout"]
@@ -885,6 +886,16 @@ def launch_qemu_fg(cfg):
885886
share_folder_with_guest = False
886887

887888
if share_folder_with_guest:
889+
if not get_config_val(kernel_location, 'CONFIG_VIRTIO_FS'):
890+
utils.yellow(
891+
'CONFIG_VIRTIO_FS may not be enabled in your configuration, shared folder may not work...'
892+
)
893+
894+
# Print information about using shared folder
895+
utils.green('To mount shared folder in guest (e.g. to /mnt/shared):')
896+
utils.green('\t/ # mkdir /mnt/shared')
897+
utils.green('\t/ # mount -t virtiofs shared /mnt/shared')
898+
888899
shared_folder.mkdir(exist_ok=True, parents=True)
889900

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

0 commit comments

Comments
 (0)