All of lore.kernel.org
 help / color / mirror / Atom feed
* device-mapper ./WHATS_NEW lib/libdevmapper.h l ...
@ 2007-01-29 17:23 agk
  0 siblings, 0 replies; 3+ messages in thread
From: agk @ 2007-01-29 17:23 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	device-mapper
Changes by:	agk@sourceware.org	2007-01-29 17:23:54

Modified files:
	.              : WHATS_NEW 
	lib            : libdevmapper.h libdm-report.c 

Log message:
	Use fixed-size fields in report interface.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.162&r2=1.163
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdevmapper.h.diff?cvsroot=dm&r1=1.67&r2=1.68
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-report.c.diff?cvsroot=dm&r1=1.10&r2=1.11

--- device-mapper/WHATS_NEW	2007/01/25 23:36:05	1.162
+++ device-mapper/WHATS_NEW	2007/01/29 17:23:54	1.163
@@ -1,5 +1,6 @@
 Version 1.02.17 -
 ===================================
+  Use fixed-size fields in report interface.
 
 Version 1.02.16 - 25th January 2007
 ===================================
--- device-mapper/lib/libdevmapper.h	2007/01/23 19:18:52	1.67
+++ device-mapper/lib/libdevmapper.h	2007/01/29 17:23:54	1.68
@@ -657,11 +657,11 @@
 struct dm_report;
 struct dm_report_field_type {
 	uint32_t type;		/* object type id */
+	uint32_t flags;		/* DM_REPORT_FIELD_* */
+	uint32_t offset;	/* byte offset in the object */
+	int32_t width;		/* default width */
 	const char id[32];	/* string used to specify the field */
-	unsigned int offset;	/* byte offset in the object */
 	const char heading[32];	/* string printed in header */
-	int width;		/* default width */
-	uint32_t flags;		/* DM_REPORT_FIELD_* */
 	int (*report_fn)(struct dm_report *rh, struct dm_pool *mem,
 			 struct dm_report_field *field, const void *data,
 			 void *private);
--- device-mapper/lib/libdm-report.c	2007/01/24 16:41:33	1.10
+++ device-mapper/lib/libdm-report.c	2007/01/29 17:23:54	1.11
@@ -60,7 +60,7 @@
 	struct list list;
 	uint32_t field_num;
 	uint32_t sort_posn;
-	unsigned width;
+	int32_t width;
 	const struct dm_report_object_type *type;
 	uint32_t flags;
 };
@@ -750,7 +750,7 @@
 	struct dm_report_field *field;
 	const char *repstr;
 	char buf[4096];
-	unsigned width;
+	int32_t width;
 	uint32_t align;
 
 	if (list_empty(&rh->rows))

^ permalink raw reply	[flat|nested] 3+ messages in thread
* device-mapper ./WHATS_NEW lib/libdevmapper.h l ...
@ 2008-09-02 12:16 agk
  0 siblings, 0 replies; 3+ messages in thread
From: agk @ 2008-09-02 12:16 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	device-mapper
Changes by:	agk@sourceware.org	2008-09-02 12:16:07

Modified files:
	.              : WHATS_NEW 
	lib            : libdevmapper.h libdm-deptree.c 

Log message:
	Extend deptree buffers so the largest possible device numbers fit.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.249&r2=1.250
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdevmapper.h.diff?cvsroot=dm&r1=1.83&r2=1.84
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-deptree.c.diff?cvsroot=dm&r1=1.40&r2=1.41

--- device-mapper/WHATS_NEW	2008/06/27 15:36:51	1.249
+++ device-mapper/WHATS_NEW	2008/09/02 12:16:06	1.250
@@ -1,5 +1,6 @@
 Version 1.02.28 - 
 ================================
+  Extend deptree buffers so the largest possible device numbers fit.
   Added generation of the versioned libdevmapper-event.so for LVM's test
   Underline longer report help text headings.
 
--- device-mapper/lib/libdevmapper.h	2008/06/24 22:53:48	1.83
+++ device-mapper/lib/libdevmapper.h	2008/09/02 12:16:07	1.84
@@ -181,8 +181,9 @@
 		       uint64_t size, const char *ttype, const char *params);
 
 /*
- * Format major/minor numbers correctly for input to driver
+ * Format major/minor numbers correctly for input to driver.
  */
