Detect old dm-crypt module and disable LUKS suspend/resume.

Fix apitest to work on older systems.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@205 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Milan Broz
2010-04-30 12:03:41 +00:00
parent 346e1d1264
commit 1dcd5a3de5
4 changed files with 103 additions and 8 deletions

View File

@@ -1304,7 +1304,9 @@ int crypt_suspend(struct crypt_device *cd,
}
r = dm_suspend_and_wipe_key(name);
if (r)
if (r == -ENOTSUP)
log_err(cd, "Suspend is not supported for device %s.\n", name);
else if (r)
log_err(cd, "Error during suspending device %s.\n", name);
out:
if (!cd)
@@ -1348,7 +1350,9 @@ int crypt_resume_by_passphrase(struct crypt_device *cd,
if (r >= 0) {
keyslot = r;
r = dm_resume_and_reinstate_key(name, mk->keyLength, mk->key);
if (r)
if (r == -ENOTSUP)
log_err(cd, "Resume is not supported for device %s.\n", name);
else if (r)
log_err(cd, "Error during resuming device %s.\n", name);
} else
r = keyslot;