All of lore.kernel.org
 help / color / mirror / Atom feed
From: wysochanski@sourceware.org <wysochanski@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/test/api test.c
Date: 26 Jul 2009 20:58:38 -0000	[thread overview]
Message-ID: <20090726205838.541.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2009-07-26 20:58:38

Modified files:
	test/api       : test.c 

Log message:
	Update test/api/test.c to call lv_deactivate and lv_activate.
	
	Author: Dave Wysochanski <dwysocha@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/api/test.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15

--- LVM2/test/api/test.c	2009/07/26 20:29:56	1.14
+++ LVM2/test/api/test.c	2009/07/26 20:58:38	1.15
@@ -50,6 +50,10 @@
 
 static void _show_help(void)
 {
+	printf("'lv_activate vgname lvname: "
+	       "Activate an LV\n");
+	printf("'lv_deactivate vgname lvname: "
+	       "Deactivate an LV\n");
 	printf("'vg_remove_lv vgname lvname': "
 	       "Remove a LV\n");
 	printf("'vg_create_lv_linear vgname lvname size_in_bytes': "
@@ -317,6 +321,42 @@
 	}
 }
 
+static void _lv_deactivate(char **argv, int argc)
+{
+	lv_t *lv;
+
+	if (argc < 3) {
+		printf("Please enter vgname, lvname\n");
+		return;
+	}
+	if (!(lv = _lookup_lv_by_name(argv[2])))
+		return;
+	if (lvm_lv_deactivate(lv))
+		printf("Error ");
+	else {
+		printf("Success ");
+	}
+	printf("De-activating LV %s in VG %s\n",
+		argv[2], argv[1]);
+}
+static void _lv_activate(char **argv, int argc)
+{
+	lv_t *lv;
+
+	if (argc < 3) {
+		printf("Please enter vgname, lvname\n");
+		return;
+	}
+	if (!(lv = _lookup_lv_by_name(argv[2])))
+		return;
+	if (lvm_lv_activate(lv))
+		printf("Error ");
+	else {
+		printf("Success ");
+	}
+	printf("activating LV %s in VG %s\n",
+		argv[2], argv[1]);
+}
 static void _vg_remove_lv(char **argv, int argc)
 {
 	lv_t *lv;
@@ -404,6 +444,10 @@
 			_vg_open(argv, argc, libh);
 		} else if (!strcmp(argv[0], "vg_close")) {
 			_vg_close(argv, argc);
+		} else if (!strcmp(argv[0], "lv_activate")) {
+			_lv_activate(argv, argc);
+		} else if (!strcmp(argv[0], "lv_deactivate")) {
+			_lv_deactivate(argv, argc);
 		} else if (!strcmp(argv[0], "vg_remove_lv")) {
 			_vg_remove_lv(argv, argc);
 		} else if (!strcmp(argv[0], "vgs_open")) {



             reply	other threads:[~2009-07-26 20:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-26 20:58 wysochanski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-03-01 23:29 LVM2/test/api test.c zkabelac
2011-03-01 23:18 zkabelac
2010-11-25 14:35 mornfall
2010-11-17 20:13 mornfall
2010-11-17 19:17 mornfall
2010-10-25 14:09 wysochanski
2010-05-19 11:53 wysochanski
2010-02-24 18:16 wysochanski
2009-08-07 21:22 wysochanski
2009-07-28 14:12 wysochanski
2009-07-28 13:49 wysochanski
2009-07-27 21:02 wysochanski
2009-07-27 17:45 wysochanski
2009-07-26 20:59 wysochanski
2009-07-26 14:37 wysochanski
2009-07-26 13:08 wysochanski
2009-07-26 13:07 wysochanski
2009-07-26  2:35 wysochanski
2009-07-26  2:35 wysochanski
2009-07-24 12:51 wysochanski
2009-07-24  4:15 wysochanski
2009-07-23 23:40 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=20090726205838.541.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.