CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: [EMAIL PROTECTED] 2008-07-10 20:59:37
Modified files:
. : conga.spec.in.in
ricci/modules : Makefile
ricci/modules/cluster: ClusterModule.cpp Makefile
Added files:
ricci/modules/cluster: XVM.cpp XVM.h
Removed files:
ricci/modules/cluster: Virt.cpp Virt.h
Log message:
More functionality that depends on libvirt into its own module.
Fixes bz206570
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.89&r2=1.45.2.90
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/XVM.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/XVM.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterModule.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.5&r2=1.5.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.14.2.6&r2=1.14.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Virt.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.6&r2=NONE
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Virt.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.4&r2=NONE
--- conga/conga.spec.in.in 2008/06/13 18:37:46 1.45.2.89
+++ conga/conga.spec.in.in 2008/07/10 20:59:36 1.45.2.90
@@ -292,12 +292,13 @@
### changelog ###
%changelog
-* Mon Apr 27 2008 Ryan McCabe <[EMAIL PROTECTED]> 0.12.0-9
+* Thu Jul 10 2008 Ryan McCabe <[EMAIL PROTECTED]> 0.12.1-1
- Fix bz444938 (conga fails to create proper cluster.conf entries for gfs2
filesystem type)
- Fix bz444210 (Adding multiple fence devices at the same time causes
duplicate entries)
- Fix bz444381 (conga writes 'exportpath' instead of 'export' attribute for
netfs)
- Fix bz446907 (rpm -V luci fails)
- Fix bz450854 (luci doesn't start because of a missing dep /usr/bin/dc)
+- Fix bz206570 (RFE: vm list from ricci)
* Fri Apr 18 2008 Ryan McCabe <[EMAIL PROTECTED]> 0.12.0-8
- Fix bz441580 (conga should install 'sg3_utils' and start service
'scsi_reserve' when scsi fencing is used)
--- conga/ricci/modules/Makefile 2008/01/17 17:38:37 1.5.2.2
+++ conga/ricci/modules/Makefile 2008/07/10 20:59:36 1.5.2.3
@@ -15,6 +15,7 @@
${MAKE} -C rpm
${MAKE} -C log
${MAKE} -C service
+ ${MAKE} -C virt
clustermon:
${MAKE} -C cluster
@@ -24,6 +25,7 @@
${MAKE} -C rpm install
${MAKE} -C log install
${MAKE} -C service install
+ ${MAKE} -C virt install
install_clustermon:
${MAKE} -C cluster install
@@ -36,6 +38,7 @@
${MAKE} -C rpm clean
${MAKE} -C log clean
${MAKE} -C service clean
+ ${MAKE} -C virt clean
check:
/cvs/cluster/conga/ricci/modules/cluster/XVM.h,v --> standard output
revision 1.1.2.1
--- conga/ricci/modules/cluster/XVM.h
+++ - 2008-07-10 20:59:37.543925000 +0000
@@ -0,0 +1,41 @@
+/*
+** Copyright (C) Red Hat, Inc. 2006-2008
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License version 2 as
+** published by the Free Software Foundation.
+**
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; see the file COPYING. If not, write to the
+** Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
+** MA 02139, USA.
+*/
+
+#ifndef __CONGA_MODCLUSTER_XVM_H
+#define __CONGA_MODCLUSTER_XVM_H
+
+#include "String.h"
+#include <map>
+
+#define XVM_KEY_PATH "/etc/cluster/fence_xvm.key"
+#define XVM_KEY_MAX_SIZE 4096
+#define XVM_KEY_MIN_SIZE 128
+#define XVM_KEY_DEFAULT_SIZE 4096
+
+#define DMIDECODE_PATH "/usr/sbin/dmidecode"
+
+class XVM {
+ public:
+ static bool virt_guest(void);
+ static bool delete_xvm_key(void);
+ static bool set_xvm_key(const char *key_base64);
+ static char *get_xvm_key(void);
+ static bool generate_xvm_key(size_t key_bytes);
+};
+
+#endif
--- conga/ricci/modules/cluster/ClusterModule.cpp 2008/03/19 14:45:33
1.5.2.5
+++ conga/ricci/modules/cluster/ClusterModule.cpp 2008/07/10 20:59:36
1.5.2.6
@@ -27,7 +27,7 @@
#include "ClusterStatus.h"
#include "Clusvcadm.h"
#include "Fence.h"
-#include "Virt.h"
+#include "XVM.h"
#include "base64.h"
@@ -50,7 +50,6 @@
static VarMap set_xvm_key(const VarMap& args);
static VarMap get_xvm_key(const VarMap& args);
static VarMap generate_xvm_key(const VarMap& args);
-static VarMap list_vm(const VarMap& args);
static ApiFcnMap build_fcn_map();
@@ -88,7 +87,6 @@
api_1_0["get_xvm_key"] = get_xvm_key;
api_1_0["generate_xvm_key"] = generate_xvm_key;
api_1_0["virt_guest"] = virt_guest;
- api_1_0["list_vm"] = list_vm;
ApiFcnMap api_fcn_map;
@@ -227,7 +225,7 @@
VarMap
virt_guest(const VarMap& args)
{
- Variable var("virt_guest", Virt::virt_guest());
+ Variable var("virt_guest", XVM::virt_guest());
VarMap ret;
ret.insert(pair<String, Variable>(var.name(), var));
@@ -235,44 +233,8 @@
}
VarMap
-list_vm(const VarMap& args)
-{
- String hypervisor_uri = "";
-
- try {
- VarMap::const_iterator iter = args.find("hypervisor_uri");
-
- if (iter != args.end())
- hypervisor_uri = iter->second.get_string();
- } catch ( String e ) {
- throw APIerror(e);
- }
-
- if (!hypervisor_uri.size())
- hypervisor_uri = String(DEFAULT_HV_URI);
-
- std::map<String, String> vm_list = Virt::get_vm_list(hypervisor_uri);
-
- list<XMLObject> ids_list;
- for ( map<String,String>::iterator iter = vm_list.begin() ;
- iter != vm_list.end();
- iter++)
- {
- XMLObject id_xml("vm");
- id_xml.set_attr("domain", String(iter->first));
- id_xml.set_attr("status", String(iter->second));
- ids_list.push_back(id_xml);
- }
-
- Variable var("vm_list", ids_list);
- VarMap ret;
- ret.insert(pair<String, Variable>(var.name(), var));
- return ret;
-}
-
-VarMap
delete_xvm_key(const VarMap& args) {
- Virt::delete_xvm_key();
+ XVM::delete_xvm_key();
VarMap ret;
return ret;
}
@@ -293,7 +255,7 @@
throw APIerror(e);
}
- Virt::set_xvm_key(key_base64.c_str());
+ XVM::set_xvm_key(key_base64.c_str());
VarMap ret;
return ret;
}
@@ -302,7 +264,7 @@
get_xvm_key(const VarMap& args) {
char *key_base64 = NULL;
- key_base64 = Virt::get_xvm_key();
+ key_base64 = XVM::get_xvm_key();
Variable var("key_base64", String(key_base64));
memset(key_base64, 0, strlen(key_base64));
free(key_base64);
@@ -343,7 +305,7 @@
throw APIerror(e);
}
- Virt::generate_xvm_key(key_bytes);
+ XVM::generate_xvm_key(key_bytes);
VarMap ret;
return ret;
}
--- conga/ricci/modules/cluster/Makefile 2008/03/24 18:13:58 1.14.2.6
+++ conga/ricci/modules/cluster/Makefile 2008/07/10 20:59:36 1.14.2.7
@@ -22,15 +22,11 @@
ClusterStatus.o \
Clusvcadm.o \
Fence.o \
- Virt.o
+ XVM.o
PARANOID=0
INCLUDE += -I${top_srcdir}/common/
-CXXFLAGS += -DPARANOIA=$(PARANOID) -DVIRT_SUPPORT=$(VIRT_SUPPORT)
-
-ifeq ($(VIRT_SUPPORT), 1)
- LDFLAGS += -lvirt
-endif
+CXXFLAGS += -DPARANOIA=$(PARANOID)
ifeq ($(PARANOID), 1)
LDFLAGS += ${top_srcdir}/common/paranoid/*.o