Skip to content

Commit

Permalink
boot-qemu.py: Quality of life improvements around virtiofs
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
nathanchance committed Dec 9, 2022
1 parent f3dcc2f commit e6e34b0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions boot-qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ def launch_qemu_fg(cfg):
cfg (dict): The configuration dictionary generated with setup_cfg().
"""
interactive = cfg["interactive"]
kernel_location = cfg["kernel_location"]
qemu_cmd = cfg["qemu_cmd"] + ["-serial", "mon:stdio"]
share_folder_with_guest = cfg["share_folder_with_guest"]
timeout = cfg["timeout"]
Expand All @@ -885,6 +886,16 @@ def launch_qemu_fg(cfg):
share_folder_with_guest = False

if share_folder_with_guest:
if not get_config_val(kernel_location, 'CONFIG_VIRTIO_FS'):
utils.yellow(
'CONFIG_VIRTIO_FS may not be enabled in your configuration, shared folder may not work...'
)

# Print information about using shared folder
utils.green('To mount shared folder in guest (e.g. to /mnt/shared):')
utils.green('\t/ # mkdir /mnt/shared')
utils.green('\t/ # mount -t virtiofs shared /mnt/shared')

shared_folder.mkdir(exist_ok=True, parents=True)

virtiofsd_log = base_folder.joinpath('.vfsd.log')
Expand Down

0 comments on commit e6e34b0

Please sign in to comment.