All of lore.kernel.org
 help / color / mirror / Atom feed
* LVM2/libdm libdm-report.c
@ 2009-01-10  3:14 agk
  0 siblings, 0 replies; 6+ messages in thread
From: agk @ 2009-01-10  3:14 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk at sourceware.org	2009-01-10 03:14:24

Modified files:
	libdm          : libdm-report.c 

Log message:
	Add <report_type>_all to help text.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-report.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28

--- LVM2/libdm/libdm-report.c	2009/01/10 03:01:35	1.27
+++ LVM2/libdm/libdm-report.c	2009/01/10 03:14:24	1.28
@@ -254,6 +254,11 @@
 		if (strlen(rh->fields[f].id) > id_len)
 			id_len = strlen(rh->fields[f].id);
 
+
+	for (type = rh->types; type->data_fn; type++)
+		if (strlen(type->prefix) + 3 > id_len)
+			id_len = strlen(type->prefix) + 3;
+
 	for (f = 0; rh->fields[f].report_fn; f++) {
 		if ((type = _find_type(rh, rh->fields[f].type)) && type->desc)
 			desc = type->desc;
@@ -266,6 +271,9 @@
 			log_warn("%*.*s", (int) strlen(desc) + 7,
 				 (int) strlen(desc) + 7,
 				 "-------------------------------------------------------------------------------");
+			log_warn("  %sall%-*s - %s", type->prefix,
+				 (int) (id_len - 3 - strlen(type->prefix)), "",
+				 "All fields in this section.");
 		}
 
 		/* FIXME Add line-wrapping at terminal width (or 80 cols) */



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

* LVM2/libdm libdm-report.c
@ 2010-11-01 13:50 prajnoha
  0 siblings, 0 replies; 6+ messages in thread
From: prajnoha @ 2010-11-01 13:50 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha at sourceware.org	2010-11-01 13:50:51

Modified files:
	libdm          : libdm-report.c 

Log message:
	Use dm_strdup/dm_free instead of strdup/free.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-report.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39

