From: alebre <al...@us...> - 2010-07-16 18:01:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via 35fdf5274510594097cbdaeff670b95f33df1df1 (commit) via f3cf7e6ca688d5e1adabdeed392b744453400a54 (commit) via ab810eedba82ed6731b347dcf379ebc34c224d01 (commit) via c2150acefeb7fa7022670a195efe2ff9a7310d02 (commit) via f689e67ac7c5b4630b07852943410c1160af895d (commit) via bd3ecaec690a95769898f92fe21fa946b2653214 (commit) via ff863be71dca87ef64657b7fb393ce3e1e6781a5 (commit) via 05fa834a1d7a1f0aac9a12f6c5d7452c7335a0da (commit) via 97273920e6102f2a72365334e16c403c8a77a630 (commit) via 6dc54aa27e83a5c4bb3f0796764e3c684bbae5cd (commit) via 51832b81b8a4aa5c17a70e544b3fe0b138e50bdc (commit) via 58f8b8c46185d85b4add8a1add58c93f494b3c6b (commit) via d9d5afc71b4843398348ed39e1261e0971a967ab (commit) via b2df163bc1676cb814135930aa092dd385f9dec9 (commit) via e8b99d2e2ae420580d027ae832d38877472bab06 (commit) via b7bab9834b1026b860e9cd8944dca5eee4eac5a4 (commit) via 139891819f6376cbf419372a0d830301c2f8a308 (commit) via a3b15b48fc3af345b7fc90bcfaf020d1cdb07436 (commit) via a1ea6fddea71c76f2e60ce627f382684d5079c9b (commit) via 4100459b5a1dd9e3d25119776e70966690b19d80 (commit) via cc9129d5e1ae3da23a250f4044826d5e339daf49 (commit) via 28dac08c8128d91eb33142051076e5be6579783f (commit) via e31870a1c90b14bd93bb5d7dd4b3dbad8db21838 (commit) via 76e477595b08b7ab285695b26da33b5eda2b5633 (commit) via 3cd29a62d1a9add320d76f7ed40d7260a2d4656c (commit) via 7d49161efa05bef0b2ddb516502b6f6e27ffe831 (commit) via 08a4ca7ad0b2eb4cfea69676ec8b08598da47e20 (commit) via 45c36eed1382491b832d098ab0d96dd8525bc260 (commit) from e85c92f17d0969a80f3e9ea0a0147ee14b215772 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 35fdf5274510594097cbdaeff670b95f33df1df1 Author: ad <leb...@fr...> Date: Fri Jul 16 08:35:28 2010 +0000 adding a dummy compilation script diff --git a/scripts/compile-tools b/scripts/compile-tools index 907b3df..662f171 100755 --- a/scripts/compile-tools +++ b/scripts/compile-tools @@ -1,4 +1,4 @@ ./autogen.sh - ./configure --disable-kernel + ./configure --disable-kernel --sysconfdir=/etc make sudo make install diff --git a/tools/Makefile.am b/tools/Makefile.am index 839edb6..b933e82 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -6,8 +6,8 @@ ### Author: ### Jean Parpaillon <jea...@ke...> ### - -sbindir=$(exec-prefix)/sbin +# Commented by Adrien +#sbindir=$(exec-prefix)/sbin dist_sbin_SCRIPTS = krginit_helper krg_legacy_scheduler bin_PROGRAMS = migrate checkpoint restart krgcapset krgcr-run ipccheckpoint ipcrestart commit f3cf7e6ca688d5e1adabdeed392b744453400a54 Merge: e85c92f ab810ee Author: root <root@krgserver.dirty.world> Date: Tue Jul 6 15:06:25 2010 +0000 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/tools commit ab810eedba82ed6731b347dcf379ebc34c224d01 Author: Jean Parpaillon <jea...@ke...> Date: Wed Jun 30 15:37:12 2010 +0200 Update Kerrighed version to 3.0.0 diff --git a/configure.ac b/configure.ac index 4a88d81..337bbb5 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AC_PREREQ(2.59) dnl mandatory stuff define([project], [kerrighed]) define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/]project[-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT(project, [3.0rc1]gitversion, [ker...@ir...]) +AC_INIT(project, [3.0.0]gitversion, [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit c2150acefeb7fa7022670a195efe2ff9a7310d02 Author: Jean Parpaillon <jea...@ke...> Date: Wed Jun 30 15:36:12 2010 +0200 Remove local definition of CFLAGS to use global one (in configure.ac) diff --git a/tests/apps/Makefile.am b/tests/apps/Makefile.am index 44c0bf0..b1c5af3 100644 --- a/tests/apps/Makefile.am +++ b/tests/apps/Makefile.am @@ -6,8 +6,6 @@ ### Authors: ### Jean Parpaillon <jea...@ke...> ### -AM_CFLAGS = -Wall -Werror - bin_PROGRAMS = bi bi-cr bi-cr-static bi-file bi-signal bi-double \ bi-clone-files bi-clone-fs bi-clone-semundo bi-thread bi-server-socket \ bi-pipe bi-exclude-mm bi-cr-disable \ commit f689e67ac7c5b4630b07852943410c1160af895d Author: Matthieu Fertré <mat...@ke...> Date: Wed Jun 16 18:02:32 2010 +0200 [KTP] Add test cr_blender to check behavior of blender after checkpointing/restarting The test is simply skipped if blender is not installed. diff --git a/tests/ktp/cr/Makefile.am b/tests/ktp/cr/Makefile.am index 98a5a50..f81568c 100644 --- a/tests/ktp/cr/Makefile.am +++ b/tests/ktp/cr/Makefile.am @@ -53,9 +53,14 @@ tests_SCRIPTS = \ cr_pipe01 \ cr_pipe02 \ cr_exclude_mm01 \ + cr_blender \ lib_cr.sh \ lib_cr_ipc.sh +tests_DATA = \ + duck11_peaking.blend \ + duck11_peaking_render_1.png + testsdir = @ltpbase@/testcases/bin -EXTRA_DIST = $(tests_SCRIPTS) +EXTRA_DIST = $(tests_SCRIPTS) $(tests_DATA) diff --git a/tests/ktp/cr/cr_blender b/tests/ktp/cr/cr_blender new file mode 100644 index 0000000..4c9bcfa --- /dev/null +++ b/tests/ktp/cr/cr_blender @@ -0,0 +1,95 @@ +#!/bin/bash +############################################################################### +## +## Copyright (c) INRIA, 2007 +## +## This program is free software; you can redistribute it and#or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## 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; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## +############################################################################### +# +# Description: Test program for Kerrighed checkpoint/restart with blender. +# This test is basically a copy of cr10 +# +# Author: Matthieu Fertré, mat...@ke... +# + +source `dirname $0`/lib_cr.sh + +description="Run, C, K, R, C, K, R, R (EBUSY), K, R - Blender" + +TESTCMD="blender-bin" +inputbl="`dirname $0`/duck11_peaking.blend" +outputchecked="`dirname $0`/duck11_peaking_render_1.png" + +# Run, C, K, R, C, K, R, R (EBUSY), K, R +cr_blender() +{ + TCID="$FUNCNAME" # Identifier of this testcase. + TST_COUNT=$[$TST_COUNT+1] # Test case number. + + # look for Blender + which $TESTCMD > /dev/null + if [ $? -ne 0 ]; then + tst_resm TWARN "Can not run this test if $TESTCMD is not installed" + return 0 # to not stop krgltp + fi + + if [ ! -f $inputbl ]; then + tst_resm TWARN "Can not run this test if $inputbl is not installed" + return 0 # to not stop krgltp + fi + + if [ ! -f $outputchecked ]; then + tst_resm TWARN "Can not run this test if $outputchecked is not installed" + return 0 # to not stop krgltp + fi + + local output="$CHKPTDIR/render_krg_$$_#" + local renderoptions="-F PNG -f 1" + + TESTCMD_OPTIONS="-b $inputbl -o $output $renderoptions" + runcommand +CHECKPOINTABLE 1 nosync || return $? + + # let the process really begin + sleep 20 + + checkpoint_process $PID $TESTCMD || return $? + + kill_group $PID $TESTCMD || return $? + + restart_process $PID 1 $TESTCMD || return $? + + checkpoint_process $PID $TESTCMD || return $? + + kill_group $PID $TESTCMD || return $? + + restart_process $PID 2 $TESTCMD || return $? + + restart_process_must_fail $PID 1 $TESTCMD || return $? + + kill_group $PID $TESTCMD || return $? + + restart_foreground_process $PID 2 $TESTCMD || return $? + + # check image are the same + diff -q $outputchecked $CHKPTDIR/render_krg_$$_1.png || return $? + + print_success $? + return $? +} + +CR_setup $@ || exit $? + +cr_blender || exit $? diff --git a/tests/ktp/cr/duck11_peaking.blend b/tests/ktp/cr/duck11_peaking.blend new file mode 100644 index 0000000..b23a513 Binary files /dev/null and b/tests/ktp/cr/duck11_peaking.blend differ diff --git a/tests/ktp/cr/duck11_peaking_render_1.png b/tests/ktp/cr/duck11_peaking_render_1.png new file mode 100644 index 0000000..c40517e Binary files /dev/null and b/tests/ktp/cr/duck11_peaking_render_1.png differ diff --git a/tests/ktp/cr/lib_cr.sh b/tests/ktp/cr/lib_cr.sh index f2963d2..5bbcd8b 100755 --- a/tests/ktp/cr/lib_cr.sh +++ b/tests/ktp/cr/lib_cr.sh @@ -498,6 +498,29 @@ restart_process_must_fail() return $r } +restart_foreground_process() +{ + local _pid=$1 + local _version=$2 + local _name=$3 + local r=0 + + # Restart process + restart -q -f $_pid $_version + + r=$? + if [ $r -ne 0 ]; then + tst_brkm TFAIL NULL \ + "restart_foreground: failed to restart $_pid $version" + return $r + fi + + LTP_print_step_info \ + "restart_foreground $_pid $_name: $r" + + return $r +} + ############################################################################### skip_test_if_only_one_node() commit bd3ecaec690a95769898f92fe21fa946b2653214 Author: Matthieu Fertré <mat...@ke...> Date: Wed Jun 16 15:53:47 2010 +0200 [KTP] lib_cr.sh: use a variable for "/var/chkpt" diff --git a/tests/ktp/cr/lib_cr.sh b/tests/ktp/cr/lib_cr.sh index c498863..f2963d2 100755 --- a/tests/ktp/cr/lib_cr.sh +++ b/tests/ktp/cr/lib_cr.sh @@ -31,6 +31,7 @@ TESTCMD="bi-cr" TESTCMD_OPTIONS="-q" TEST_STEP=0 +CHKPTDIR="/var/chkpt" LTP_print_info() { @@ -68,7 +69,7 @@ move_task_file_to_make_restart_fail() local r=0 local version=`awk '$1=="Version:" {print $2}' /tmp/chkpt_result${_pid}` - local filechkpt=/var/chkpt/${_pid}/v${version}/task_${_pid}.bin + local filechkpt=$CHKPTDIR/${_pid}/v${version}/task_${_pid}.bin mv $filechkpt $filechkpt.old r=$? @@ -82,7 +83,7 @@ move_task_back_file_to_make_restart_ok() local r=0 local version=`awk '$1=="Version:" {print $2}' /tmp/chkpt_result${_pid}` - local filechkpt=/var/chkpt/${_pid}/v${version}/task_${_pid}.bin + local filechkpt=$CHKPTDIR/${_pid}/v${version}/task_${_pid}.bin mv $filechkpt.old $filechkpt r=$? @@ -98,7 +99,7 @@ check_written_files() # check if checkpoint is really written on disk # TODO: factorize(1) local version=`awk '$1=="Version:" {print $2}' /tmp/chkpt_result${_pid}` - local filechkpt=/var/chkpt/${_pid}/v${version}/task_${_pid}.bin + local filechkpt=$CHKPTDIR/${_pid}/v${version}/task_${_pid}.bin stat $filechkpt > /dev/null 2>&1 r=$? @@ -835,7 +836,7 @@ CR_internal_cleanup() CR_cleanup() { killall `echo "$TESTCMD" | cut -f1 -d" "` > /dev/null 2>&1 - rm -rf /var/chkpt/* > /dev/null 2>&1 + rm -rf $CHKPTDIR/* > /dev/null 2>&1 rm -rf /tmp/chkpt_result* > /dev/null 2>&1 rm -rf /tmp/ps_* > /dev/null 2>&1 rm -rf /tmp/ktp_sync_* > /dev/null 2>&1 commit ff863be71dca87ef64657b7fb393ce3e1e6781a5 Author: Matthieu Fertré <mat...@ke...> Date: Wed Jun 16 18:03:28 2010 +0200 restart: add an option to restart an application in frozen state. The option is -U|--no-unfreeze. diff --git a/man/restart.1.xml b/man/restart.1.xml index e8bf88d..b3beb66 100644 --- a/man/restart.1.xml +++ b/man/restart.1.xml @@ -55,6 +55,17 @@ </varlistentry> <varlistentry> + <term><option>-U</option></term> + <term><option>--no-unfreeze</option></term> + <listitem> + <para>Restore the application in FROZEN state. Application can then + be unfrozen using <command>checkpoint</command> with the + appropriate option. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-t</option></term> <term><option>--replace-tty</option></term> <listitem> diff --git a/tools/restart.c b/tools/restart.c index 6aba49b..20e72db 100644 --- a/tools/restart.c +++ b/tools/restart.c @@ -30,6 +30,7 @@ int options = 0; #define STDIN_OUT_ERR 2 #define QUIET 4 #define DEBUG 8 +#define NOUNFREEZE 16 struct cr_subst_files_array substitution; @@ -54,6 +55,7 @@ void show_help(char * program_name) "Options:\n" " -h|--help Display this information and exit\n" " -v|--version Display version information\n" + " -U|--no-unfreeze Leave the application frozen after the restart\n" " -t|--replace-tty Replace application original terminal by the current one\n" " -f|--foreground Restart the application in foreground\n" " -p|--pids Replace application orphan pgrp and sid by the ones of restart\n" @@ -269,7 +271,7 @@ int parse_args(int argc, char *argv[]) char *checkpoint_dir; char c; int r, option_index = 0; - char * short_options= "hvftps:qd"; + char * short_options= "hvftps:Uqd"; static struct option long_options[] = { {"help", no_argument, 0, 'h'}, @@ -278,6 +280,7 @@ int parse_args(int argc, char *argv[]) {"tty", no_argument, 0, 't'}, {"pids", no_argument, 0, 'p'}, {"substitute-file", required_argument, 0, 's'}, + {"no-unfreeze", no_argument, 0, 'U'}, {"quiet", no_argument, 0, 'q'}, {"debug", no_argument, 0, 'd'}, {0, 0, 0, 0} @@ -313,6 +316,9 @@ int parse_args(int argc, char *argv[]) case 'd': options |= DEBUG; break; + case 'U': + options |= NOUNFREEZE; + break; default: show_help(argv[0]); exit(EXIT_FAILURE); @@ -449,16 +455,24 @@ int main(int argc, char *argv[]) goto exit; } - r = application_unfreeze_from_appid(appid, 0); - if (r) { - fprintf(stderr, "restart: fail to unfreeze application %ld: " - "%s\n", appid, strerror(errno)); - goto exit; - } + if (!(options & NOUNFREEZE)) { + r = application_unfreeze_from_appid(appid, 0); + if (r) { + fprintf(stderr, "restart: fail to unfreeze application %ld: " + "%s\n", appid, strerror(errno)); + goto exit; + } - if (!(options & QUIET)) - printf("Application %ld has been successfully restarted\n", - appid); + if (!(options & QUIET)) + printf("Application %ld has been successfully restarted\n", + appid); + } else { + if (!(options & QUIET)) + printf("Application %ld has been successfully restored " + "in *FROZEN* state. You can unfreeze it using " + "'checkpoint -u'\n", + appid); + } if (options & FOREGROUND) wait_application_exits(); commit 05fa834a1d7a1f0aac9a12f6c5d7452c7335a0da Author: Matthieu Fertré <mat...@ke...> Date: Mon Jun 7 16:03:49 2010 +0200 Checkpoint: install a signal handler to avoid leaving with frozen application diff --git a/tools/checkpoint.c b/tools/checkpoint.c index 48622de..3dc1fde 100644 --- a/tools/checkpoint.c +++ b/tools/checkpoint.c @@ -32,6 +32,7 @@ typedef enum { short from_appid = 0; short quiet = 0; short no_callbacks = 0; +short interrupted_by_signal = 0; int sig = 0; int flags = 0; char * description = NULL; @@ -278,8 +279,16 @@ void clean_checkpoint_dir(struct checkpoint_info *info) int checkpoint_app(long pid, int flags, short _quiet) { int r; - struct checkpoint_info info; + + if (interrupted_by_signal) { + fprintf(stderr, + "checkpoint: interrupted by signal before " + "checkpointing\n"); + r = -1; + goto err; + } + if (from_appid) { if (!_quiet) printf("Checkpointing application %ld...\n", pid); @@ -301,6 +310,7 @@ int checkpoint_app(long pid, int flags, short _quiet) clean_checkpoint_dir(&info); } +err: return r; } @@ -308,6 +318,13 @@ int freeze_app(long pid, int _quiet) { int r; + if (interrupted_by_signal) { + fprintf(stderr, + "checkpoint: interrupted by signal before freezing\n"); + r = -1; + goto err; + } + if (!no_callbacks) { r = cr_execute_chkpt_callbacks(pid, from_appid); if (r) { @@ -341,6 +358,19 @@ int unfreeze_app(long pid, int signal, short _quiet) { int r; + if (interrupted_by_signal) { + if (action == ALL) { + fprintf(stderr, + "checkpoint: ignoring interruption signal\n"); + } else { + fprintf(stderr, + "checkpoint: interrupted by signal before " + "unfreezing\n"); + r = -1; + goto err; + } + } + if (!no_callbacks) { r = cr_execute_continue_callbacks(pid, from_appid); if (r) { @@ -396,10 +426,17 @@ err_chkpt: return r; } + +void handle_signal(int signum) +{ + interrupted_by_signal = 1; +} + int main(int argc, char *argv[]) { int r = 0; long pid = -1; + struct sigaction sigh; /* Manage options with getopt */ parse_args(argc, argv); @@ -419,6 +456,18 @@ int main(int argc, char *argv[]) goto exit; } + /* + * put a signal handler to avoid, for instance, exiting + * without unfreezing the application. + */ + sigh.sa_handler = &handle_signal; + r = sigaction(SIGINT, &sigh, NULL); + if (r) + perror("sigaction"); + r = sigaction(SIGTERM, &sigh, NULL); + if (r) + perror("sigaction"); + switch (action) { case CHECKPOINT: r = checkpoint_app(pid, flags, quiet); commit 97273920e6102f2a72365334e16c403c8a77a630 Author: Matthieu Fertré <mat...@ke...> Date: Mon Jun 14 15:09:25 2010 +0200 [BUGFIX] Fix build of ipcshm-tool diff --git a/tests/apps/ipcshm-tool.c b/tests/apps/ipcshm-tool.c index 5d9630e..ddded4f 100644 --- a/tests/apps/ipcshm-tool.c +++ b/tests/apps/ipcshm-tool.c @@ -235,7 +235,7 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } shm_size = buf.st_size; - print_msg("%d: size: %zd\n", shmid, shm_size); + print_msg("size: %zd\n", shm_size); } shmid = create_shm(argv[argc-1]); commit 6dc54aa27e83a5c4bb3f0796764e3c684bbae5cd Author: Renaud Lottiaux <Ren...@ke...> Date: Mon Jun 7 16:32:30 2010 +0200 Update the ChangeLog file. diff --git a/ChangeLog b/ChangeLog index a6da7a1..f5dada1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ +Kerrighed version 3.0.0 * [kernel] Port to linux 2.6.30 + Features: Checkpoint/restart * Add various options to checkpoint and restart @@ -18,6 +20,7 @@ * [kernel] Many bugfixes in socket migration * [kernel] Support migration / remote fork of chrooted applications * [kernel] Many migration fixes + * [kernel] Support migration/distant fork of swapping processes. * Remove limitation on number of concurrent executions in KTP Kerrighed version 2.4.4 commit 51832b81b8a4aa5c17a70e544b3fe0b138e50bdc Author: Matthieu Fertré <mat...@ke...> Date: Mon Jun 7 15:15:19 2010 +0200 C/R: Remove function krg_check_checkpoint() krg_check_checkpoint() was only used to check if /var/chkpt exists. The problem is that it prevent to get a clear message in case of failure because the dirname gets hidden. The function may be reintroduced one day if there is a way to check if the kernel supports checkpointing. diff --git a/libs/libkerrighed/libproc.c b/libs/libkerrighed/libproc.c index b25ff2c..5ff1100 100644 --- a/libs/libkerrighed/libproc.c +++ b/libs/libkerrighed/libproc.c @@ -26,20 +26,6 @@ /* */ /*****************************************************************************/ -int krg_check_checkpoint(void) -{ - struct stat buffer; - int status; - - status = stat(CHKPT_DIR, &buffer); - if (status) { - errno = ENOENT; - return -1; - } - - return 0; -} - /* Return the node id of the local machine */ int get_node_id (void) diff --git a/tools/checkpoint.c b/tools/checkpoint.c index e869095..48622de 100644 --- a/tools/checkpoint.c +++ b/tools/checkpoint.c @@ -10,6 +10,7 @@ #include <stdlib.h> #include <stdio.h> #include <signal.h> +#include <sys/stat.h> #include <errno.h> #include <fcntl.h> #include <string.h> @@ -142,20 +143,20 @@ void parse_args(int argc, char *argv[]) void check_environment(void) { + struct stat buffer; int ret; /* is Kerrighed launched ? */ ret = krg_check_hotplug(); - if (ret) - { + if (ret) { perror("Kerrighed is not started"); exit(EXIT_FAILURE); } - /* Is checkpoint available ? */ - ret = krg_check_checkpoint(); + /* Does /var/chkpt exist ? */ + ret = stat(CHKPT_DIR, &buffer); if (ret) { - perror("Checkpointing is not available"); + perror(CHKPT_DIR); exit(EXIT_FAILURE); } } diff --git a/tools/restart.c b/tools/restart.c index 12ed5a4..6aba49b 100644 --- a/tools/restart.c +++ b/tools/restart.c @@ -21,8 +21,6 @@ #include <config.h> -#define CHKPT_DIR "/var/chkpt" - long appid; int version; int flags = 0; @@ -403,20 +401,20 @@ void wait_application_exits() void check_environment(void) { struct stat buffer; - int status; + int ret; /* is Kerrighed launched ? */ - if (get_nr_nodes() == -1) - { - fprintf(stderr, "no kerrighed nodes found\n"); - exit(-EPERM); + ret = krg_check_hotplug(); + if (ret) { + perror("Kerrighed is not started"); + exit(EXIT_FAILURE); } - /* /var/chkpt exists ? */ - status = stat(CHKPT_DIR, &buffer); - if (status) { + /* Does /var/chkpt exist ? */ + ret = stat(CHKPT_DIR, &buffer); + if (ret) { perror(CHKPT_DIR); - exit(-ENOENT); + exit(EXIT_FAILURE); } } commit 58f8b8c46185d85b4add8a1add58c93f494b3c6b Author: Matthieu Fertré <mat...@ke...> Date: Thu Jun 3 14:17:15 2010 +0200 [tests] ipcshm-tool can get its message from a file In addition, the size of the SHM is created at exactly the needed size to store the initial message. That means that next writings will be limited to that length. diff --git a/tests/apps/ipcshm-tool.c b/tests/apps/ipcshm-tool.c index 5b8bcf5..5d9630e 100644 --- a/tests/apps/ipcshm-tool.c +++ b/tests/apps/ipcshm-tool.c @@ -1,23 +1,40 @@ #include <errno.h> +#include <fcntl.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ipc.h> +#include <sys/mman.h> #include <sys/shm.h> +#include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include "libbi.h" #define KTP_TEST 1 -#define SHM_SIZE 1024 +#define DEFAULT_SHM_SIZE 1024 -int create = 0; int use_id = 0; int quiet = 0; int nb_loops = 0; -char msg[SHM_SIZE]; +size_t shm_size = DEFAULT_SHM_SIZE; + +typedef enum { + NONE, + CREATE, + CREATE_FROM_FILE, + DELETE, + READ, + WRITE, + WRITE_FROM_FILE +} action_t; + +action_t action; + +char *msg = NULL; +char *path_msg = NULL; key_t get_key(const char* path) { @@ -39,7 +56,7 @@ int create_shm(const char* path) if (key == -1) return -1; - shmid = shmget(key, SHM_SIZE, 0644 | IPC_CREAT | IPC_EXCL); + shmid = shmget(key, shm_size, 0644 | IPC_CREAT | IPC_EXCL); if (shmid == -1) fprintf(stderr, "create_shm(%s)::shmget: %s\n", path, strerror(errno)); @@ -51,16 +68,27 @@ int create_shm(const char* path) int get_shm(const char* path) { key_t key; - int shmid = -1; + struct shmid_ds buf; + int shmid = -1, r; key = get_key(path); if (key == -1) return -1; shmid = shmget(key, 0, 0); - if (shmid == -1) + if (shmid == -1) { fprintf(stderr, "get_shm(%s)::shmget: %s\n", path, strerror(errno)); + return shmid; + } + + r = shmctl(shmid, IPC_STAT, &buf); + if (r) { + fprintf(stderr, "get_shm(%s)::shmctl: %s\n", path, + strerror(errno)); + return r; + } + shm_size = buf.shm_segsz; return shmid; } @@ -89,6 +117,9 @@ void print_usage(const char* cmd) printf("%s -c\"message\" /path/to/shm:" " initialiaze a shm\n", cmd); + printf("%s -C\"/path/to/file/containing/message\" /path/to/shm:" + " initialiaze a shm\n", cmd); + printf("%s -d {/path/to/shm | -i <shmid>}:" " delete a shm\n", cmd); @@ -98,6 +129,9 @@ void print_usage(const char* cmd) printf("%s -w\"message\" {/path/to/shm | -i <shmid>}:" " write to a shm\n", cmd); + + printf("%s -W\"/path/to/file/containing/message\" {/path/to/shm | -i <shmid>}:" + " write to a shm\n", cmd); } void parse_args(int argc, char *argv[]) @@ -106,12 +140,13 @@ void parse_args(int argc, char *argv[]) while (1) { - c = getopt(argc, argv, "c:w:r:diqh"); + c = getopt(argc, argv, "c:C:w:W:r:diqh"); if (c == -1) break; switch (c) { case 'r': + action = READ; nb_loops = atoi(optarg); if (nb_loops <= 0) { fprintf(stderr, "Invalid value for -r options\n"); @@ -119,14 +154,24 @@ void parse_args(int argc, char *argv[]) } break; case 'c': - create = 1; - strncpy(msg, optarg, SHM_SIZE); + action = CREATE; + shm_size = strlen(optarg)+1; + msg = optarg; + break; + case 'C': + action = CREATE_FROM_FILE; + path_msg = optarg; break; case 'w': - strncpy(msg, optarg, SHM_SIZE); + action = WRITE; + msg = optarg; + break; + case 'W': + action = WRITE_FROM_FILE; + path_msg = optarg; break; case 'd': - create = -1; + action = DELETE; break; case 'i': use_id = 1; @@ -157,7 +202,7 @@ void print_msg(const char *format, ...) int main(int argc, char* argv[]) { - int shmid; + int shmid, r; char *data; if (argc < 3) { @@ -167,43 +212,81 @@ int main(int argc, char* argv[]) parse_args(argc, argv); - if (use_id && create == 1) { - fprintf(stderr, "** incompatible options used: -c and -i\n"); + if (action == NONE) { + print_usage(argv[0]); exit(EXIT_FAILURE); } - if (create == 1) { - shmid = create_shm(argv[argc-1]); - } else { + if (action == CREATE || action == CREATE_FROM_FILE) { + if (use_id) { - shmid = atoi(argv[argc-1]); - } else { - shmid = get_shm(argv[argc-1]); + fprintf(stderr, "** incompatible options used: -c|-C and -i\n"); + exit(EXIT_FAILURE); } - if (create == -1) { /* user wants to remove the SHM object */ - int r; - r = delete_shm(shmid); - if (r) + if (action == CREATE) + shm_size = strlen(msg) + 1; + else { + /* CREATE_FROM_FILE */ + struct stat buf; + r = stat(path_msg, &buf); + if (r) { + perror("stat"); exit(EXIT_FAILURE); - - exit(EXIT_SUCCESS); + } + shm_size = buf.st_size; + print_msg("%d: size: %zd\n", shmid, shm_size); } + + shmid = create_shm(argv[argc-1]); + + } else if (use_id) { + shmid = atoi(argv[argc-1]); + } else { + shmid = get_shm(argv[argc-1]); } if (shmid == -1) exit(EXIT_FAILURE); + if (action == DELETE) { + r = delete_shm(shmid); + if (r) + exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); + } + data = shmat(shmid, (void *)0, 0); if (data == (char *)(-1)) { perror("shmat"); exit(EXIT_FAILURE); } - if (nb_loops == 0) { - strncpy(data, msg, SHM_SIZE); + if (action == CREATE || action == WRITE) { + memcpy(data, msg, shm_size); print_msg("%d:%s\n", shmid, msg); + } else if (action == CREATE_FROM_FILE || action == WRITE_FROM_FILE) { + r = open(path_msg, O_RDONLY); + if (r == -1) { + perror("open"); + exit(EXIT_FAILURE); + } + + msg = mmap(NULL, shm_size, PROT_READ, MAP_PRIVATE, r, 0); + if (msg == MAP_FAILED) { + perror("mmap"); + exit(EXIT_FAILURE); + } + + memcpy(data, msg, shm_size); + + munmap(msg, shm_size); + + close(r); + + print_msg("%d:%s\n", shmid, data); } else { + /* action == READ */ int i; for (i = 0; i < nb_loops; i++) { @@ -213,11 +296,12 @@ int main(int argc, char* argv[]) do_one_loop(i, &n); #ifdef KTP_TEST if (strncmp(data, "KTP REQ CHANGE", 15) == 0) - strncpy(data, "KTP CHANGE DONE", SHM_SIZE); + strncpy(data, "KTP CHANGE DONE", shm_size); #endif } } + if (shmdt(data) == -1) { perror("shmdt"); exit(EXIT_FAILURE); commit d9d5afc71b4843398348ed39e1261e0971a967ab Author: Matthieu Fertré <mat...@ke...> Date: Mon Jun 7 14:48:04 2010 +0200 [KTP] Let cr_ipc_shm* store fixed size content in SHM diff --git a/tests/ktp/cr/cr_ipc_shm01 b/tests/ktp/cr/cr_ipc_shm01 index 42ba971..3c4ffa2 100644 --- a/tests/ktp/cr/cr_ipc_shm01 +++ b/tests/ktp/cr/cr_ipc_shm01 @@ -35,7 +35,7 @@ cr_ipc_shm01() TST_COUNT=$[$TST_COUNT+1] # Test case number. local shmpath=`mktemp -d` - local written_msg="$RANDOM" + local written_msg=`generate_fixed_size_random_msg` # create the shm and get its identifier create_sysv_shm $shmpath $written_msg || return $? @@ -59,14 +59,14 @@ cr_ipc_shm01() check_sysv_shm_value $SHMID $shmpath "$written_msg" || return $? - written_msg="$RANDOM" + written_msg=`generate_fixed_size_random_msg` write_sysv_shm_value $SHMID $shmpath "$written_msg" || return $? check_sysv_shm_value $SHMID $shmpath "$written_msg" || return $? dump_sysv_shm $SHMID $shmpath $shmpath/shm_v2.bin || return $? - written_msg="$RANDOM" + written_msg=`generate_fixed_size_random_msg` write_sysv_shm_value $SHMID $shmpath "$written_msg" || return $? dump_sysv_shm $SHMID $shmpath $shmpath/shm_v3.bin || return $? diff --git a/tests/ktp/cr/cr_ipc_shm02 b/tests/ktp/cr/cr_ipc_shm02 index d63ed36..cb0b4d5 100644 --- a/tests/ktp/cr/cr_ipc_shm02 +++ b/tests/ktp/cr/cr_ipc_shm02 @@ -38,7 +38,7 @@ cr_ipc_shm02() TST_COUNT=$[$TST_COUNT+1] # Test case number. # create the shm and get its identifier - local written_msg="$RANDOM" + local written_msg=`generate_fixed_size_random_msg` local shmpath=`mktemp -d` create_sysv_shm $shmpath $written_msg || return $? diff --git a/tests/ktp/cr/lib_cr_ipc.sh b/tests/ktp/cr/lib_cr_ipc.sh index db68ef7..864a8e6 100644 --- a/tests/ktp/cr/lib_cr_ipc.sh +++ b/tests/ktp/cr/lib_cr_ipc.sh @@ -60,6 +60,17 @@ wait_other_instances() # SYSTEM V SHM ########################################################################### +generate_fixed_size_random_msg() +{ + local length=10 + local msg="" + for i in `seq 1 $length`; do + msg="$RANDOM$msg" + done + msg=`echo $msg|cut -b 10` + echo $msg +} + create_sysv_shm() { local shm_path=$1 commit b2df163bc1676cb814135930aa092dd385f9dec9 Author: Matthieu Fertré <mat...@ke...> Date: Fri Jun 4 15:22:59 2010 +0200 [KTP] C/R: add test checking behavior of freeze/unfreeze diff --git a/tests/ktp/cr/Makefile.am b/tests/ktp/cr/Makefile.am index bb5d9e6..98a5a50 100644 --- a/tests/ktp/cr/Makefile.am +++ b/tests/ktp/cr/Makefile.am @@ -36,6 +36,7 @@ tests_SCRIPTS = \ cr_clone_files01 \ cr_clone_fs01 \ cr_clone_semundo01 \ + cr_freeze_unfreeze \ cr_stress \ cr_tree01 \ cr_tree02 \ diff --git a/tests/ktp/cr/cr_freeze_unfreeze b/tests/ktp/cr/cr_freeze_unfreeze new file mode 100644 index 0000000..102702f --- /dev/null +++ b/tests/ktp/cr/cr_freeze_unfreeze @@ -0,0 +1,86 @@ +#!/bin/bash +############################################################################### +## +## Copyright (c) Kerlabs, 2010 +## +## This program is free software; you can redistribute it and#or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## 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; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## +############################################################################### +# +# Description: Test program for Kerrighed checkpoint with options to freeze +# unfreeze, and checkpoint process. +# +# Author: Matthieu Fertré, mat...@ke... +# + +source `dirname $0`/lib_cr.sh + +description="Freeze/unfreeze: Run, F, U, F, C, U, F, C, C, U, F, F(fail), U, U(fail)..." + +cr_freeze_unfreeze() +{ + TCID="$FUNCNAME" # Identifier of this testcase. + TST_COUNT=$[$TST_COUNT+1] # Test case number. + + runcommand +CHECKPOINTABLE || return $? + + freeze_process $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + + freeze_process $PID $TESTCMD || return $? + + checkpoint_frozen_process $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + + freeze_process $PID $TESTCMD || return $? + + checkpoint_frozen_process $PID $TESTCMD || return $? + + checkpoint_frozen_process $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + + freeze_process $PID $TESTCMD || return $? + + freeze_process_must_fail $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + unfreeze_process_must_fail $PID $TESTCMD || return $? + + checkpoint_frozen_process_must_fail $PID $TESTCMD || return $? + + + freeze_process $PID $TESTCMD || return $? + + checkpoint_process_must_fail $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + + kill_group $PID $TESTCMD || return $? + + print_success $? + return $? +} + +CR_setup $@ || exit $? + +cr_freeze_unfreeze || exit $? diff --git a/tests/ktp/cr/lib_cr.sh b/tests/ktp/cr/lib_cr.sh index af74ceb..c498863 100755 --- a/tests/ktp/cr/lib_cr.sh +++ b/tests/ktp/cr/lib_cr.sh @@ -207,7 +207,6 @@ checkpoint_process_must_fail() return $r } - freeze_process() { local _pid=$1 @@ -228,6 +227,29 @@ freeze_process() return $r } +freeze_process_must_fail() +{ + local _pid=$1 + local _name=$2 + local r=0 + + checkpoint -f $_pid > /dev/null 2>&1 + + r=$? + if [ $r -eq 0 ]; then + tst_brkm TFAIL NULL \ + "freeze_process_must_fail: freeze process $_pid ($_name) should have failed" + r=1 + return $r + fi + + LTP_print_step_info \ + "freeze_must_fail: PID: $_pid, error: $r" + + r=0 + return $r +} + checkpoint_frozen_process() { local _pid=$1 @@ -256,6 +278,27 @@ checkpoint_frozen_process() return $r } +checkpoint_frozen_process_must_fail() +{ + local _pid=$1 + local _name=$2 + local r=0 + + checkpoint -c $_pid > /tmp/chkpt_result${_pid} 2>&1 + + r=$? + if [ $r -eq 0 ]; then + tst_brkm TFAIL NULL "checkpoint_frozen_must_fail: checkpoint $_pid ($_name) should have failed" + r = 1 + return $r + fi + + LTP_print_step_info \ + "checkpoint_frozen_must_fail: PID: $_pid, error: $r" + + r=0 + return $r +} unfreeze_process() { @@ -277,6 +320,29 @@ unfreeze_process() return $r } +unfreeze_process_must_fail() +{ + local _pid=$1 + local _name=$2 + local r=0 + + checkpoint -u $_pid > /dev/null 2>&1 + + r=$? + if [ $r -eq 0 ]; then + tst_brkm TFAIL NULL \ + "unfreeze_process_must_fail: unfreeze process $_pid ($_name) should have failed" + r=1 + return $r + fi + + LTP_print_step_info \ + "unfreeze_must_fail: PID: $_pid, error: $r" + + r=0 + return $r +} + ############################################################################### check_group_exists_in_ps() diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index 3d4d484..d067bf2 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -1709,6 +1709,7 @@ rsingle cr21 rsingle cr22 rsingle cr23 rsingle cr24 +r cr_freeze_unfreeze r cr_abort01 r cr_abort02 r cr_tree01 commit e8b99d2e2ae420580d027ae832d38877472bab06 Author: Louis Rilling <lou...@ke...> Date: Wed May 26 18:00:43 2010 +0200 [BUGFIX] kerrighed.init: Only configure schedulers and add nodes on the boot node Commit b9386ae7c235c5b138b418a16b0f2374fd43e0a5 ([tools] Update init scripts for new cluster start method) broke the ability to configure things only on one node, probably because the former method to distinguish the boot node from the others stopped working. Fix this using another detection method for the boot node: only the boot node should see only 1 online node. Note: with hot node remove this method will remain reliable, as long as 1) no node tries to remove other nodes before calling kerrighed.init locally, 2) and no node automatically removes itself by killing its Kerrighed container's init (from the host system). Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index c4b2754..a655f93 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -44,6 +44,13 @@ d_check_kerrighed() { return $? } +# +# Check if running on the boot node of the cluster, before adding other nodes +# +d_check_boot_node() { + [ "`krgadm nodes | grep -c online`" = "1" ] +} + d_start_scheduler() { log_progress_msg "scheduler" @@ -69,10 +76,14 @@ d_start_scheduler() { d_start() { log_daemon_msg "Starting $DESC" - d_start_scheduler || STATUS=1 - if [ -n "$ADD_OPTS" ]; then - log_progress_msg "nodes" - krgadm nodes add $ADD_OPTS > /dev/null || STATUS=1 + if d_check_boot_node; then + log_progress_msg "boot node" + + d_start_scheduler || STATUS=1 + if [ -n "$ADD_OPTS" ]; then + log_progress_msg "nodes" + krgadm nodes add $ADD_OPTS > /dev/null || STATUS=1 + fi fi log_end_msg ${STATUS:-0} commit b7bab9834b1026b860e9cd8944dca5eee4eac5a4 Author: Louis Rilling <lou...@ke...> Date: Wed Jun 2 13:19:14 2010 +0200 kerrighed.init: Fix misuse of log_daemon_msg Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index c73055b..c4b2754 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -71,7 +71,7 @@ d_start() { d_start_scheduler || STATUS=1 if [ -n "$ADD_OPTS" ]; then - log_daemon_msg "nodes" + log_progress_msg "nodes" krgadm nodes add $ADD_OPTS > /dev/null || STATUS=1 fi commit 139891819f6376cbf419372a0d830301c2f8a308 Author: Louis Rilling <lou...@ke...> Date: Wed May 26 17:48:56 2010 +0200 [BUGFIX] kerrighed.init: Fix error reporting And control better when to exit. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index c20f586..c73055b 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -20,8 +20,6 @@ # Description: Kerrighed services ### END INIT INFO -set -e - PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=kerrighed @@ -52,17 +50,17 @@ d_start_scheduler() { case "x$LEGACY_SCHED" in xtrue) krg_legacy_scheduler > /dev/null 2>&1 + return $? ;; xfalse) log_progress_msg "disabled in $CFG" + return 0 ;; *) log_progress_msg "value of LEGACY_SCHED in $CFG must be either 'true' or 'false'" - STATUS=1 + return 1 ;; esac - - return ${STATUS:-0} } # @@ -71,11 +69,10 @@ d_start_scheduler() { d_start() { log_daemon_msg "Starting $DESC" - d_start_scheduler + d_start_scheduler || STATUS=1 if [ -n "$ADD_OPTS" ]; then log_daemon_msg "nodes" - krgadm nodes add $ADD_OPTS > /dev/null - : ${STATUS:=$?} + krgadm nodes add $ADD_OPTS > /dev/null || STATUS=1 fi log_end_msg ${STATUS:-0} commit a3b15b48fc3af345b7fc90bcfaf020d1cdb07436 Author: Louis Rilling <lou...@ke...> Date: Tue Jun 1 18:32:10 2010 +0200 [JANITOR] kerrighed-host.init: cleanup error reporting And kill insane set -e. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index 26a0ee3..a814558 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -19,8 +19,6 @@ # Description: Initialize the Kerrighed container ### END INIT INFO -set -e - PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=kerrighed-host @@ -41,7 +39,6 @@ fi # d_check_kerrighed() { test -d /sys/kerrighed - return $? } # @@ -49,9 +46,6 @@ d_check_kerrighed() { # d_start_container() { krgboot_helper - ret=$? - - return $ret } # @@ -93,7 +87,9 @@ d_start() { if test "$(cat /sys/kerrighed/node_id)" = "$BOOT_ID"; then log_progress_msg "container" - if ! d_start_container; then + if [ "$STATUS" = "1" ]; then + log_progress_msg "not starting due to previous errors" + elif ! d_start_container; then log_progress_msg "(failed)"; STATUS=1 fi fi commit a1ea6fddea71c76f2e60ce627f382684d5079c9b Author: Alexandre Lissy <ale...@et...> Date: Tue Jun 1 18:24:48 2010 +0200 Syntax error in kerrighed-host script This fixes the following syntax error present in the init.d/kerrighed-host script : /etc/init.d/kerrighed-host status Kerrighed host status:/etc/init.d/kerrighed-host: 175: 0: not found Signed-off-by: Alexandre Lissy <ale...@et...> diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index 35b9e33..26a0ee3 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -133,7 +133,7 @@ d_stop() { d_status() { d_check_kerrighed ret=$? - if $ret; then + if [ $ret -eq 0 ]; then log_progress_msg "running Kerrighed kernel" else log_progress_msg "not running Kerrighed kernel" commit 4100459b5a1dd9e3d25119776e70966690b19d80 Author: Louis Rilling <lou...@ke...> Date: Tue Jun 1 18:33:19 2010 +0200 Revert "Fix typo in kerrighed-host.init" This reverts commit cc9129d5e1ae3da23a250f4044826d5e339daf49. The "fix" introduces another bug that hides the real one. A later commit fixes the real bug. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index 6ecb2a9..35b9e33 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -141,7 +141,7 @@ d_status() { return $ret } -if ! [ d_check_kerrighed ]; then +if ! d_check_kerrighed; then log_failure_msg "Not running a Kerrighed kernel" exit 0 else commit cc9129d5e1ae3da23a250f4044826d5e339daf49 Author: Jean Parpaillon <jea...@ke...> Date: Mon May 31 09:59:45 2010 +0200 Fix typo in kerrighed-host.init Thanks to lissyx diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index 35b9e33..6ecb2a9 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -141,7 +141,7 @@ d_status() { return $ret } -if ! d_check_kerrighed; then +if ! [ d_check_kerrighed ]; then log_failure_msg "Not running a Kerrighed kernel" exit 0 else commit 28dac08c8128d91eb33142051076e5be6579783f Author: Jean Parpaillon <jea...@ke...> Date: Thu May 27 16:30:38 2010 +0200 Improve version generation in configure.ac diff --git a/configure.ac b/configure.ac index 18d3006..4a88d81 100644 --- a/configure.ac +++ b/configure.ac @@ -9,8 +9,9 @@ dnl autoconf version AC_PREREQ(2.59) dnl mandatory stuff -define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/kerrighed-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT([Kerrighed], [3.0rc1]gitversion, [ker...@ir...]) +define([project], [kerrighed]) +define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/]project[-\([^-]\+\)//' | tr -d '\n' || true"]))dnl +AC_INIT(project, [3.0rc1]gitversion, [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit e31870a1c90b14bd93bb5d7dd4b3dbad8db21838 Author: Jean Parpaillon <jea...@ke...> Date: Thu May 27 11:57:19 2010 +0200 Fix version generation in configure.ac diff --git a/configure.ac b/configure.ac index c8f0f1e..18d3006 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_PREREQ(2.59) dnl mandatory stuff define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/kerrighed-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT([Kerrighed], [3.0-rc1gitversion], [ker...@ir...]) +AC_INIT([Kerrighed], [3.0rc1]gitversion, [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit 76e477595b08b7ab285695b26da33b5eda2b5633 Author: Jean Parpaillon <jea...@ke...> Date: Fri May 21 17:10:09 2010 +0200 Allow linux_version.sh script to be run from any directory diff --git a/linux_version.sh b/linux_version.sh index 122fabe..13401cd 100755 --- a/linux_version.sh +++ b/linux_version.sh @@ -1,3 +1,3 @@ #!/bin/sh -sed '/^vanilla_linux_version/!d; s/.*vanilla_linux_version=//' configure.ac +sed '/^vanilla_linux_version/!d; s/.*vanilla_linux_version=//' $(dirname $0)/configure.ac commit 3cd29a62d1a9add320d76f7ed40d7260a2d4656c Author: Jean Parpaillon <jea...@ke...> Date: Fri May 21 16:20:15 2010 +0200 Update version to 3.0rc1 diff --git a/configure.ac b/configure.ac index 7682b0a..c8f0f1e 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_PREREQ(2.59) dnl mandatory stuff define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/kerrighed-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT([Kerrighed], [3.0gitversion], [ker...@ir...]) +AC_INIT([Kerrighed], [3.0-rc1gitversion], [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit 7d49161efa05bef0b2ddb516502b6f6e27ffe831 Author: Jean Parpaillon <jea...@ke...> Date: Tue May 18 09:33:34 2010 +0200 [minor] Fix krg_check_* functions to follow C conventions Thanks to Matthieu's comments diff --git a/libs/include/hotplug.h b/libs/include/hotplug.h index 94ff078..cdc7984 100644 --- a/libs/include/hotplug.h +++ b/libs/include/hotplug.h @@ -38,7 +38,7 @@ int krg_hotplug_init(void); * * Check if we are in a running Kerrighed container * - * Return 0 if ok, 1 otherwise + * Return 0 if ok, -1 otherwise */ int krg_check_hotplug(void); @@ -47,7 +47,7 @@ int krg_check_hotplug(void); * * Check if Kerrighed container is already running * - * Return 0 if running, 1 otherwise + * Return 0 if running, -1 otherwise */ int krg_check_container(void); diff --git a/libs/include/proc.h b/libs/include/proc.h index 9e3ff7b..42f683a 100644 --- a/libs/include/proc.h +++ b/libs/include/proc.h @@ -14,7 +14,7 @@ * * Check if kerrighed support checkpoint * - * Return 0 if ok, 1 otherwise + * Return 0 if ok, -1 otherwise */ int krg_check_checkpoint(void); diff --git a/libs/libkerrighed/libhotplug.c b/libs/libkerrighed/libhotplug.c index cd5d404..80e09a9 100644 --- a/libs/libkerrighed/libhotplug.c +++ b/libs/libkerrighed/libhotplug.c @@ -367,7 +367,7 @@ int krg_check_hotplug(void) r = call_kerrighed_services(KSYS_GET_NODE_ID, &node_id); if (r != 0) { errno = EAGAIN; - return 1; + return -1; } return 0; @@ -378,7 +378,7 @@ int krg_check_container(void) struct stat buf; if ( stat("/proc/nodes/self", &buf) != 0 ) { - return 1; + return -1; } return 0; diff --git a/libs/libkerrighed/libproc.c b/libs/libkerrighed/libproc.c index 5a5d2a9..b25ff2c 100644 --- a/libs/libkerrighed/libproc.c +++ b/libs/libkerrighed/libproc.c @@ -34,7 +34,7 @@ int krg_check_checkpoint(void) status = stat(CHKPT_DIR, &buffer); if (status) { errno = ENOENT; - return 1; + return -1; } return 0; diff --git a/tools-host/krgboot.c b/tools-host/krgboot.c index 088541d..ab8152a 100644 --- a/tools-host/krgboot.c +++ b/tools-host/krgboot.c @@ -119,13 +119,15 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - if (!krg_check_hotplug()) { + ret = krg_check_hotplug(); + if (!ret) { fprintf(stderr, "Must be run from root container only\n"); exit(EXIT_FAILURE); } - if (!krg_check_container()) { + ret = krg_check_container(); + if (!ret) { fprintf(stderr, "Kerrighed container is already running\n"); exit(EXIT_FAILURE); diff --git a/tools/checkpoint.c b/tools/checkpoint.c index 546bdc9..e869095 100644 --- a/tools/checkpoint.c +++ b/tools/checkpoint.c @@ -142,15 +142,19 @@ void parse_args(int argc, char *argv[]) void check_environment(void) { + int ret; + /* is Kerrighed launched ? */ - if (krg_check_hotplug()) + ret = krg_check_hotplug(); + if (ret) { perror("Kerrighed is not started"); exit(EXIT_FAILURE); } /* Is checkpoint available ? */ - if (krg_check_checkpoint()) { + ret = krg_check_checkpoint(); + if (ret) { perror("Checkpointing is not available"); exit(EXIT_FAILURE); } diff --git a/tools/krgadm.c b/tools/krgadm.c index 6e28790..36f490f 100644 --- a/tools/krgadm.c +++ b/tools/krgadm.c @@ -534,7 +534,8 @@ int cluster(int argc, char* argv[], char* program_name) int ret = EXIT_SUCCESS; int r; - if ( krg_check_hotplug() ) { + r = krg_check_hotplug(); + if (r) { perror("Kerrighed is not running"); return EXIT_FAILURE; } @@ -612,8 +613,10 @@ int nodes(int argc, char* argv[], char* program_name) enum mode_t mode = NODES_MODE_UNSET; int nb_nodes = -1; int action = NONE; + int ret; - if ( krg_check_hotplug() ) { + ret = krg_check_hotplug(); + if (ret) { perror("Kerrighed is not running"); return EXIT_FAILURE; } commit 08a4ca7ad0b2eb4cfea69676ec8b08598da47e20 Author: Louis Rilling <lou...@ke...> Date: Thu May 20 15:37:05 2010 +0200 [KTP] Tag waitid02 as rcrash and detail the problem Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index 0f31920..3d4d484 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -1667,7 +1667,9 @@ rcrash waitpid13 # User level dead-lock ############################ Waitid r waitid01 -rfail waitid02 # Unknown issue. +rcrash waitid02 # User level dead-lock + # WSTOPPED and WCONTINUED not supported for remote + # children ############################ Write commit 45c36eed1382491b832d098ab0d96dd8525bc260 Author: Louis Rilling <lou...@ke...> Date: Thu May 20 12:31:00 2010 +0200 [BUGFIX] kerrighed.init: Fix partial scheduler configuration Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index bdf1795..c20f586 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -71,12 +71,12 @@ d_start_scheduler() { d_start() { log_daemon_msg "Starting $DESC" + d_start_scheduler if [ -n "$ADD_OPTS" ]; then log_daemon_msg "nodes" krgadm nodes add $ADD_OPTS > /dev/null - STATUS=$? + : ${STATUS:=$?} fi - d_start_scheduler log_end_msg ${STATUS:-0} return $? ----------------------------------------------------------------------- Summary of changes: ChangeLog | 3 + configure.ac | 5 +- libs/include/hotplug.h | 4 +- libs/include/proc.h | 2 +- libs/libkerrighed/libhotplug.c | 4 +- libs/libkerrighed/libproc.c | 14 -- linux_version.sh | 2 +- man/restart.1.xml | 11 ++ scripts/compile-tools | 2 +- tests/apps/Makefile.am | 2 - tests/apps/ipcshm-tool.c | 142 ++++++++++++++++---- tests/ktp/cr/Makefile.am | 8 +- tests/ktp/cr/{cr_pipe01 => cr_blender} | 48 +++++-- tests/ktp/cr/{cr_ipc_shm02 => cr_freeze_unfreeze} | 59 ++++----- tests/ktp/cr/cr_ipc_shm01 | 6 +- tests/ktp/cr/cr_ipc_shm02 | 2 +- tests/ktp/cr/duck11_peaking.blend | Bin 0 -> 1093188 bytes tests/ktp/cr/duck11_peaking_render_1.png | Bin 0 -> 312493 bytes tests/ktp/cr/lib_cr.sh | 100 ++++++++++++++- tests/ktp/cr/lib_cr_ipc.sh | 11 ++ tests/ktp/krgltp-smp.sh.in | 5 +- tools-host/kerrighed-host.init | 12 +- tools-host/krgboot.c | 6 +- tools/Makefile.am | 4 +- tools/checkpoint.c | 66 +++++++++- tools/kerrighed.init | 28 +++-- tools/krgadm.c | 7 +- tools/restart.c | 54 +++++--- 28 files changed, 446 insertions(+), 161 deletions(-) copy tests/ktp/cr/{cr_pipe01 => cr_blender} (56%) copy tests/ktp/cr/{cr_ipc_shm02 => cr_freeze_unfreeze} (52%) create mode 100644 tests/ktp/cr/duck11_peaking.blend create mode 100644 tests/ktp/cr/duck11_peaking_render_1.png hooks/post-receive -- UNNAMED PROJECT |