Compact: check free space before starting

Open Beginner friendly
#80 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
electron, node.js, typescript
Domain
backend, desktop

Research direction

Find the Compact implementation and the code that reads actualBytes from qemu-img info; those entry points are not named in the issue. Read how the temp disk file and its target drive are determined, then check available space with Node's fs.statfs before starting qemu-img convert. Done means insufficient space is reported immediately with the requested drive and size details, while enough space allows compaction to proceed.

Written by the indexing model from the issue text.

Description

backend enhancement

Compact (#74) writes a full new copy of the used part of the disk next to the old one before swapping. On a nearly full drive, qemu-img convert runs for minutes and then fails with a write error, and only then is the temp file cleaned up.

The size we need is known up front (actualBytes from qemu-img info). Check the free space on the disk's drive first and refuse right away with "Compacting needs about X GB free on D:, there's Y GB".

Node has fs.statfs for the free space.

Dominant language
TypeScript
Stars
3
Forks
0
Avg merge
2m
Merged PRs (30d)
59

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from A21-devs/Virtual-Machine-Manager

All issues in A21-devs/Virtual-Machine-Manager

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.