public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/lib/misc lvm-globals.c
Date: Thu, 30 Oct 2008 17:39:00 -0000	[thread overview]
Message-ID: <20081030173900.23206.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-10-30 17:39:00

Added files:
	lib/misc       : lvm-globals.c 

Log message:
	Separate out globals from the logging code.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-globals.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1

/cvs/lvm2/LVM2/lib/misc/lvm-globals.c,v  -->  standard output
revision 1.1
--- LVM2/lib/misc/lvm-globals.c
+++ -	2008-10-30 17:39:00.881868000 +0000
@@ -0,0 +1,201 @@
+/*
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
+ * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "lib.h"
+#include "device.h"
+#include "memlock.h"
+#include "lvm-string.h"
+#include "lvm-file.h"
+#include "defaults.h"
+
+#include <stdarg.h>
+
+static int _verbose_level = VERBOSE_BASE_LEVEL;
+static int _test = 0;
+static int _md_filtering = 0;
+static int _pvmove = 0;
+static int _full_scan_done = 0;	/* Restrict to one full scan during each cmd */
+static int _trust_cache = 0; /* Don't scan when incomplete VGs encountered */
+static int _debug_level = 0;
+static int _log_cmd_name = 0;
+static int _ignorelockingfailure = 0;
+static int _lockingfailed = 0;
+static int _security_level = SECURITY_LEVEL;
+static char _cmd_name[30] = "";
+static int _mirror_in_sync = 0;
+static int _dmeventd_monitor = DEFAULT_DMEVENTD_MONITOR;
+static int _ignore_suspended_devices = 0;
+static int _error_message_produced = 0;
+
+void init_verbose(int level)
+{
+	_verbose_level = level;
+}
+
+void init_test(int level)
+{
+	if (!_test && level)
+		log_print("Test mode: Metadata will NOT be updated.");
+	_test = level;
+}
+
+void init_md_filtering(int level)
+{
+	_md_filtering = level;
+}
+
+void init_pvmove(int level)
+{
+	_pvmove = level;
+}
+
+void init_full_scan_done(int level)
+{
+	_full_scan_done = level;
+}
+
+void init_trust_cache(int trustcache)
+{
+	_trust_cache = trustcache;
+}
+
+void init_ignorelockingfailure(int level)
+{
+	_ignorelockingfailure = level;
+}
+
+void init_lockingfailed(int level)
+{
+	_lockingfailed = level;
+}
+
+void init_security_level(int level)
+{
+	_security_level = level;
+}
+
+void init_mirror_in_sync(int in_sync)
+{
+	_mirror_in_sync = in_sync;
+}
+
+void init_dmeventd_monitor(int reg)
+{
+	_dmeventd_monitor = reg;
+}
+
+void init_ignore_suspended_devices(int ignore)
+{
+	_ignore_suspended_devices = ignore;
+}
+
+void init_cmd_name(int status)
+{
+	_log_cmd_name = status;
+}
+
+void set_cmd_name(const char *cmd)
+{
+	strncpy(_cmd_name, cmd, sizeof(_cmd_name));
+	_cmd_name[sizeof(_cmd_name) - 1] = '\0';
+}
+
+const char *log_command_name()
+{
+	if (!_log_cmd_name)
+		return "";
+
+	return _cmd_name;
+}
+
+void init_error_message_produced(int value)
+{
+	_error_message_produced = value;
+}
+
+int error_message_produced(void)
+{
+	return _error_message_produced;
+}
+
+int test_mode()
+{
+	return _test;
+}
+
+int md_filtering()
+{
+	return _md_filtering;
+}
+
+int pvmove_mode()
+{
+	return _pvmove;
+}
+
+int full_scan_done()
+{
+	return _full_scan_done;
+}
+
+int trust_cache()
+{
+	return _trust_cache;
+}
+
+int lockingfailed()
+{
+	return _lockingfailed;
+}
+
+int ignorelockingfailure()
+{
+	return _ignorelockingfailure;
+}
+
+int security_level()
+{
+	return _security_level;
+}
+
+int mirror_in_sync(void)
+{
+	return _mirror_in_sync;
+}
+
+int dmeventd_monitor_mode(void)
+{
+	return _dmeventd_monitor;
+}
+
+int ignore_suspended_devices(void)
+{
+	return _ignore_suspended_devices;
+}
+
+void init_debug(int level)
+{
+	_debug_level = level;
+}
+
+int verbose_level()
+{
+	return _verbose_level;
+}
+
+int debug_level()
+{
+	return _debug_level;
+}


             reply	other threads:[~2008-10-30 17:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-30 17:39 agk [this message]
2011-09-01 13:30 zkabelac

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=20081030173900.23206.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).