8000 Add Discard (TRIM) option and NVME storage controller by chotaire · Pull Request #186 · phpvirtualbox/phpvirtualbox · GitHub
[go: up one dir, main page]

Skip to content

Add Discard (TRIM) option and NVME storage controller#186

Merged
h6w merged 6 commits intophpvirtualbox:developfrom
chotaire:chot-discard-nvme
Sep 8, 2019
Merged

Add Discard (TRIM) option and NVME storage controller#186
h6w merged 6 commits intophpvirtualbox:developfrom
chotaire:chot-discard-nvme

Conversation

@chotaire
Copy link
Contributor
@chotaire chotaire commented Sep 7, 2019

This pull request adds NVME as available storage controller and the ability to select Discard (TRIM). Discard requires a VDI to be set as non-rotational (SSD). This will allow a VDI to shrink on the host if trim has been issued inside the guest. This would finally make an end to using zerofree, sdelete or dd to fill up the disk with zeroes before shutting down the VM and using vboxmanage modifymedium diskname.vdi --compact - which is a task that drives people away from VirtualBox.

Coded by @pasha1st - his pull request #167 got legitimately rejected due to several issues so I am lending a helping hand and split this into multiple pull requests. This needs tested and finally merged, we need to move forward.

@chotaire chotaire changed the title Added Discard (TRIM) option and NVME harddisk controller (by pasha1st) Add Discard (TRIM) option and NVME harddisk controller (by pasha1st) Sep 7, 2019
@chotaire
Copy link
Contributor Author
chotaire commented Sep 7, 2019

I've done some tests and these features require a patched vboxServiceWrappers.php to work. @pasha1st has provided an updated vboxServiceWrappers.php from Oracle at #167. Unfortunately, this version breaks the important capability to create snapshots (see #177). I have thereby backported and tested the necessary changes to the following commit:

@chotaire chotaire changed the title Add Discard (TRIM) option and NVME harddisk controller (by pasha1st) Add Discard (TRIM) option and NVME harddisk controller Sep 7, 2019
@chotaire chotaire changed the title Add Discard (TRIM) option and NVME harddisk controller Add Discard (TRIM) option and NVME storage controller Sep 7, 2019
@chotaire
Copy link
Contributor Author
chotaire commented Sep 7, 2019

I have tested these patches as working. Adding and removing TRIM option works, this option is properly saved to VM configuration. Trimming inside a guest will result in the VDI to be shrunk (tested with Linux and FreeBSD guests). Creating snapshots works again.

@h6w
Copy link
Contributor
h6w commented Sep 8, 2019

You're really merging two features together in this PR, and there's an unrelated formatting change (spaces->tabs) probably caused by your editor. But, this is much easier to read than pasha1st's PR so I'll allow it this time.....
Thanks for the effort!

@h6w h6w merged commit 949534b into phpvirtualbox:develop Sep 8, 2019
@trasherdk trasherdk mentioned this pull request Sep 18, 2019
@chotaire chotaire deleted the chot-discard-nvme branch January 29, 2020 09:17
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.

3 participants

0