v86 icon indicating copy to clipboard operation
v86 copied to clipboard

Support qcow with qcow-rs

Open JoeOsborn opened this issue 2 years ago • 2 comments

The qcow-rs crate offers read-only access for qcow images. I guess this might rely on downloading the entire qcow image (or at least, downloading its pieces sequentially?), but it seems like it could be a nice feature to add to SyncFileBuffer or AsyncXHRBuffer, or an alternative to those (SyncQCOW, AsyncXHRQcow). It looks like QCOW files are divided into clusters which are compressed independently of each other, so the code wouldn't necessarily be that different from the partfile or async buffer implementations. I believe cluster sizes are between 512 bytes and 2 MB.

Is this worth investigating further? Maybe waiting on a library that implements both reading and writing of qcow images before pursuing this would make sense, but I do think that the read feature on its own could be useful for bandwidth reasons since qcow images elide empty space.

JoeOsborn avatar Aug 24 '23 21:08 JoeOsborn

I wouldn't mind a prototype, however:

  • I'm weary of taking on dependencies. Currently v86 is a simple git clone && make, and I'd like to keep it that way. This library also pulls in zstd, but v86 already includes bindings to zstd.
  • For networked files, the gains are probably fairly low. I also recently pushed support for zstd-compressed partfiles: https://github.com/copy/v86/commit/8aa33c70117a44e584dbbbb64e2fc360a62f8a29 (but this has some caveats)
  • I think for local files, read-write qcow support would indeed be useful

copy avatar Aug 25 '23 15:08 copy

I'm weary of taking on dependencies.

If you're using rust, have you considered using Cargo.toml to declare dependencies

[dependencies.dependency-repo]
git = "https://github.com/rustuser-programmer/dependency-repo"
#tag = "1.17.3" # Tag, if needed
features = ["all", "feature1", "feature2"]

That way, rust is the one that downloads and builds the relevant dependencies.

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories

ethanaobrien avatar Aug 16 '24 15:08 ethanaobrien