Fix: Exit on e4defrag failure and add verbose logging#20
Fix: Exit on e4defrag failure and add verbose logging#20saurabh-sengar wants to merge 1 commit intomicrosoft:mainfrom
Conversation
shradhagupta6
left a comment
There was a problem hiding this comment.
Verified the patch, and it throws following error as expected:
root@lisa--286-e0-n0:/home/lisatest/lisa_working/20250505/20250505-053125-286/tool/hibernationsetup/hibernation-setup-tool# ./hibernation-setup-tool
INFO: VM supports hibernation with platform-supported events.
INFO: IMDS Request:
GET /metadata/instance/compute/additionalCapabilities/hibernationEnabled?api-version=2021-11-01&format=text HTTP/1.1
Host: 169.254.169.254
Metadata:true
INFO: IMDS Response:
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Server: IMDS/150.870.65.1544
x-ms-request-id: c80fc720-66ab-4c95-a061-362defdda540
Date: Mon, 05 May 2025 05:54:36 GMT
Content-Length: 4
true
INFO: Hibernation is allowed for this VM
hibernation-setup-tool: INFO: System has 7937 MB of RAM; needs a swap area of 15874 MB
hibernation-setup-tool: INFO: Swap file not found
hibernation-setup-tool: INFO: Creating swap file with 15874 MB
hibernation-setup-tool: INFO: Creating hibernation file at /hibfile.sys with 15874 MB.
hibernation-setup-tool: INFO: Ensuring /hibfile.sys has no holes in it.
hibernation-setup-tool: INFO: Waiting for e4defrag (pid 1453) to finish.
e4defrag 1.47.0 (5-Feb-2023)
ext4 defragmentation for /hibfile.sys
[1/1] "/hibfile.sys" extents: 66 -> 66
Defrag size is larger than filesystem's free space [ NG ]
Success: [0/1]
hibernation-setup-tool: INFO: e4defrag ended with unexpected exit code 1
hibernation-setup-tool: ERROR: e4defrag failed for /hibfile.sys. Exiting.
|
@pavanrachapudy90 @younghyun5756 Can you please review ? |
|
Should we also handle for btrfs as well? - try_spawn_and_wait("btrfs", 3, "filesystem", "defragment", path); |
yes, let me try to push changes for the same |
|
I won't be able to update the PR with my commit. I am creating a new PR to take care of this |
|
new PR: #23 |
|
closing this PR |
Created by CoPilot - Testing it.