[Ovirt-devel] [PATCH node] ovirt_store_config: return error code

Alan Pevec apevec at redhat.com
Thu Feb 12 01:04:16 UTC 2009


return codes:
 1 = persistence failed on one of the files
 2 = persistent /config filesystem is not available
---
 scripts/ovirt-functions |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions
index 3079805..6d19747 100755
--- a/scripts/ovirt-functions
+++ b/scripts/ovirt-functions
@@ -359,6 +359,7 @@ EOF
 #   ovirt_store_config /etc/config /etc/config2 ...
 #   copy to /config and bind-mount back
 ovirt_store_config() {
+    rc=0
     if grep -q " /config ext3" /proc/mounts; then
         printf "storing to /config :\n"
         for f in "$@"; do
@@ -377,6 +378,7 @@ ovirt_store_config() {
                 && mount -n --bind /config$f $f \
                 || printf " Failed to persist\n"
                 printf " File persisted\n"
+                rc=1
             fi
             # register in /config/files used by rc.sysinit
             if ! grep -q "^$f$" /config/files 2> /dev/null ; then
@@ -386,7 +388,9 @@ ovirt_store_config() {
         echo
     else
         printf "warning: persistent config storage not available\n"
+        rc=2
     fi
+    return $rc
 }
 
 # unmount bindmounted config files
-- 
1.6.0.6




More information about the ovirt-devel mailing list