All of lore.kernel.org
 help / color / mirror / Atom feed
From: kupcevic@sourceware.org <kupcevic@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/ricci/modules/storage MountHandler.cpp V ...
Date: 26 Sep 2006 01:16:14 -0000	[thread overview]
Message-ID: <20060926011614.15768.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic at sourceware.org	2006-09-26 01:16:13

Modified files:
	ricci/modules/storage: MountHandler.cpp VG.cpp BDFactory.cpp 
	                       LV.cpp MDRaid.cpp MDRaidTarget.cpp 

Log message:
	storage module: minor code cleanup

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/MountHandler.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/VG.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/BDFactory.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LV.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/MDRaid.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/MDRaidTarget.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4

--- conga/ricci/modules/storage/MountHandler.cpp	2006/08/10 22:53:09	1.3
+++ conga/ricci/modules/storage/MountHandler.cpp	2006/09/26 01:16:13	1.4
@@ -356,14 +356,15 @@
   String dev(utils::strip(devname));
   String mnt(utils::strip(mountpoint));
   
+  String buff;
+  bool modified = false;
   FILE* fstab = fopen(fstab_path.c_str(), "r");
   if (!fstab)
     throw String("unable to open ") + fstab_path;
-  String buff;
-  bool modified = false;
   try {
     bool done = false;
     while (!done) {
+      String line;
       char* ptr = NULL;
       int size;
       size_t tmp;
@@ -377,7 +378,6 @@
 	  throw String("error reading fstab");
 	}
       }
-      String line;
       try {
 	line = String(ptr, size);
 	free(ptr);
@@ -438,6 +438,7 @@
   try {
     bool done = false;
     while (!done) {
+      String line;
       char* ptr = NULL;
       int size;
       size_t tmp;
@@ -451,7 +452,6 @@
 	  throw String("error reading /proc/filesystems");
 	}
       }
-      String line;
       try {
 	line = utils::strip(String(ptr, size));
 	free(ptr);
--- conga/ricci/modules/storage/VG.cpp	2006/08/10 22:53:09	1.5
+++ conga/ricci/modules/storage/VG.cpp	2006/09/26 01:16:13	1.6
@@ -55,8 +55,8 @@
   int status;
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw String("execute failed");
-  if (status != 0)
-    throw String("vgdisplay failed");
+  if (status)
+    throw String("vgs failed");
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
        iter != lines.end();
--- conga/ricci/modules/storage/BDFactory.cpp	2006/08/10 22:53:09	1.3
+++ conga/ricci/modules/storage/BDFactory.cpp	2006/09/26 01:16:13	1.4
@@ -22,7 +22,6 @@
 
 
 #include "BDFactory.h"
-#include "ContentFactory.h"
 #include "MapperFactory.h"
 #include "LV.h"
 #include "Partition.h"
--- conga/ricci/modules/storage/LV.cpp	2006/08/10 22:53:09	1.5
+++ conga/ricci/modules/storage/LV.cpp	2006/09/26 01:16:13	1.6
@@ -118,8 +118,8 @@
     
     // adjust size based on snap_percent
     long long usage = _props.get("snapshot_usage_percent").get_int();
-    Variable size_var(_props.get("size"));
-    XMLObject xml(size_var.xml());
+    const Variable size_var(_props.get("size"));
+    const XMLObject xml(size_var.xml());
     long long size = size_var.get_int();
     long long min  = utils::to_long(xml.get_attr("min"));
     long long max  = utils::to_long(xml.get_attr("max"));
@@ -135,8 +135,8 @@
       _props.set(Variable("size", size, min, max, step));
   } else {
     // adjust size based on content
-    Variable size_var(_props.get("size"));
-    XMLObject xml(size_var.xml());
+    const Variable size_var(_props.get("size"));
+    const XMLObject xml(size_var.xml());
     long long size = size_var.get_int();
     long long min  = utils::to_long(xml.get_attr("min"));
     long long max  = utils::to_long(xml.get_attr("max"));
--- conga/ricci/modules/storage/MDRaid.cpp	2006/08/10 22:53:09	1.6
+++ conga/ricci/modules/storage/MDRaid.cpp	2006/09/26 01:16:13	1.7
@@ -116,7 +116,6 @@
 {
   bool active_old = _props.get("active").get_bool();
   bool active_new = mp.props.get("active").get_bool();
-  
   if (active_old && !active_new)
     // FIXME: umount FS before stoping, disabled for now (see constructor)
     mdadm::stop_raid(_raid);
--- conga/ricci/modules/storage/MDRaidTarget.cpp	2006/08/10 22:53:09	1.3
+++ conga/ricci/modules/storage/MDRaidTarget.cpp	2006/09/26 01:16:13	1.4
@@ -26,7 +26,6 @@
 #include "FSController.h"
 #include "defines.h"
 #include "utils.h"
-#include "ContentFactory.h"
 #include "ContentNone.h"
 
 



                 reply	other threads:[~2006-09-26  1:16 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=20060926011614.15768.qmail@sourceware.org \
    --to=kupcevic@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 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.