(2.10) KVM: use running HVPs to calc blockdev options
[ganeti-local] / Makefile.am
index e495f64..a2e8202 100644 (file)
@@ -100,6 +100,7 @@ DIRS = \
        doc/examples \
        doc/examples/gnt-debug \
        doc/examples/hooks \
+       doc/users \
        test/data/htools \
        test/data/htools/rapi \
        test/hs/shelltests \
@@ -120,6 +121,7 @@ DIRS = \
        lib/watcher \
        man \
        qa \
+       qa/patch \
        test \
        test/data \
        test/data/bdev-rbd \
@@ -189,10 +191,14 @@ CLEANFILES = \
        $(BUILT_EXAMPLES) \
        doc/examples/bash_completion \
        doc/examples/bash_completion-debug \
+       $(userspecs) \
        lib/_generated_rpc.py \
        $(man_MANS) \
        $(manhtml) \
        tools/kvm-ifup \
+       tools/kvm-ifdown \
+       tools/vif-ganeti \
+       tools/net-common \
        tools/users-setup \
        tools/vcluster-setup \
        stamp-directories \
@@ -201,6 +207,7 @@ CLEANFILES = \
        $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
        $(HS_BUILT_TEST_HELPERS) \
        src/ganeti-confd \
+       src/ganeti-luxid \
        src/ganeti-mond \
        .hpc/*.mix src/*.tix test/hs/*.tix \
        doc/hs-lint.html
@@ -214,7 +221,7 @@ HS_GENERATED_FILES =
 if WANT_HTOOLS
 HS_GENERATED_FILES += $(HS_PROGS)
 if ENABLE_CONFD
-HS_GENERATED_FILES += src/hconfd src/ganeti-confd
+HS_GENERATED_FILES += src/hconfd src/ganeti-confd src/hluxid src/ganeti-luxid
 endif
 
 if ENABLE_MOND
@@ -243,6 +250,7 @@ BUILT_EXAMPLES = \
        doc/examples/ganeti-kvm-poweroff.initd \
        doc/examples/ganeti.cron \
        doc/examples/ganeti.initd \
+       doc/examples/ganeti.logrotate \
        doc/examples/ganeti-master-role.ocf \
        doc/examples/ganeti-node-role.ocf \
        doc/examples/gnt-config-backup \
@@ -420,6 +428,7 @@ docinput = \
        doc/design-cpu-pinning.rst \
        doc/design-device-uuid-name.rst \
        doc/design-draft.rst \
+       doc/design-daemons.rst \
        doc/design-htools-2.3.rst \
        doc/design-http-server.rst \
        doc/design-impexp2.rst \
@@ -452,6 +461,7 @@ docinput = \
        doc/install.rst \
        doc/locking.rst \
        doc/manpages-disabled.rst \
+       doc/monitoring-query-format.rst \
        doc/move-instance.rst \
        doc/news.rst \
        doc/ovfconverter.rst \
@@ -478,6 +488,7 @@ endif
 HS_COMPILE_PROGS= \
        src/ganeti-mond \
        src/hconfd \
+       src/hluxid \
        src/rpc-test
 
 # All Haskell non-test programs to be compiled but not automatically installed
@@ -739,17 +750,29 @@ else
        exit 1;
 endif
 
+doc/users/%: doc/users/%.in Makefile $(REPLACE_VARS_SED)
+       cat $< | sed -f $(REPLACE_VARS_SED) | LC_ALL=C sort | uniq | (grep -v '^root' || true) > $@
+
+userspecs = \
+       doc/users/users \
+       doc/users/groups \
+       doc/users/groupmemberships
+
 # Things to build but not to install (add it to EXTRA_DIST if it should be
 # distributed)
 noinst_DATA = \
-       doc/html \
        $(BUILT_EXAMPLES) \
        doc/examples/bash_completion \
        doc/examples/bash_completion-debug \
+       $(userspecs) \
        $(manhtml)
 
+if HAS_SPHINX
 if MANPAGES_IN_DOC
 noinst_DATA += doc/man-html
+else
+noinst_DATA += doc/html
+endif
 endif
 
 gnt_scripts = \
@@ -790,6 +813,7 @@ qa_scripts = \
        qa/qa_group.py \
        qa/qa_instance.py \
        qa/qa_job.py \
+  qa/qa_logging.py \
        qa/qa_node.py \
        qa/qa_os.py \
        qa/qa_rapi.py \
@@ -868,7 +892,11 @@ if ENABLE_CONFD
 src/ganeti-confd: src/hconfd
        cp -f $< $@
 
+src/ganeti-luxid: src/hluxid
+       cp -f $< $@
+
 nodist_sbin_SCRIPTS += src/ganeti-confd
+nodist_sbin_SCRIPTS += src/ganeti-luxid
 endif
 
 if ENABLE_MOND
@@ -914,6 +942,9 @@ nodist_pkglib_python_scripts = \
 myexeclib_SCRIPTS = \
        daemons/daemon-util \
        tools/kvm-ifup \
+       tools/kvm-ifdown \
+       tools/vif-ganeti \
+       tools/net-common \
        $(pkglib_python_scripts) \
        $(HS_MYEXECLIB_PROGS)
 
@@ -949,7 +980,9 @@ EXTRA_DIST = \
        devel/upload \
        devel/webserver \
        tools/kvm-ifup.in \
-       tools/users-setup.in \
+       tools/kvm-ifdown.in \
+       tools/vif-ganeti.in \
+       tools/net-common.in \
        tools/vcluster-setup.in \
        $(docinput) \
        doc/html \
@@ -960,6 +993,9 @@ EXTRA_DIST = \
        doc/examples/gnt-debug/README \
        doc/examples/gnt-debug/delay0.json \
        doc/examples/gnt-debug/delay50.json \
+       doc/users/groupmemberships.in \
+       doc/users/groups.in \
+       doc/users/users.in \
        test/py/lockperf.py \
        test/py/testutils.py \
        test/py/mocks.py \
@@ -980,6 +1016,7 @@ EXTRA_DIST = \
 man_MANS = \
        man/ganeti-cleaner.8 \
        man/ganeti-confd.8 \
+       man/ganeti-luxid.8 \
        man/ganeti-listrunner.8 \
        man/ganeti-masterd.8 \
        man/ganeti-mond.8 \
@@ -1099,6 +1136,7 @@ TEST_FILES = \
        test/data/kvm_0.9.1_help_boot_test.txt \
        test/data/kvm_1.0_help.txt \
        test/data/kvm_1.1.2_help.txt \
+       test/data/kvm_runtime.json \
        test/data/NEWS_OK.txt \
        test/data/NEWS_previous_unreleased.txt \
        test/data/ovfdata/compr_disk.vmdk.gz \
@@ -1132,6 +1170,8 @@ TEST_FILES = \
        test/data/proc_drbd83_sync.txt \
        test/data/proc_drbd83_sync_want.txt \
        test/data/proc_drbd83_sync_krnl2.6.39.txt \
+       test/data/proc_meminfo.txt \
+       test/data/proc_cpuinfo.txt \
        test/data/qa-minimal-nodes-instances-only.json \
        test/data/sys_drbd_usermode_helper.txt \
        test/data/vgreduce-removemissing-2.02.02.txt \
@@ -1240,8 +1280,8 @@ dist_TESTS = \
        test/py/cli-test.bash \
        test/py/bash_completion.bash
 
-if !PY_NODEV
-       dist_TESTS += $(python_tests)
+if PY_UNIT
+dist_TESTS += $(python_tests)
 endif
 
 nodist_TESTS =
@@ -1291,8 +1331,8 @@ all_python_code = \
        $(noinst_PYTHON) \
        $(qa_scripts)
 
-if !PY_NODEV
-       all_python_code += $(python_tests)
+if PY_UNIT
+all_python_code += $(python_tests)
 endif
 
 srclink_files = \
@@ -1354,10 +1394,40 @@ tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
        chmod +x $@
 
-tools/users-setup: tools/users-setup.in $(REPLACE_VARS_SED)
+tools/kvm-ifdown: tools/kvm-ifdown.in $(REPLACE_VARS_SED)
+       sed -f $(REPLACE_VARS_SED) < $< > $@
+       chmod +x $@
+
+tools/vif-ganeti: tools/vif-ganeti.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
        chmod +x $@
 
+tools/net-common: tools/net-common.in $(REPLACE_VARS_SED)
+       sed -f $(REPLACE_VARS_SED) < $< > $@
+       chmod +x $@
+
+tools/users-setup: Makefile $(userspecs)
+       set -e; \
+       { echo '#!/bin/sh'; \
+         echo 'if [ "x$$1" != "x--yes-do-it" ];'; \
+         echo 'then echo "This will do the following changes"'; \
+         $(AWK) -- '{print "echo + Will add group ",$$1; count++}\
+                    END {if (count == 0) {print "echo + No groups to add"}}' doc/users/groups; \
+         $(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with primary group",$$2} \
+                                 else {print "echo + Will add user",$$1}; count++}\
+                    END {if (count == 0) {print "echo + No users to add"}}' doc/users/users; \
+         $(AWK) -- '{print "echo + Will add user",$$1,"to group",$$2}' doc/users/groupmemberships; \
+         echo 'echo'; \
+         echo 'echo "OK? (y/n)"'; \
+         echo 'read confirm'; \
+         echo 'if [ "x$$confirm" != "xy" ]; then exit 0; fi'; \
+         echo 'fi'; \
+         $(AWK) -- '{print "addgroup --system",$$1}' doc/users/groups; \
+         $(AWK) -- '{if (NF > 1) {print "adduser --system --ingroup",$$2,$$1} else {print "adduser --system",$$1}}' doc/users/users; \
+         $(AWK) -- '{print "adduser",$$1,$$2}' doc/users/groupmemberships; \
+       } > $@
+       chmod +x $@
+
 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
        chmod +x $@
@@ -1532,6 +1602,8 @@ lib/_autoconf.py: Makefile | stamp-directories
          echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
          echo "CONFD_USER = '$(CONFD_USER)'"; \
          echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
+         echo "LUXID_USER = '$(LUXID_USER)'"; \
+         echo "LUXID_GROUP = '$(LUXID_GROUP)'"; \
          echo "NODED_USER = '$(NODED_USER)'"; \
          echo "NODED_GROUP = '$(NODED_GROUP)'"; \
          echo "MOND_USER = '$(MOND_USER)'"; \
@@ -1613,11 +1685,14 @@ $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
          echo 's#@''GNTMASTERUSER@#$(MASTERD_USER)#g'; \
          echo 's#@''GNTRAPIUSER@#$(RAPI_USER)#g'; \
          echo 's#@''GNTCONFDUSER@#$(CONFD_USER)#g'; \
+         echo 's#@''GNTLUXIDUSER@#$(LUXID_USER)#g'; \
          echo 's#@''GNTNODEDUSER@#$(NODED_USER)#g'; \
          echo 's#@''GNTMONDUSER@#$(MOND_USER)#g'; \
          echo 's#@''GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
          echo 's#@''GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
          echo 's#@''GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
+         echo 's#@''GNTNODEDGROUP@#$(NODED_GROUP)#g'; \
+         echo 's#@''GNTLUXIDGROUP@#$(LUXID_GROUP)#g'; \
          echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
          echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
          echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
@@ -1970,7 +2045,7 @@ COVERAGE_TESTS=
 if WANT_HTOOLS
 COVERAGE_TESTS += hs-coverage
 endif
-if !PY_NODEV
+if PY_UNIT
 COVERAGE_TESTS += py-coverage
 endif