--- LVM2/libdm/libdm-report.c	2010/11/01 13:31:55	1.38
+++ LVM2/libdm/libdm-report.c	2010/11/01 13:50:51	1.39
@@ -912,20 +912,20 @@
 	size_t buf_size = 0;
 
 	if (rh->flags & DM_REPORT_OUTPUT_FIELD_NAME_PREFIX) {
-		if (!(field_id = strdup(rh->fields[field->props->field_num].id))) {
+		if (!(field_id = dm_strdup(rh->fields[field->props->field_num].id))) {
 			log_error("dm_report: Failed to copy field name");
 			return 0;
 		}
 
 		if (!dm_pool_grow_object(rh->mem, rh->output_field_name_prefix, 0)) {
 			log_error("dm_report: Unable to extend output line");
-			free(field_id);
+			dm_free(field_id);
 			return 0;
 		}
 
 		if (!dm_pool_grow_object(rh->mem, _toupperstr(field_id), 0)) {
 			log_error("dm_report: Unable to extend output line");
-			free(field_id);
+			dm_free(field_id);
 			return 0;
 		}
 



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

* LVM2/libdm libdm-report.c
@ 2010-02-15 18:36 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2010-02-15 18:36 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2010-02-15 18:36:48

Modified files:
	libdm          : libdm-report.c 

Log message:
	Fix dm_report_field_uint64 to really use 64bit.
	(function is currently not in use)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-report.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35

--- LVM2/libdm/libdm-report.c	2010/02/15 18:34:00	1.34
+++ LVM2/libdm/libdm-report.c	2010/02/15 18:36:48	1.35
@@ -207,7 +207,7 @@
 int dm_report_field_uint64(struct dm_report *rh,
 			   struct dm_report_field *field, const uint64_t *data)
 {
-	const int value = *data;
+	const uint64_t value = *data;
 	uint64_t *sortval;
 	char *repstr;
 
@@ -221,12 +221,12 @@
 		return 0;
 	}
 
-	if (dm_snprintf(repstr, 21, "%d", value) < 0) {
-		log_error("dm_report_field_uint64: uint64 too big: %d", value);
+	if (dm_snprintf(repstr, 21, "%" PRIu64 , value) < 0) {
+		log_error("dm_report_field_uint64: uint64 too big: %" PRIu64, value);
 		return 0;
 	}
 
-	*sortval = (const uint64_t) value;
+	*sortval = value;
 	field->sort_value = sortval;
 	field->report_string = repstr;
 



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

* LVM2/libdm libdm-report.c
@ 2010-01-07 14:32 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2010-01-07 14:32 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2010-01-07 14:32:44

Modified files:
	libdm          : libdm-report.c 

Log message:
	Error message prints unrecognized key.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-report.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32

--- LVM2/libdm/libdm-report.c	2010/01/07 14:30:47	1.31
+++ LVM2/libdm/libdm-report.c	2010/01/07 14:32:44	1.32
@@ -550,7 +550,7 @@
 		while (*we && *we != ',')
 			we++;
 		if (!_key_match(rh, ws, (size_t) (we - ws), report_type_only)) {
-			log_error("dm_report: Unrecognised field: %.*s",
+			log_error("dm_report: Unrecognised key: %.*s",
 				  (int) (we - ws), ws);
 			return 0;
 		}



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

* LVM2/libdm libdm-report.c
  2009-01-19 20:53 wysochanski
@ 2009-01-19 21:43 ` Alasdair G Kergon
  0 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2009-01-19 21:43 UTC (permalink / raw)
  To: lvm-devel

On Mon, Jan 19, 2009 at 08:53:35PM -0000, wysochanski at sourceware.org wrote:
> Log message:
> 	Rename _parse_options() to _parse_fields() for naming consistency.

Ack.
 	
Alasdair
-- 
agk at redhat.com



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

* LVM2/libdm libdm-report.c
@ 2009-01-19 20:53 wysochanski
  2009-01-19 21:43 ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: wysochanski @ 2009-01-19 20:53 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2009-01-19 20:53:35

Modified files:
	libdm          : libdm-report.c 

Log message:
	Rename _parse_options() to _parse_fields() for naming consistency.
	
	In libdm, we only ever use 'fields', while the tools use 'options' and
	'fields' interchangeably.
	
	Ideally it would be good to use 'fields' consistently everywhere.
	However, 'options' most likely comes from the tool commandline '-o' and
	'--options' which cannot be changed.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-report.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29

--- LVM2/libdm/libdm-report.c	2009/01/10 03:14:24	1.28
+++ LVM2/libdm/libdm-report.c	2009/01/19 20:53:35	1.29
@@ -491,8 +491,8 @@
 	return 0;
 }
 
-static int _parse_options(struct dm_report *rh, const char *format,
-			  unsigned report_type_only)
+static int _parse_fields(struct dm_report *rh, const char *format,
+			 unsigned report_type_only)
 {
 	const char *ws;		/* Word start */
 	const char *we = format;	/* Word end */
@@ -562,9 +562,9 @@
 	memset(rh, 0, sizeof(*rh));
 
 	/*
-	 * rh->report_types is updated in _parse_options() and _parse_keys()
+	 * rh->report_types is updated in _parse_fields() and _parse_keys()
 	 * to contain all types corresponding to the fields specified by
-	 * options or keys.
+	 * fields or keys.
 	 */
 	if (report_types)
 		rh->report_types = *report_types;
@@ -606,14 +606,14 @@
 	 * the field lists twice.  The first time we only update the report type.
 	 * FIXME Use one pass instead and expand the "all" field afterwards.
 	 */
-	if (!_parse_options(rh, output_fields, 1) ||
+	if (!_parse_fields(rh, output_fields, 1) ||
 	    !_parse_keys(rh, sort_keys, 1)) {
 		dm_report_free(rh);
 		return NULL;
 	}
 
 	/* Generate list of fields for output based on format string & flags */
-	if (!_parse_options(rh, output_fields, 0) ||
+	if (!_parse_fields(rh, output_fields, 0) ||
 	    !_parse_keys(rh, sort_keys, 0)) {
 		dm_report_free(rh);
 		return NULL;



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

end of thread, other threads:[~2010-11-01 13:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-10  3:14 LVM2/libdm libdm-report.c agk
2009-01-19 20:53 wysochanski
2009-01-19 21:43 ` Alasdair G Kergon
2010-01-07 14:32 zkabelac
2010-02-15 18:36 zkabelac
2010-11-01 13:50 prajnoha

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.