+#define DM_FORMAT_DEV_BUFSIZE	13	/* Minimum bufsize to handle worst case. */
 int dm_format_dev(char *buf, int bufsize, uint32_t dev_major, uint32_t dev_minor);
 
 /* Use this to retrive target information returned from a STATUS call */
--- device-mapper/lib/libdm-deptree.c	2008/06/25 14:24:17	1.40
+++ device-mapper/lib/libdm-deptree.c	2008/09/02 12:16:07	1.41
@@ -1243,7 +1243,7 @@
 			    size_t paramsize, int *pos)
 {
 	struct seg_area *area;
-	char devbuf[10];
+	char devbuf[DM_FORMAT_DEV_BUFSIZE];
 	int tw;
 	const char *prefix = "";
 
@@ -1270,7 +1270,8 @@
         int pos = 0;
 	int tw;
         int r;
-	char originbuf[10], cowbuf[10], logbuf[10];
+	char originbuf[DM_FORMAT_DEV_BUFSIZE], cowbuf[DM_FORMAT_DEV_BUFSIZE];
+	char logbuf[DM_FORMAT_DEV_BUFSIZE];
 	const char *logtype;
 
 	switch(seg->type) {

^ permalink raw reply	[flat|nested] 3+ messages in thread
* device-mapper ./WHATS_NEW lib/libdevmapper.h l ...
@ 2007-01-23 19:18 agk
  0 siblings, 0 replies; 3+ messages in thread
From: agk @ 2007-01-23 19:18 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	device-mapper
Changes by:	agk@sourceware.org	2007-01-23 19:18:52

Modified files:
	.              : WHATS_NEW 
	lib            : libdevmapper.h libdm-report.c 

Log message:
	Add descriptions to reporting field definitions.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.157&r2=1.158
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdevmapper.h.diff?cvsroot=dm&r1=1.66&r2=1.67
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-report.c.diff?cvsroot=dm&r1=1.7&r2=1.8

--- device-mapper/WHATS_NEW	2007/01/23 17:38:38	1.157
+++ device-mapper/WHATS_NEW	2007/01/23 19:18:52	1.158
@@ -1,5 +1,6 @@
 Version 1.02.16 -
 ===================================
+  Add descriptions to reporting field definitions.
   Add a dso-private variable to dmeventd dso interface.
   Add dm_event_handler_[gs]et_timeout functions.
   Streamline dm_report_field_* interface.
--- device-mapper/lib/libdevmapper.h	2007/01/22 15:03:57	1.66
+++ device-mapper/lib/libdevmapper.h	2007/01/23 19:18:52	1.67
@@ -665,6 +665,7 @@
 	int (*report_fn)(struct dm_report *rh, struct dm_pool *mem,
 			 struct dm_report_field *field, const void *data,
 			 void *private);
+	const char *desc;	/* description of the field */
 };
 
 /*
--- device-mapper/lib/libdm-report.c	2007/01/23 17:38:39	1.7
+++ device-mapper/lib/libdm-report.c	2007/01/23 19:18:52	1.8
@@ -248,6 +248,11 @@
 	uint32_t f;
 	const struct dm_report_object_type *type;
 	const char *desc, *last_desc = "";
+	size_t id_len = 0;
+
+	for (f = 0; rh->fields[f].report_fn; f++)
+		if (strlen(rh->fields[f].id) > id_len)
+			id_len = strlen(rh->fields[f].id);
 
 	for (f = 0; rh->fields[f].report_fn; f++) {
 		if ((type = _find_type(rh, rh->fields[f].type)) && type->desc)
@@ -260,7 +265,7 @@
 			log_print("%s Fields", desc);
 		}
 
-		log_print("- %s", rh->fields[f].id);
+		log_print("- %-*s: %s", (int) id_len, rh->fields[f].id, rh->fields[f].desc);
 		last_desc = desc;
 	}
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-02 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-29 17:23 device-mapper ./WHATS_NEW lib/libdevmapper.h l agk
  -- strict thread matches above, loose matches on Subject: below --
2008-09-02 12:16 agk
2007-01-23 19:18 agk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.