All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - cmdline: lvcreate adds vdopool as vg name provider
Date: Tue,  2 Mar 2021 21:58:26 +0000 (GMT)	[thread overview]
Message-ID: <20210302215826.C7F023851C35@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e946a5e6904455284ae4eeaa1d149a9324b0f00e
Commit:        e946a5e6904455284ae4eeaa1d149a9324b0f00e
Parent:        f87d1a2abb9102f47d240bd0e6f2c343ddb47310
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Thu Feb 25 17:41:39 2021 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Mar 2 22:54:40 2021 +0100

cmdline: lvcreate adds vdopool as vg name provider

Add same logic as with thinpool or cachepool.
---
 tools/lvmcmdline.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 4e87f0cbf..b6ad66d62 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1519,7 +1519,7 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
 	 * the VG position is allowed to be empty if --name VG/LV is used, or if the
 	 * LVM_VG_NAME env var is set.
 	 *
-	 * --thinpool VG/LV and --cachepool VG/LV can also function like --name 
+	 * --thinpool|--cachepool|--vdopool VG/LV can also function like --name
 	 * to provide the VG name in place of the positional arg.
 	 */
 	if (!strcmp(cmd->name, "lvcreate") &&
@@ -1528,6 +1528,7 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
 	    (arg_is_set(cmd, name_ARG) ||
 	     arg_is_set(cmd, thinpool_ARG) ||
 	     arg_is_set(cmd, cachepool_ARG) ||
+	     arg_is_set(cmd, vdopool_ARG) ||
 	     getenv("LVM_VG_NAME"))) {
 
 		if (getenv("LVM_VG_NAME"))
@@ -1547,6 +1548,9 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
 			if (strstr(name, "/"))
 				return 1;
 		}
+
+		if ((name = arg_str_value(cmd, vdopool_ARG, NULL)) && strstr(name, "/"))
+			return 1;
 	}
 
 	return 0;



                 reply	other threads:[~2021-03-02 21:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210302215826.C7F023851C35@sourceware.org \
    --to=zkabelac@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.