Bug 25675 - [PATCH] can_hibernate property should be false when no swap exists
Summary: [PATCH] can_hibernate property should be false when no swap exists
Status: RESOLVED FIXED
Alias: None
Product: upower
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: low normal
Assignee: Richard Hughes
QA Contact:
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-16 08:23 UTC by Debbie Beliveau
Modified: 2009-12-16 08:30 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Have dkp_daemon_check_swap function 1st check if swap exists before determining how much is free (1.14 KB, patch)
2009-12-16 08:23 UTC, Debbie Beliveau
Details | Splinter Review

Description Debbie Beliveau 2009-12-16 08:23:31 UTC
Created attachment 32123 [details] [review]
Have dkp_daemon_check_swap function 1st  check if swap exists before determining how much is free

dkp_client_can_hibernate can return true even if the machine has no swap partition.  When determining the value of its can_hibernate property, devicekit-power checks if the kernel supports hibernate and whether there is enough swap space available to perform a hibernate.  However, it does not seem to account for the possibility that a machine may not have a swap partition even though its kernel supports it.  In this case, devicekit-power detects that the kernel supports hibernate and treats the swap space as completely available (therefore dkp_client_can_hibernate returns true).  The attached patch modifies devicekit-power to first check if a swap partition exists before calculating how much is available.
Comment 1 Richard Hughes 2009-12-16 08:30:24 UTC
Thanks for the patch, applied.

commit bbb102c394eff71d84801b48b11e022b1fecb497
Author: Debbie Beliveau <debbie.beliveau@gmail.com>
Date:   Wed Dec 16 16:29:29 2009 +0000

    Check if swap exists before determining how much is free
    
    Signed-off-by: Richard Hughes <richard@hughsie.com>

:100644 100644 eb16a63... 47d84d5... M  src/dkp-daemon.c


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.