Skip to content

Commit

Permalink
devicemapper: remove 256 character limit of libdm logs
Browse files Browse the repository at this point in the history
This limit is unecessary and can lead to the truncation of long libdm
logs (which is quite annoying).

Fixes: b440ec0 ("device-mapper: Move all devicemapper spew to log through utils.Debugf().")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
  • Loading branch information
cyphar committed Jul 3, 2017
1 parent 8bc6812 commit 63328c6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/devicemapper/devmapper_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package devicemapper

/*
#cgo LDFLAGS: -L. -ldevmapper
#define _GNU_SOURCE
#include <libdevmapper.h>
#include <linux/fs.h> // FIXME: present only for BLKGETSIZE64, maybe we can remove it?
Expand All @@ -12,19 +13,20 @@ extern void DevmapperLogCallback(int level, char *file, int line, int dm_errno_o
static void log_cb(int level, const char *file, int line, int dm_errno_or_class, const char *f, ...)
{
char buffer[256];
va_list ap;
char *buffer = NULL;
va_list ap;
va_start(ap, f);
vsnprintf(buffer, 256, f, ap);
va_end(ap);
va_start(ap, f);
vasprintf(&buffer, f, ap);
va_end(ap);
DevmapperLogCallback(level, (char *)file, line, dm_errno_or_class, buffer);
DevmapperLogCallback(level, (char *)file, line, dm_errno_or_class, buffer);
free(buffer);
}
static void log_with_errno_init()
{
dm_log_with_errno_init(log_cb);
dm_log_with_errno_init(log_cb);
}
*/
import "C"
Expand Down

0 comments on commit 63328c6

Please sign in to comment.