Skip to content

Add media, mount and unmount to the nanokvm command - #71

Open
antoniovazquezblanco wants to merge 1 commit into
puddly:devfrom
antoniovazquezblanco:cli-media
Open

antoniovazquezblanco wants to merge 1 commit into
puddly:devfrom
antoniovazquezblanco:cli-media

Conversation

@antoniovazquezblanco

Copy link
Copy Markdown
Contributor

'media' lists what can be mounted and marks the mounted medium. From non-Pro 2.5.3 the commands use the storage API: images go by their path in the media directory, the shared data partition is listed too and 'mount' without an image attaches it, and --force takes the disk back from a target that holds it. On older firmware and on the Pro, where the client refuses that API, they use the image API; there the command refuses the partition and --force instead of doing something else.

Device errors now print the device's reason after the code, so a refused mount says why.

'media' lists what can be mounted and marks the mounted medium. From
non-Pro 2.5.3 the commands use the storage API: images go by their path
in the media directory, the shared data partition is listed too and
'mount' without an image attaches it, and --force takes the disk back
from a target that holds it. On older firmware and on the Pro, where the
client refuses that API, they use the image API; there the command
refuses the partition and --force instead of doing something else.

Device errors now print the device's reason after the code, so a refused
mount says why.
@chiconws

Copy link
Copy Markdown
Collaborator

Tested on a Pro (application 1.2.15) and a PCIe (non-Pro 2.5.4), with small test ISOs that I uploaded and deleted afterwards.

  • non-Pro 2.5.4: media, mount IMAGE, mount IMAGE --cdrom, mount (data partition) and unmount all work. When the target held the disk, unmount printed API returned error (Code: -11): the target machine is using the medium, and unmount --force took it back. The new error message is very helpful there.
  • Pro: media, mount IMAGE and mount IMAGE --cdrom work. mount with no image and --force are refused as expected.
  • CD-ROM size: a CD-ROM image under about 600 KB fails with errno 525 from the gadget. That's the kernel's minimum size for a CD-ROM, not something the CLI should handle.

One thing on the Pro: unmount returned API returned error (Code: -3): unmount image failed in two cases. The first was with nothing mounted. The second was with a CD-ROM mounted, which then stayed mounted. The second looks like the device or the target holding the medium, and the CLI can't do anything about it. For the first case, do you want unmount to do nothing when get_mounted_image() reports nothing mounted? Either way is fine with me, and it doesn't block the merge.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants