From: Nick Wang <nwang@suse.com>
To: drbd-dev@lists.linbit.com
Cc: Lars Ellenberg <lars.ellenberg@linbit.com>,
Roland Kammerer <roland.kammerer@linbit.com>
Subject: [Drbd-dev] [PATCH] drbdadm: Support to pass force option to dump md
Date: Thu, 25 Jan 2018 14:28:49 +0800 [thread overview]
Message-ID: <20180125062849.4337-1-nwang@suse.com> (raw)
At least till v8.9.6, drbdadm dump-md support
"--force" option to dump the metadata while
the device still running.
drbdmeta still able to dump but drbdadm will
show "unrecognized option" to "--force"
Signed-off-by: Nick Wang <nwang@suse.com>
CC: Lars Ellenberg <lars.ellenberg@linbit.com>
CC: Roland Kammerer <roland.kammerer@linbit.com>
CC: drbd-dev@lists.linbit.com
---
user/v9/config_flags.c | 6 ++++++
user/v9/config_flags.h | 1 +
user/v9/drbdadm_main.c | 2 +-
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/user/v9/config_flags.c b/user/v9/config_flags.c
index 063edce7..ae24d0c8 100644
--- a/user/v9/config_flags.c
+++ b/user/v9/config_flags.c
@@ -1084,6 +1084,12 @@ struct context_def create_md_ctx = {
{ } },
};
+struct context_def dump_md_ctx = {
+ .fields = {
+ { .name = "force", .argument_is_optional = true },
+ { } },
+};
+
struct context_def adjust_ctx = {
.fields = {
{ "skip-disk", .argument_is_optional = true },
diff --git a/user/v9/config_flags.h b/user/v9/config_flags.h
index 8e192cb0..bcc9d634 100644
--- a/user/v9/config_flags.h
+++ b/user/v9/config_flags.h
@@ -100,6 +100,7 @@ extern struct context_def verify_cmd_ctx;
extern struct context_def device_options_ctx;
extern struct context_def invalidate_ctx;
extern struct context_def create_md_ctx;
+extern struct context_def dump_md_ctx;
extern struct context_def adjust_ctx;
extern struct context_def peer_device_options_ctx;
extern struct context_def handlers_ctx;
diff --git a/user/v9/drbdadm_main.c b/user/v9/drbdadm_main.c
index 6d76eb67..26759c80 100644
--- a/user/v9/drbdadm_main.c
+++ b/user/v9/drbdadm_main.c
@@ -357,7 +357,7 @@ static struct adm_cmd dump_xml_cmd = {"dump-xml", adm_dump_xml, ACF1_DUMP};
static struct adm_cmd create_md_cmd = {"create-md", adm_create_md, &create_md_ctx, ACF1_MINOR_ONLY };
static struct adm_cmd show_gi_cmd = {"show-gi", adm_setup_and_meta, ACF1_PEER_DEVICE .disk_required = 1};
static struct adm_cmd get_gi_cmd = {"get-gi", adm_setup_and_meta, ACF1_PEER_DEVICE .disk_required = 1};
-static struct adm_cmd dump_md_cmd = {"dump-md", adm_drbdmeta, ACF1_MINOR_ONLY };
+static struct adm_cmd dump_md_cmd = {"dump-md", adm_drbdmeta, &dump_md_ctx, ACF1_MINOR_ONLY };
static struct adm_cmd wipe_md_cmd = {"wipe-md", adm_drbdmeta, ACF1_MINOR_ONLY };
static struct adm_cmd apply_al_cmd = {"apply-al", adm_drbdmeta, ACF1_MINOR_ONLY };
static struct adm_cmd forget_peer_cmd = {"forget-peer", adm_forget_peer, ACF1_DISCONNECT };
--
2.12.0
next reply other threads:[~2018-01-25 6:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 6:28 Nick Wang [this message]
2018-01-26 10:46 ` [Drbd-dev] [PATCH] drbdadm: Support to pass force option to dump md Philipp Reisner
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=20180125062849.4337-1-nwang@suse.com \
--to=nwang@suse.com \
--cc=drbd-dev@lists.linbit.com \
--cc=lars.ellenberg@linbit.com \
--cc=roland.kammerer@linbit.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox