Skip to content

Conversation

@MusicDin
Copy link
Member

@MusicDin MusicDin commented Aug 5, 2024

Prevents conversion from OVA file format. On the server side we check whether the file is a tarball when the file is uploaded.

To prevent file from being uploaded in the first place, we also use the same check in lxd-migrate.

An OVA (Open Virtualization Appliance) file is not a virtual disk format like VMDK and QCOW2.
Instead, it is an archive format used for distributing virtual appliances.

Since qemu-img info detects it as raw image format, we cannot use that to detect OVA files.
Instead we need to check whether the uploaded file is a tar archive (contains a tar header).

Note that we need to reset the file's read pointer after the file is uploaded and also open
file with read permission (in addition to already requested write permission).

Signed-off-by: Din Music <[email protected]>
@MusicDin MusicDin force-pushed the fix/conversion-ova branch from 98f4798 to 5befe3d Compare August 5, 2024 17:18
@MusicDin MusicDin marked this pull request as ready for review August 5, 2024 19:53
@MusicDin MusicDin requested a review from tomponline August 5, 2024 19:54
@tomponline tomponline merged commit c1e264d into canonical:main Aug 5, 2024
@MusicDin MusicDin deleted the fix/conversion-ova branch August 5, 2024 20:05
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