Add backing device info into status.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@445 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Milan Broz
2011-03-12 20:23:25 +00:00
parent be3448fb8a
commit 13f4feaaf7
5 changed files with 13 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
2011-04-11 Milan Broz <mbroz@redhat.com>
* Add loop manipulation code and support mapping of images in file.
* Add backing device loop info into status message.
2011-04-05 Milan Broz <mbroz@redhat.com>
* Add exception to COPYING for binary distribution linked with OpenSSL library.

View File

@@ -12,6 +12,7 @@
#include "nls.h"
#include "utils_crypt.h"
#include "utils_loop.h"
#define SECTOR_SHIFT 9
#define SECTOR_SIZE (1 << SECTOR_SHIFT)

View File

@@ -11,6 +11,7 @@ INCLUDES = \
cryptsetup_SOURCES = \
$(top_builddir)/lib/utils_crypt.c \
$(top_builddir)/lib/utils_loop.c \
cryptsetup.c \
cryptsetup.h

View File

@@ -319,6 +319,8 @@ static int action_status(int arg)
crypt_status_info ci;
struct crypt_active_device cad;
struct crypt_device *cd = NULL;
char *backing_file;
const char *device;
int r = 0;
ci = crypt_status(NULL, action_argv[0]);
@@ -345,7 +347,13 @@ static int action_status(int arg)
log_std(" cipher: %s-%s\n", crypt_get_cipher(cd), crypt_get_cipher_mode(cd));
log_std(" keysize: %d bits\n", crypt_get_volume_key_size(cd) * 8);
log_std(" device: %s\n", crypt_get_device_name(cd));
device = crypt_get_device_name(cd);
log_std(" device: %s\n", device);
if (crypt_loop_device(device)) {
backing_file = crypt_loop_backing_file(device);
log_std(" loop: %s\n", backing_file);
free(backing_file);
}
log_std(" offset: %" PRIu64 " sectors\n", cad.offset);
log_std(" size: %" PRIu64 " sectors\n", cad.size);
if (cad.iv_offset)

View File

@@ -7,6 +7,7 @@
#include "lib/nls.h"
#include "lib/utils_crypt.h"
#include "lib/utils_loop.h"
#define DEFAULT_CIPHER(type) (DEFAULT_##type##_CIPHER "-" DEFAULT_##type##_MODE)