All of lore.kernel.org
 help / color / mirror / Atom feed
From: wysochanski@sourceware.org <wysochanski@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 lib/commands/toolcontext.c tools/lvmcmdline.c
Date: 11 Dec 2008 03:36:16 -0000	[thread overview]
Message-ID: <20081211033616.31954.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2008-12-11 03:36:16

Modified files:
	lib/commands   : toolcontext.c 
	tools          : lvmcmdline.c 

Log message:
	Move initialization of cmd->fmt into init_formats().
	
	init_formats() sets up the command formats, and currently sets cmd->fmt_backup
	but does not set cmd->fmt to a default value.  This seems incorrect so we
	set it to cmd->default_settings.fmt before returning.
	
	The call we remove here may set cmd->fmt based on a command line setting.
	But it is safe to remove this, because the only caller of init_lvm() that
	cares about the cmdline override is the cmdline tools (clvmd does not care),
	called from lvm2_main().  After lvm2_main() calls init_lvm(), it later calls
	lvm_run_command().  In lvm_run_command(), we have a call to _apply_settings(),
	which has the identical assignment of cmd->fmt that this patch removes.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.68&r2=1.69
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.85&r2=1.86

--- LVM2/lib/commands/toolcontext.c	2008/12/11 03:33:35	1.68
+++ LVM2/lib/commands/toolcontext.c	2008/12/11 03:36:16	1.69
@@ -784,6 +784,7 @@
 		if (!strcasecmp(fmt->name, format) ||
 		    (fmt->alias && !strcasecmp(fmt->alias, format))) {
 			cmd->default_settings.fmt = fmt;
+			cmd->fmt = cmd->default_settings.fmt;
 			return 1;
 		}
 	}
--- LVM2/tools/lvmcmdline.c	2008/12/11 03:34:43	1.85
+++ LVM2/tools/lvmcmdline.c	2008/12/11 03:36:16	1.86
@@ -1094,9 +1094,6 @@
 	init_full_scan_done(0);
 	init_mirror_in_sync(0);
 
-	cmd->fmt = arg_ptr_value(cmd, metadatatype_ARG,
-				 cmd->current_settings.fmt);
-
 	return cmd;
 }
 



             reply	other threads:[~2008-12-11  3:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11  3:36 wysochanski [this message]
2008-12-11 23:35 ` LVM2 lib/commands/toolcontext.c tools/lvmcmdline.c Alasdair G Kergon
  -- strict thread matches above, loose matches on Subject: below --
2011-06-27 23:43 agk
2008-12-12  3:30 wysochanski
2008-12-11  3:31 wysochanski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081211033616.31954.qmail@sourceware.org \
    --to=wysochanski@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.