[NEW PATCH] [WIP] Move vdsm/hooks to vdsm_hooks (via gerrit-bot)
by Federico Simoncelli
New patch submitted by Federico Simoncelli (fsimonce(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/704
commit 75f6afe98ffbd8b8e83f61e4d5b233e3fbd782eb
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Wed Jul 13 15:44:24 2011 +0000
[WIP] Move vdsm/hooks to vdsm_hooks
Change-Id: I2247df4e87edaac6979da30b17bbdeae299944b9
diff --git a/vdsm.spec.in b/vdsm.spec.in
index e57ead5..9f526b9 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -70,12 +70,7 @@ make -C vdsm DESTDIR="%{buildroot}" \
install -dDm 1777 "%{buildroot}"%{_localstatedir}/log/core
# hook vhostmd
-make -C vdsm/hooks/vhostmd DESTDIR="%{buildroot}" \
- LIBEXECDIR=%{_libexecdir}/%{vdsm_name} \
- install
-
-# hook faqemu
-make -C vdsm/hooks/faqemu DESTDIR="%{buildroot}" \
+make -C vdsm_hooks DESTDIR="%{buildroot}" \
LIBEXECDIR=%{_libexecdir}/%{vdsm_name} \
install
diff --git a/vdsm/Makefile b/vdsm/Makefile
index ef4137f..a0811af 100644
--- a/vdsm/Makefile
+++ b/vdsm/Makefile
@@ -10,8 +10,7 @@ INSTALL=install
FILES=define.py utils.py constants.py \
vm.py libvirtvm.py libvirtev.py \
- caps.py clientIF.py \
- hooks.py hooks/hooking.py \
+ caps.py clientIF.py hooks.py hooking.py \
guestIF.py dsaversion.py \
configNetwork.py SecureXMLRPCServer.py ksm.py \
netinfo.py neterrors.py \
@@ -86,15 +85,6 @@ fixpaths:
img_verifier vdsmd \
vdsm-store-net-config vdsm-restore-net-config
-HOOKS=before_vm_start after_vm_start before_vm_cont after_vm_cont \
- before_vm_pause after_vm_pause \
- before_vm_hibernate after_vm_hibernate \
- before_vm_dehibernate after_vm_dehibernate \
- before_vm_migrate_source after_vm_migrate_source \
- before_vm_migrate_destination after_vm_migrate_destination \
- after_vm_destroy \
- before_vdsm_start after_vdsm_stop
-
install: all sudoers.vdsm vdsm.conf.sample
$(INSTALL) -Dd $(DESTDIR)$(VDSMDIR)/storage/protect
$(INSTALL) -Dd $(DESTDIR)$(TRUSTSTORE)/{certs,keys}
@@ -104,12 +94,10 @@ install: all sudoers.vdsm vdsm.conf.sample
$(INSTALL) -Dd $(DESTDIR)$(POOLSDATADIR)
$(INSTALL) -Dd $(DESTDIR)$(BACKUPDIR)
$(INSTALL) -Dd $(DESTDIR)$(POOLDATADIR)
+ $(INSTALL) -Dd $(DESTDIR)$(LIBEXECDIR)
$(INSTALL) -Dd $(DESTDIR)/etc/init.d
$(INSTALL) -Dd $(DESTDIR)/etc/udev/rules.d
$(INSTALL) -Dd -m 775 $(DESTDIR)/var/lib/libvirt/qemu/channels
- (for hook in $(HOOKS); do \
- $(INSTALL) -Dd $(DESTDIR)$(LIBEXECDIR)/hooks/$$hook; \
- done)
$(INSTALL) -Dm 644 $(FILES) $(DESTDIR)$(VDSMDIR)
$(INSTALL) -Dm 755 $(SCRIPTFILES) $(DESTDIR)$(VDSMDIR)
(cd storage; \
@@ -125,8 +113,6 @@ install: all sudoers.vdsm vdsm.conf.sample
$(INSTALL) -Dm 644 vdsm-sosplugin.py $(DESTDIR)$(SOSPLUGINDIR)/vdsm.py
$(INSTALL) -Dm 644 vdsmd.8 $(DESTDIR)$(MANDIR)/man8/vdsmd.8
$(INSTALL) -Dm 644 vdsm.rwtab $(DESTDIR)/etc/rwtab.d/vdsm
- $(INSTALL) -Dm 755 hooks/persist-vdsm-hooks $(DESTDIR)$(LIBEXECDIR)/persist-vdsm-hooks
- $(INSTALL) -Dm 755 hooks/unpersist-vdsm-hook $(DESTDIR)$(LIBEXECDIR)/unpersist-vdsm-hook
clean:
$(RM) *~ *.pyc storage/protect/safelease vdsm.conf.sample
diff --git a/vdsm/hooking.py b/vdsm/hooking.py
new file mode 100644
index 0000000..e0ca856
--- /dev/null
+++ b/vdsm/hooking.py
@@ -0,0 +1,39 @@
+"""
+hooking - various stuff useful when writing vdsm hooks
+
+A vm hook expects domain xml in a file named by an environment variable called
+_hook_domxml. The hook may change the xml, but the "china store rule" applies -
+if you break something, you own it.
+
+before_migration_destination hook receives the xml of the domain from the
+source host. The xml of the domain at the destination will differ in various
+details.
+
+Return codes:
+0 - the hook ended successfully.
+1 - the hook failed, other hooks should be processed.
+2 - the hook failed, no further hooks should be processed.
+>2 - reserverd
+"""
+
+import os
+from xml.dom import minidom
+
+def tobool(s):
+ """Convert the argument into a boolean"""
+ try:
+ if s == None:
+ return False
+ if type(s) == bool:
+ return s
+ if s.lower() == 'true':
+ return True
+ return bool(int(s))
+ except:
+ return False
+
+def read_domxml():
+ return minidom.parseString(file(os.environ['_hook_domxml']).read())
+
+def write_domxml(domxml):
+ file(os.environ['_hook_domxml'], 'w').write(domxml.toxml(encoding='utf-8'))
diff --git a/vdsm/hooks/faqemu/Makefile b/vdsm/hooks/faqemu/Makefile
deleted file mode 100644
index 0ec2515..0000000
--- a/vdsm/hooks/faqemu/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-INSTALL=install
-LN_S=ln -s
-BINDIR=/usr/bin
-LIBEXECDIR=/usr/libexec/vdsm
-HOOKSDIR=$(LIBEXECDIR)/hooks
-
-install:
- $(INSTALL) -Dm 755 qemu $(DESTDIR)$(BINDIR)/qemu
- $(LN_S) qemu $(DESTDIR)$(BINDIR)/qemu-system-x86_64
- $(INSTALL) -Dm 755 before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/10_faqemu
-
-clean:
- $(RM) *~ *.pyc
diff --git a/vdsm/hooks/faqemu/before_vm_start.py b/vdsm/hooks/faqemu/before_vm_start.py
deleted file mode 100755
index bda1a71..0000000
--- a/vdsm/hooks/faqemu/before_vm_start.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/python
-
-import hooking
-from config import config
-
-if config.getboolean('vars', 'fake_kvm_support'):
- domxml = hooking.read_domxml()
-
- graphics = domxml.getElementsByTagName("graphics")[0]
- graphics.removeAttribute("passwdValidTo")
-
- for memtag in ("memory", "currentMemory"):
- memvalue = domxml.getElementsByTagName(memtag)[0]
- while memvalue.firstChild:
- memvalue.removeChild(memvalue.firstChild)
- memvalue.appendChild(domxml.createTextNode("20480"))
-
- for cputag in domxml.getElementsByTagName("cpu"):
- cputag.parentNode.removeChild(cputag)
-
- hooking.write_domxml(domxml)
diff --git a/vdsm/hooks/faqemu/qemu b/vdsm/hooks/faqemu/qemu
deleted file mode 100644
index b05ced0..0000000
--- a/vdsm/hooks/faqemu/qemu
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/python
-
-import os
-import sys
-
-qemu_bin = "/usr/libexec/qemu-kvm"
-qemu_argv = [ qemu_bin ]
-
-if not "-no-kvm" in sys.argv:
- qemu_argv += [ "-no-kvm" ]
-
-qemu_argv += filter(lambda x: x != "-enable-kvm", sys.argv[1:])
-os.execv(qemu_bin, qemu_argv)
diff --git a/vdsm/hooks/hooking.py b/vdsm/hooks/hooking.py
deleted file mode 100644
index e0ca856..0000000
--- a/vdsm/hooks/hooking.py
+++ /dev/null
@@ -1,39 +0,0 @@
-"""
-hooking - various stuff useful when writing vdsm hooks
-
-A vm hook expects domain xml in a file named by an environment variable called
-_hook_domxml. The hook may change the xml, but the "china store rule" applies -
-if you break something, you own it.
-
-before_migration_destination hook receives the xml of the domain from the
-source host. The xml of the domain at the destination will differ in various
-details.
-
-Return codes:
-0 - the hook ended successfully.
-1 - the hook failed, other hooks should be processed.
-2 - the hook failed, no further hooks should be processed.
->2 - reserverd
-"""
-
-import os
-from xml.dom import minidom
-
-def tobool(s):
- """Convert the argument into a boolean"""
- try:
- if s == None:
- return False
- if type(s) == bool:
- return s
- if s.lower() == 'true':
- return True
- return bool(int(s))
- except:
- return False
-
-def read_domxml():
- return minidom.parseString(file(os.environ['_hook_domxml']).read())
-
-def write_domxml(domxml):
- file(os.environ['_hook_domxml'], 'w').write(domxml.toxml(encoding='utf-8'))
diff --git a/vdsm/hooks/persist-vdsm-hooks b/vdsm/hooks/persist-vdsm-hooks
deleted file mode 100755
index 2ac677a..0000000
--- a/vdsm/hooks/persist-vdsm-hooks
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2009-2010 Red Hat, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# Description: Persist all VDSM hooks
-#
-
-HOOKS_DIR=/usr/libexec/vdsm/hooks
-
-if [[ -f /etc/rhev-hypervisor-release ]]
-then
- . /usr/libexec/ovirt-functions
- for hook in "$HOOKS_DIR"/*/*
- do
- if [[ -f "$hook" ]]
- then
- ovirt_store_config "$hook"
- fi
- done
-else
- echo "Host is not RHEV-Hypervisor"
- exit 1
-fi
diff --git a/vdsm/hooks/unpersist-vdsm-hook b/vdsm/hooks/unpersist-vdsm-hook
deleted file mode 100755
index af5af27..0000000
--- a/vdsm/hooks/unpersist-vdsm-hook
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2009-2010 Red Hat, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# Description: Unpersist VDSM Hook
-# Input: VDSM Hook file full path
-#
-
-HOOKS_DIR=/usr/libexec/vdsm/hooks
-HOOK_TO_UNPERSIST="$1"
-
-if [[ -z "$HOOK_TO_UNPERSIST" ]]; then
- echo "usage: $0 hook_file"
- exit 1
-fi
-
-if [[ -f /etc/rhev-hypervisor-release ]]
-then
- . /usr/libexec/ovirt-functions
- if [[ "$HOOK_TO_UNPERSIST" =~ ^"$HOOKS_DIR" ]]
- then
- # try to unpersist files only
- if [[ -f "$HOOK_TO_UNPERSIST" ]]
- then
- ovirt_safe_delete_config "$HOOK_TO_UNPERSIST"
- fi
- fi
-else
- echo "Host is not RHEV-Hypervisor"
- exit 1
-fi
diff --git a/vdsm/hooks/vhostmd/Makefile b/vdsm/hooks/vhostmd/Makefile
deleted file mode 100644
index 6f13033..0000000
--- a/vdsm/hooks/vhostmd/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-INSTALL=install
-LN_S=ln -s
-LIBEXECDIR=/usr/libexec/vdsm
-HOOKSDIR=$(LIBEXECDIR)/hooks
-
-all:
-
-install:
- $(INSTALL) -Dm 755 before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/50_vhostmd
- $(LN_S) ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_migrate_destination/50_vhostmd
- $(LN_S) ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_dehibernate/50_vhostmd
- $(INSTALL) -Dm 755 after_vm_destroy.py $(DESTDIR)$(HOOKSDIR)/after_vm_destroy/50_vhostmd
- $(INSTALL) -Dm 440 sudoers.vdsm_hook_vhostmd $(DESTDIR)/etc/sudoers.d/50_vdsm_hook_vhostmd
-
-clean:
- $(RM) *~ *.pyc
diff --git a/vdsm/hooks/vhostmd/after_vm_destroy.py b/vdsm/hooks/vhostmd/after_vm_destroy.py
deleted file mode 100644
index ae06ead..0000000
--- a/vdsm/hooks/vhostmd/after_vm_destroy.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/python
-
-import os
-import subprocess
-import hooking
-import vdscli
-
-s = vdscli.connect()
-
-res = s.list(True)
-if res['status']['code'] == 0:
- if not [ v for v in res['vmList']
- if v.get('vmId') != os.environ.get('vmId') and
- hooking.tobool(v.get('custom', {}).get('sap_agent', False)) ]:
- subprocess.call(['/usr/bin/sudo', '-n', '/sbin/service', 'vhostmd',
- 'stop'])
diff --git a/vdsm/hooks/vhostmd/before_vm_start.py b/vdsm/hooks/vhostmd/before_vm_start.py
deleted file mode 100644
index a76d19f..0000000
--- a/vdsm/hooks/vhostmd/before_vm_start.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/python
-
-import os
-import subprocess
-import hooking
-
-
-if hooking.tobool(os.environ.get('sap_agent', False)):
- domxml = hooking.read_domxml()
-
- subprocess.call(['/usr/bin/sudo', '-n', '/sbin/service', 'vhostmd',
- 'start'])
- devs = domxml.getElementsByTagName('devices')[0]
- diskelem = domxml.createElement('disk')
- diskelem.setAttribute('device', 'disk')
-
- source = domxml.createElement('source')
- diskelem.setAttribute('type', 'file')
- source.setAttribute('file', '/dev/shm/vhostmd0')
- diskelem.appendChild(source)
-
- target = domxml.createElement('target')
- target.setAttribute('dev', 'vdzz') # FIXME do not use a static location
- target.setAttribute('bus', 'virtio')
- diskelem.appendChild(target)
-
- diskelem.appendChild(domxml.createElement('readonly'))
-
- devs.appendChild(diskelem)
-
- hooking.write_domxml(domxml)
diff --git a/vdsm/hooks/vhostmd/sudoers.vdsm_hook_vhostmd b/vdsm/hooks/vhostmd/sudoers.vdsm_hook_vhostmd
deleted file mode 100644
index ea34057..0000000
--- a/vdsm/hooks/vhostmd/sudoers.vdsm_hook_vhostmd
+++ /dev/null
@@ -1 +0,0 @@
-vdsm ALL=(ALL) NOPASSWD: /sbin/service vhostmd *
diff --git a/vdsm_hooks/Makefile b/vdsm_hooks/Makefile
new file mode 100644
index 0000000..64dd604
--- /dev/null
+++ b/vdsm_hooks/Makefile
@@ -0,0 +1,30 @@
+# Copyright 2008 Red Hat, Inc. and/or its affiliates.
+#
+# Licensed to you under 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. See the files README and
+# LICENSE_GPL_v2 which accompany this distribution.
+#
+
+INSTALL=install
+
+SUBDIRS=faqemu vhostmd
+
+HOOKS=before_vm_start after_vm_start before_vm_cont after_vm_cont \
+ before_vm_pause after_vm_pause \
+ before_vm_hibernate after_vm_hibernate \
+ before_vm_dehibernate after_vm_dehibernate \
+ before_vm_migrate_source after_vm_migrate_source \
+ before_vm_migrate_destination after_vm_migrate_destination \
+ after_vm_destroy \
+ before_vdsm_start after_vdsm_stop
+
+install:
+ (for hook in $(HOOKS); do \
+ $(INSTALL) -Dd $(DESTDIR)$(LIBEXECDIR)/hooks/$$hook; \
+ done)
+ $(INSTALL) -Dm 755 persist-vdsm-hooks $(DESTDIR)$(LIBEXECDIR)/persist-vdsm-hooks
+ $(INSTALL) -Dm 755 unpersist-vdsm-hook $(DESTDIR)$(LIBEXECDIR)/unpersist-vdsm-hook
+ (for hook in $(SUBDIRS); do \
+ make -C $$hook $@ \
+ done)
diff --git a/vdsm_hooks/faqemu/Makefile b/vdsm_hooks/faqemu/Makefile
new file mode 100644
index 0000000..0ec2515
--- /dev/null
+++ b/vdsm_hooks/faqemu/Makefile
@@ -0,0 +1,13 @@
+INSTALL=install
+LN_S=ln -s
+BINDIR=/usr/bin
+LIBEXECDIR=/usr/libexec/vdsm
+HOOKSDIR=$(LIBEXECDIR)/hooks
+
+install:
+ $(INSTALL) -Dm 755 qemu $(DESTDIR)$(BINDIR)/qemu
+ $(LN_S) qemu $(DESTDIR)$(BINDIR)/qemu-system-x86_64
+ $(INSTALL) -Dm 755 before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/10_faqemu
+
+clean:
+ $(RM) *~ *.pyc
diff --git a/vdsm_hooks/faqemu/before_vm_start.py b/vdsm_hooks/faqemu/before_vm_start.py
new file mode 100755
index 0000000..bda1a71
--- /dev/null
+++ b/vdsm_hooks/faqemu/before_vm_start.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+
+import hooking
+from config import config
+
+if config.getboolean('vars', 'fake_kvm_support'):
+ domxml = hooking.read_domxml()
+
+ graphics = domxml.getElementsByTagName("graphics")[0]
+ graphics.removeAttribute("passwdValidTo")
+
+ for memtag in ("memory", "currentMemory"):
+ memvalue = domxml.getElementsByTagName(memtag)[0]
+ while memvalue.firstChild:
+ memvalue.removeChild(memvalue.firstChild)
+ memvalue.appendChild(domxml.createTextNode("20480"))
+
+ for cputag in domxml.getElementsByTagName("cpu"):
+ cputag.parentNode.removeChild(cputag)
+
+ hooking.write_domxml(domxml)
diff --git a/vdsm_hooks/faqemu/qemu b/vdsm_hooks/faqemu/qemu
new file mode 100644
index 0000000..b05ced0
--- /dev/null
+++ b/vdsm_hooks/faqemu/qemu
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+
+import os
+import sys
+
+qemu_bin = "/usr/libexec/qemu-kvm"
+qemu_argv = [ qemu_bin ]
+
+if not "-no-kvm" in sys.argv:
+ qemu_argv += [ "-no-kvm" ]
+
+qemu_argv += filter(lambda x: x != "-enable-kvm", sys.argv[1:])
+os.execv(qemu_bin, qemu_argv)
diff --git a/vdsm_hooks/persist-vdsm-hooks b/vdsm_hooks/persist-vdsm-hooks
new file mode 100755
index 0000000..2ac677a
--- /dev/null
+++ b/vdsm_hooks/persist-vdsm-hooks
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Copyright 2009-2010 Red Hat, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# Description: Persist all VDSM hooks
+#
+
+HOOKS_DIR=/usr/libexec/vdsm/hooks
+
+if [[ -f /etc/rhev-hypervisor-release ]]
+then
+ . /usr/libexec/ovirt-functions
+ for hook in "$HOOKS_DIR"/*/*
+ do
+ if [[ -f "$hook" ]]
+ then
+ ovirt_store_config "$hook"
+ fi
+ done
+else
+ echo "Host is not RHEV-Hypervisor"
+ exit 1
+fi
diff --git a/vdsm_hooks/unpersist-vdsm-hook b/vdsm_hooks/unpersist-vdsm-hook
new file mode 100755
index 0000000..af5af27
--- /dev/null
+++ b/vdsm_hooks/unpersist-vdsm-hook
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# Copyright 2009-2010 Red Hat, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# Description: Unpersist VDSM Hook
+# Input: VDSM Hook file full path
+#
+
+HOOKS_DIR=/usr/libexec/vdsm/hooks
+HOOK_TO_UNPERSIST="$1"
+
+if [[ -z "$HOOK_TO_UNPERSIST" ]]; then
+ echo "usage: $0 hook_file"
+ exit 1
+fi
+
+if [[ -f /etc/rhev-hypervisor-release ]]
+then
+ . /usr/libexec/ovirt-functions
+ if [[ "$HOOK_TO_UNPERSIST" =~ ^"$HOOKS_DIR" ]]
+ then
+ # try to unpersist files only
+ if [[ -f "$HOOK_TO_UNPERSIST" ]]
+ then
+ ovirt_safe_delete_config "$HOOK_TO_UNPERSIST"
+ fi
+ fi
+else
+ echo "Host is not RHEV-Hypervisor"
+ exit 1
+fi
diff --git a/vdsm_hooks/vhostmd/Makefile b/vdsm_hooks/vhostmd/Makefile
new file mode 100644
index 0000000..6f13033
--- /dev/null
+++ b/vdsm_hooks/vhostmd/Makefile
@@ -0,0 +1,16 @@
+INSTALL=install
+LN_S=ln -s
+LIBEXECDIR=/usr/libexec/vdsm
+HOOKSDIR=$(LIBEXECDIR)/hooks
+
+all:
+
+install:
+ $(INSTALL) -Dm 755 before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/50_vhostmd
+ $(LN_S) ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_migrate_destination/50_vhostmd
+ $(LN_S) ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_dehibernate/50_vhostmd
+ $(INSTALL) -Dm 755 after_vm_destroy.py $(DESTDIR)$(HOOKSDIR)/after_vm_destroy/50_vhostmd
+ $(INSTALL) -Dm 440 sudoers.vdsm_hook_vhostmd $(DESTDIR)/etc/sudoers.d/50_vdsm_hook_vhostmd
+
+clean:
+ $(RM) *~ *.pyc
diff --git a/vdsm_hooks/vhostmd/after_vm_destroy.py b/vdsm_hooks/vhostmd/after_vm_destroy.py
new file mode 100644
index 0000000..ae06ead
--- /dev/null
+++ b/vdsm_hooks/vhostmd/after_vm_destroy.py
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+
+import os
+import subprocess
+import hooking
+import vdscli
+
+s = vdscli.connect()
+
+res = s.list(True)
+if res['status']['code'] == 0:
+ if not [ v for v in res['vmList']
+ if v.get('vmId') != os.environ.get('vmId') and
+ hooking.tobool(v.get('custom', {}).get('sap_agent', False)) ]:
+ subprocess.call(['/usr/bin/sudo', '-n', '/sbin/service', 'vhostmd',
+ 'stop'])
diff --git a/vdsm_hooks/vhostmd/before_vm_start.py b/vdsm_hooks/vhostmd/before_vm_start.py
new file mode 100644
index 0000000..a76d19f
--- /dev/null
+++ b/vdsm_hooks/vhostmd/before_vm_start.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+
+import os
+import subprocess
+import hooking
+
+
+if hooking.tobool(os.environ.get('sap_agent', False)):
+ domxml = hooking.read_domxml()
+
+ subprocess.call(['/usr/bin/sudo', '-n', '/sbin/service', 'vhostmd',
+ 'start'])
+ devs = domxml.getElementsByTagName('devices')[0]
+ diskelem = domxml.createElement('disk')
+ diskelem.setAttribute('device', 'disk')
+
+ source = domxml.createElement('source')
+ diskelem.setAttribute('type', 'file')
+ source.setAttribute('file', '/dev/shm/vhostmd0')
+ diskelem.appendChild(source)
+
+ target = domxml.createElement('target')
+ target.setAttribute('dev', 'vdzz') # FIXME do not use a static location
+ target.setAttribute('bus', 'virtio')
+ diskelem.appendChild(target)
+
+ diskelem.appendChild(domxml.createElement('readonly'))
+
+ devs.appendChild(diskelem)
+
+ hooking.write_domxml(domxml)
diff --git a/vdsm_hooks/vhostmd/sudoers.vdsm_hook_vhostmd b/vdsm_hooks/vhostmd/sudoers.vdsm_hook_vhostmd
new file mode 100644
index 0000000..ea34057
--- /dev/null
+++ b/vdsm_hooks/vhostmd/sudoers.vdsm_hook_vhostmd
@@ -0,0 +1 @@
+vdsm ALL=(ALL) NOPASSWD: /sbin/service vhostmd *
12 years, 10 months
[NEW PATCH] [WIP] Replace 'cp' and 'mkdir' with $(INSTALL) (via gerrit-bot)
by Federico Simoncelli
New patch submitted by Federico Simoncelli (fsimonce(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/703
commit fb6abc91130e3915453f265f83ef6921f4e15c40
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Wed Jul 13 14:14:09 2011 +0000
[WIP] Replace 'cp' and 'mkdir' with $(INSTALL)
Change-Id: Ib5e6215c30a3feb80e60e4feaff1d5280f7d1d08
diff --git a/vds_bootstrap/Makefile b/vds_bootstrap/Makefile
index 76bf525..6ba23bc 100644
--- a/vds_bootstrap/Makefile
+++ b/vds_bootstrap/Makefile
@@ -6,14 +6,16 @@
# LICENSE_GPL_v2 which accompany this distribution.
#
+INSTALL = install
TARGET = /usr/share/vdsm-bootstrap
-PYSRCS = vds_bootstrap.py deployUtil.py vds_bootstrap_complete.py
+PYSRCS = vds_bootstrap.py vds_bootstrap_complete.py
all: $(PYSRCS)
install:
- mkdir -p $(DESTDIR)/$(TARGET)
- cp $(PYSRCS) $(DESTDIR)/$(TARGET)
+ $(INSTALL) -Dd 755 $(DESTDIR)$(TARGET)
+ $(INSTALL) -Dm 755 $(PYSRCS) $(DESTDIR)$(TARGET)
+ $(INSTALL) -Dm 644 deployUtil.py $(DESTDIR)$(TARGET)
clean:
$(RM) *.pyc *.pyo *~
diff --git a/vdsm.spec.in b/vdsm.spec.in
index e6af2dc..e57ead5 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -64,7 +64,10 @@ make -C vdsm DESTDIR="%{buildroot}" \
VDSMLIBDIR=%{_localstatedir}/lib/%{vdsm_name} \
SOSPLUGINDIR=%{py_sitedir}/sos/plugins \
install
-mkdir -p "%{buildroot}"%{_localstatedir}/log/core
+
+# this is not commonplace, but we want /var/log/core to be a world-writable
+# dropbox for core dumps.
+install -dDm 1777 "%{buildroot}"%{_localstatedir}/log/core
# hook vhostmd
make -C vdsm/hooks/vhostmd DESTDIR="%{buildroot}" \
@@ -265,27 +268,27 @@ machines without running real guests.
%{_datadir}/%{vdsm_name}/hooks.py*
%{_datadir}/%{vdsm_name}/hooking.py*
%{_datadir}/%{vdsm_name}/libvirtev.py*
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/vdsm
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/vdsm-restore-net-config
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/vdsm-store-net-config
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/write-net-config
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/mk_sysprep_floppy
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/get-vm-pid
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/prepare-vmchannel
+%{_datadir}/%{vdsm_name}/vdsm
+%{_datadir}/%{vdsm_name}/vdsm-restore-net-config
+%{_datadir}/%{vdsm_name}/vdsm-store-net-config
+%{_datadir}/%{vdsm_name}/write-net-config
+%{_datadir}/%{vdsm_name}/mk_sysprep_floppy
+%{_datadir}/%{vdsm_name}/get-vm-pid
+%{_datadir}/%{vdsm_name}/prepare-vmchannel
%doc vdsm/vdsm.conf.sample
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/logger.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/vdsm
%config(noreplace) %{_sysconfdir}/rwtab.d/vdsm
-%attr (440,root,root) %{_sysconfdir}/sudoers.d/50_vdsm
+%{_sysconfdir}/sudoers.d/50_vdsm
%{_sysconfdir}/cron.hourly/vdsm-logrotate
%{_datadir}/%{vdsm_name}/guestIF.py*
%{_datadir}/%{vdsm_name}/logUtils.py*
%{_datadir}/%{vdsm_name}/dsaversion.py*
%{_datadir}/%{vdsm_name}/pthread.py*
%{_datadir}/%{vdsm_name}/betterThreading.py*
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/logCollector.sh
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/persist-vdsm-hooks
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/unpersist-vdsm-hook
+%{_datadir}/%{vdsm_name}/logCollector.sh
+%{_libexecdir}/%{vdsm_name}/persist-vdsm-hooks
+%{_libexecdir}/%{vdsm_name}/unpersist-vdsm-hook
%{_datadir}/%{vdsm_name}/storage/__init__.py*
%{_datadir}/%{vdsm_name}/storage/dispatcher.py*
%{_datadir}/%{vdsm_name}/storage/storage_exception.py*
@@ -323,9 +326,9 @@ machines without running real guests.
%{_datadir}/%{vdsm_name}/storage/sdc.py*
%{_datadir}/%{vdsm_name}/storage/sdf.py*
%{_datadir}/%{vdsm_name}/storage/persistentDict.py*
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/safelease
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/spmprotect.sh
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/spmstop.sh
+%{_libexecdir}/%{vdsm_name}/safelease
+%{_libexecdir}/%{vdsm_name}/spmprotect.sh
+%{_libexecdir}/%{vdsm_name}/spmstop.sh
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_start
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_cont
@@ -343,46 +346,49 @@ machines without running real guests.
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vdsm_start
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vdsm_stop
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/configNetwork.py*
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/addNetwork
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/delNetwork
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/respawn
+%{_datadir}/%{vdsm_name}/configNetwork.py*
+%{_datadir}/%{vdsm_name}/addNetwork
+%{_datadir}/%{vdsm_name}/delNetwork
+%{_datadir}/%{vdsm_name}/respawn
%{_datadir}/%{vdsm_name}/SecureXMLRPCServer.py*
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/get-conf-item
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/set-conf-item
+%{_datadir}/%{vdsm_name}/get-conf-item
+%{_datadir}/%{vdsm_name}/set-conf-item
%{_datadir}/%{vdsm_name}/kaxmlrpclib.py*
%{_datadir}/%{vdsm_name}/config.py*
%{_datadir}/%{vdsm_name}/ksm.py*
%{_datadir}/%{vdsm_name}/netinfo.py*
%{_datadir}/%{vdsm_name}/neterrors.py*
-%attr (755,root,root) %{_datadir}/%{vdsm_name}/img_verifier
+%{_datadir}/%{vdsm_name}/img_verifier
%{_sysconfdir}/udev/rules.d/12-vdsm-lvm.rules
-# this is not commonplace, but we want /var/log/core to be a world-writable
-# dropbox for core dumps.
-%dir %attr (1777,root,root) %{_localstatedir}/log/core
-%dir %attr (755,vdsm,kvm) %{_localstatedir}/lib/%{vdsm_name}
-%dir %attr (755,vdsm,kvm) %{_localstatedir}/lib/%{vdsm_name}/netconfback
-%dir %attr (755,vdsm,kvm) %{_localstatedir}/run/%{vdsm_name}
-%dir %attr (755,vdsm,kvm) %{_localstatedir}/run/%{vdsm_name}/pools
-%dir %attr (755,vdsm,kvm) %{_localstatedir}/log/%{vdsm_name}
-%dir %attr (755,vdsm,kvm) %{_localstatedir}/log/%{vdsm_name}/backup
-%dir %attr (755,vdsm,kvm) %{_sysconfdir}/pki/%{vdsm_name}
-%dir %attr (755,vdsm,kvm) %{_sysconfdir}/pki/%{vdsm_name}/keys
-%dir %attr (755,vdsm,kvm) %{_sysconfdir}/pki/%{vdsm_name}/certs
+%dir %{_localstatedir}/log/core
+
/etc/init.d/vdsmd
%doc LICENSE_GPL_v2 README
%{py_sitedir}/sos/plugins/vdsm.py*
-%dir %attr (775,vdsm,qemu) %{_localstatedir}/lib/libvirt/qemu/channels/
%{_mandir}/man8/vdsmd.8*
+%defattr(-, vdsm, qemu, -)
+%dir %{_localstatedir}/lib/libvirt/qemu/channels
+
+%defattr(-, vdsm, kvm, -)
+%dir %{_sysconfdir}/pki/%{vdsm_name}
+%dir %{_sysconfdir}/pki/%{vdsm_name}/keys
+%dir %{_sysconfdir}/pki/%{vdsm_name}/certs
+%dir %{_localstatedir}/lib/%{vdsm_name}
+%dir %{_localstatedir}/lib/%{vdsm_name}/netconfback
+%dir %{_localstatedir}/run/%{vdsm_name}
+%dir %{_localstatedir}/run/%{vdsm_name}/pools
+%dir %{_localstatedir}/log/%{vdsm_name}
+%dir %{_localstatedir}/log/%{vdsm_name}/backup
+
%files hook-vhostmd
%defattr(-,root,root,-)
%doc LICENSE_GPL_v2
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_vhostmd
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_destination/50_vhostmd
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/hooks/before_vm_dehibernate/50_vhostmd
-%attr (755,root,root) %{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy/50_vhostmd
-%attr (440,root,root) %{_sysconfdir}/sudoers.d/50_vdsm_hook_vhostmd
+%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_vhostmd
+%{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_destination/50_vhostmd
+%{_libexecdir}/%{vdsm_name}/hooks/before_vm_dehibernate/50_vhostmd
+%{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy/50_vhostmd
+%{_sysconfdir}/sudoers.d/50_vdsm_hook_vhostmd
%files debug-plugin
%defattr(-,root,root,-)
@@ -395,13 +401,12 @@ machines without running real guests.
%{_sysconfdir}/bash_completion.d/vdsClient
%{_datadir}/%{vdsm_name}/vdscli.py*
%{_datadir}/%{vdsm_name}/dumpStorageTable.py*
-%attr (755,root,root) %{_bindir}/vdsClient
+%{_bindir}/vdsClient
%{_mandir}/man1/vdsClient.1*
%files bootstrap
%defattr(-,root,root,-)
%doc LICENSE_GPL_v2
-%dir %{_datadir}/%{vdsm_bootstrap}
%{_datadir}/%{vdsm_bootstrap}/vds_bootstrap.py*
%{_datadir}/%{vdsm_bootstrap}/deployUtil.py*
%{_datadir}/%{vdsm_bootstrap}/vds_bootstrap_complete.py*
@@ -410,9 +415,8 @@ machines without running real guests.
%files reg
%defattr(-,root,root,-)
%doc LICENSE_GPL_v2
-%dir %{_sysconfdir}/%{vdsm_reg}
-%dir %{_datadir}/%{vdsm_reg}
-%dir %attr (755,vdsm,kvm) %{_var}/log/%{vdsm_reg}
+%dir %{_sysconfdir}/%{vdsm_reg}
+%dir %{_datadir}/%{vdsm_reg}
%config(noreplace) %{_sysconfdir}/%{vdsm_reg}/vdsm-reg.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_reg}/logger.conf
%{_sysconfdir}/init.d/vdsm-reg
@@ -425,13 +429,15 @@ machines without running real guests.
%{_datadir}/%{vdsm_reg}/deployUtil.py*
%{_datadir}/%{vdsm_reg}/createDaemon.py*
%{py_sitedir}/ovirt_config_setup/rhevm.py*
-%attr (755,root,root) %{_datadir}/%{vdsm_reg}/config-rhev-manager
-%attr (755,root,root) %{_datadir}/%{vdsm_reg}/save-config
+%{_datadir}/%{vdsm_reg}/config-rhev-manager
+%{_datadir}/%{vdsm_reg}/save-config
%{_sysconfdir}/ovirt-config-setup.d
%{_sysconfdir}/ovirt-config-boot.d/vdsm-config
%config(noreplace) %{_sysconfdir}/logrotate.d/vdsm-reg
%{_sysconfdir}/cron.hourly/vdsm-reg-logrotate
%{_mandir}/man8/vdsm-reg.8*
+%defattr(-, vdsm, kvm,-)
+%dir %{_var}/log/%{vdsm_reg}
%files hook-faqemu
%defattr(-,root,root,-)
diff --git a/vdsm/Makefile b/vdsm/Makefile
index 71d6859..ef4137f 100644
--- a/vdsm/Makefile
+++ b/vdsm/Makefile
@@ -5,6 +5,9 @@
# (at your option) any later version. See the files README and
# LICENSE_GPL_v2 which accompany this distribution.
#
+
+INSTALL=install
+
FILES=define.py utils.py constants.py \
vm.py libvirtvm.py libvirtev.py \
caps.py clientIF.py \
@@ -93,45 +96,37 @@ HOOKS=before_vm_start after_vm_start before_vm_cont after_vm_cont \
before_vdsm_start after_vdsm_stop
install: all sudoers.vdsm vdsm.conf.sample
- mkdir -p $(DESTDIR)$(VDSMDIR)
- mkdir -p $(DESTDIR)$(VDSMDIR)/storage
- mkdir -p $(DESTDIR)$(TRUSTSTORE)/{certs,keys}
- mkdir -p $(DESTDIR)$(VDSMLOGDIR)
- mkdir -p $(DESTDIR)$(VDSMRUNDIR)
- mkdir -p $(DESTDIR)$(VDSMLIBDIR)
- mkdir -p $(DESTDIR)$(VDSMLIBDIR)/netconfback
- mkdir -p $(DESTDIR)$(POOLSDATADIR)
- mkdir -p $(DESTDIR)$(BACKUPDIR)
- mkdir -p $(DESTDIR)$(BINDIR)
- mkdir -p $(DESTDIR)$(LIBEXECDIR)
- (for hook in $(HOOKS); do mkdir -p $(DESTDIR)$(LIBEXECDIR)/hooks/$$hook; done)
- mkdir -p $(DESTDIR)$(CONFDIR)
- mkdir -p $(DESTDIR)$(POOLDATADIR)
- mkdir -p $(DESTDIR)$(BACKUPDATADIR)
- mkdir -p $(DESTDIR)/etc/init.d/
- mkdir -p $(DESTDIR)/etc/udev/rules.d/
- mkdir -p $(DESTDIR)/var/lib/libvirt/qemu/channels/
- cp $(FILES) $(DESTDIR)$(VDSMDIR)
- cp $(SCRIPTFILES) $(DESTDIR)$(VDSMDIR)
- (cd storage; cp $(STORAGEFILES) $(DESTDIR)$(VDSMDIR)/storage)
- (cd storage; cp 12-vdsm-lvm.rules $(DESTDIR)$(UDEVDIR))
- cp logger.conf $(DESTDIR)$(CONFDIR)
- cp vdsmd $(DESTDIR)/etc/init.d/vdsmd
- (cd storage/protect; cp $(PROTECTFILES) $(DESTDIR)$(LIBEXECDIR))
- mkdir -p $(DESTDIR)/etc/sudoers.d/
- cp sudoers.vdsm $(DESTDIR)/etc/sudoers.d/50_vdsm
- mkdir -p $(DESTDIR)/etc/logrotate.d
- mkdir -p $(DESTDIR)/etc/cron.hourly
- mkdir -p $(DESTDIR)$(SOSPLUGINDIR)
- cp -p vdsm-logrotate.conf $(DESTDIR)/etc/logrotate.d/vdsm
- cp -p vdsm-logrotate $(DESTDIR)/etc/cron.hourly
- cp -p vdsm-sosplugin.py $(DESTDIR)$(SOSPLUGINDIR)/vdsm.py
- mkdir -p $(DESTDIR)$(MANDIR)/man8
- cp -p vdsmd.8 $(DESTDIR)$(MANDIR)/man8/
- mkdir -p $(DESTDIR)/etc/rwtab.d/
- cp -p vdsm.rwtab $(DESTDIR)/etc/rwtab.d/vdsm
- cp -p hooks/persist-vdsm-hooks $(DESTDIR)$(LIBEXECDIR)
- cp -p hooks/unpersist-vdsm-hook $(DESTDIR)$(LIBEXECDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(VDSMDIR)/storage/protect
+ $(INSTALL) -Dd $(DESTDIR)$(TRUSTSTORE)/{certs,keys}
+ $(INSTALL) -Dd $(DESTDIR)$(VDSMLOGDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(VDSMRUNDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(VDSMLIBDIR)/netconfback
+ $(INSTALL) -Dd $(DESTDIR)$(POOLSDATADIR)
+ $(INSTALL) -Dd $(DESTDIR)$(BACKUPDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(POOLDATADIR)
+ $(INSTALL) -Dd $(DESTDIR)/etc/init.d
+ $(INSTALL) -Dd $(DESTDIR)/etc/udev/rules.d
+ $(INSTALL) -Dd -m 775 $(DESTDIR)/var/lib/libvirt/qemu/channels
+ (for hook in $(HOOKS); do \
+ $(INSTALL) -Dd $(DESTDIR)$(LIBEXECDIR)/hooks/$$hook; \
+ done)
+ $(INSTALL) -Dm 644 $(FILES) $(DESTDIR)$(VDSMDIR)
+ $(INSTALL) -Dm 755 $(SCRIPTFILES) $(DESTDIR)$(VDSMDIR)
+ (cd storage; \
+ $(INSTALL) -Dm 644 $(STORAGEFILES) $(DESTDIR)$(VDSMDIR)/storage)
+ (cd storage/protect; \
+ $(INSTALL) -Dm 755 $(PROTECTFILES) $(DESTDIR)$(LIBEXECDIR))
+ $(INSTALL) -Dm 644 storage/12-vdsm-lvm.rules $(DESTDIR)$(UDEVDIR)
+ $(INSTALL) -Dm 644 logger.conf $(DESTDIR)$(CONFDIR)/logger.conf
+ $(INSTALL) -Dm 755 vdsmd $(DESTDIR)/etc/init.d/vdsmd
+ $(INSTALL) -Dm 440 sudoers.vdsm $(DESTDIR)/etc/sudoers.d/50_vdsm
+ $(INSTALL) -Dm 644 vdsm-logrotate.conf $(DESTDIR)/etc/logrotate.d/vdsm
+ $(INSTALL) -Dm 755 vdsm-logrotate $(DESTDIR)/etc/cron.hourly/vdsm-logrotate
+ $(INSTALL) -Dm 644 vdsm-sosplugin.py $(DESTDIR)$(SOSPLUGINDIR)/vdsm.py
+ $(INSTALL) -Dm 644 vdsmd.8 $(DESTDIR)$(MANDIR)/man8/vdsmd.8
+ $(INSTALL) -Dm 644 vdsm.rwtab $(DESTDIR)/etc/rwtab.d/vdsm
+ $(INSTALL) -Dm 755 hooks/persist-vdsm-hooks $(DESTDIR)$(LIBEXECDIR)/persist-vdsm-hooks
+ $(INSTALL) -Dm 755 hooks/unpersist-vdsm-hook $(DESTDIR)$(LIBEXECDIR)/unpersist-vdsm-hook
clean:
$(RM) *~ *.pyc storage/protect/safelease vdsm.conf.sample
diff --git a/vdsm/hooks/faqemu/Makefile b/vdsm/hooks/faqemu/Makefile
index 00ee2f5..0ec2515 100644
--- a/vdsm/hooks/faqemu/Makefile
+++ b/vdsm/hooks/faqemu/Makefile
@@ -1,13 +1,13 @@
+INSTALL=install
+LN_S=ln -s
BINDIR=/usr/bin
LIBEXECDIR=/usr/libexec/vdsm
HOOKSDIR=$(LIBEXECDIR)/hooks
install:
- install -d $(DESTDIR)$(BINDIR)
- install -m 755 qemu $(DESTDIR)$(BINDIR)
- ln -sf qemu $(DESTDIR)$(BINDIR)/qemu-system-x86_64
- install -d $(DESTDIR)$(HOOKSDIR)/before_vm_start
- install -m 755 before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/10_faqemu
+ $(INSTALL) -Dm 755 qemu $(DESTDIR)$(BINDIR)/qemu
+ $(LN_S) qemu $(DESTDIR)$(BINDIR)/qemu-system-x86_64
+ $(INSTALL) -Dm 755 before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/10_faqemu
clean:
$(RM) *~ *.pyc
diff --git a/vdsm/hooks/vhostmd/Makefile b/vdsm/hooks/vhostmd/Makefile
index 2efc7ce..6f13033 100644
--- a/vdsm/hooks/vhostmd/Makefile
+++ b/vdsm/hooks/vhostmd/Makefile
@@ -1,16 +1,16 @@
+INSTALL=install
+LN_S=ln -s
LIBEXECDIR=/usr/libexec/vdsm
HOOKSDIR=$(LIBEXECDIR)/hooks
all:
install:
- mkdir -p $(DESTDIR)$(HOOKSDIR)/{before_vm_start,after_vm_destroy}
- cp before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/50_vhostmd
- ln -s ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_migrate_destination/50_vhostmd
- ln -s ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_dehibernate/50_vhostmd
- cp after_vm_destroy.py $(DESTDIR)$(HOOKSDIR)/after_vm_destroy/50_vhostmd
- mkdir -p $(DESTDIR)/etc/sudoers.d/
- cp sudoers.vdsm_hook_vhostmd $(DESTDIR)/etc/sudoers.d/50_vdsm_hook_vhostmd
+ $(INSTALL) -Dm 755 before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/50_vhostmd
+ $(LN_S) ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_migrate_destination/50_vhostmd
+ $(LN_S) ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_dehibernate/50_vhostmd
+ $(INSTALL) -Dm 755 after_vm_destroy.py $(DESTDIR)$(HOOKSDIR)/after_vm_destroy/50_vhostmd
+ $(INSTALL) -Dm 440 sudoers.vdsm_hook_vhostmd $(DESTDIR)/etc/sudoers.d/50_vdsm_hook_vhostmd
clean:
$(RM) *~ *.pyc
diff --git a/vdsm_cli/Makefile b/vdsm_cli/Makefile
index 65b22cc..f135d27 100644
--- a/vdsm_cli/Makefile
+++ b/vdsm_cli/Makefile
@@ -5,6 +5,9 @@
# (at your option) any later version. See the files README and
# LICENSE_GPL_v2 which accompany this distribution.
#
+
+INSTALL = install
+
TARGET = /usr/share/vdsm
PYSRCS = vdsClient.py vdscli.py dumpStorageTable.py
CONFDIR = /etc/vdsm
@@ -21,14 +24,11 @@ fixpaths:
sed -i "s:@TRUSTSTORE@:$(TRUSTSTORE):" vdscli.py
install: fixpaths
- mkdir -p $(DESTDIR)/$(TARGET)
- cp $(PYSRCS) $(DESTDIR)/$(TARGET)
- mkdir -p $(DESTDIR)/$(BINDIR)
- cp vdsClient $(DESTDIR)/$(BINDIR)
- mkdir -p $(DESTDIR)/$(COMPDIR)
- cp vdsClient.completion $(DESTDIR)$(COMPDIR)/vdsClient
- mkdir -p $(DESTDIR)$(MANDIR)/man1
- cp vdsClient.1 $(DESTDIR)$(MANDIR)/man1/
+ $(INSTALL) -Dd $(DESTDIR)/$(TARGET)
+ $(INSTALL) -Dm 644 $(PYSRCS) $(DESTDIR)/$(TARGET)
+ $(INSTALL) -Dm 755 vdsClient $(DESTDIR)/$(BINDIR)/vdsClient
+ $(INSTALL) -Dm 644 vdsClient.completion $(DESTDIR)$(COMPDIR)/vdsClient
+ $(INSTALL) -Dm 644 vdsClient.1 $(DESTDIR)$(MANDIR)/man1/vdsClient.1
clean:
$(RM) *~ *.pyc
diff --git a/vdsm_reg/Makefile b/vdsm_reg/Makefile
index bf33db8..5e1cdc0 100644
--- a/vdsm_reg/Makefile
+++ b/vdsm_reg/Makefile
@@ -1,3 +1,5 @@
+INSTALL=install
+LN_S=ln -s
VDSMREGDIR=/usr/share/vdsm-reg
ETC=/etc
CONFDIR=$(ETC)/vdsm-reg
@@ -5,6 +7,8 @@ LOGDIR=/var/log/vdsm-reg
VDSMRUNDIR=/var/run/vdsm
MANDIR=/usr/share/man
+FILES=define.py config.py deployUtil.py createDaemon.py
+
all:
@echo only \"make install\" is available
@false
@@ -13,24 +17,25 @@ fixpaths:
sed -i "s:@VDSMRUNDIR@:$(VDSMRUNDIR):" vdsm-reg.conf
install: fixpaths
- mkdir -p $(DESTDIR)$(CONFDIR)
- mkdir -p $(DESTDIR)$(VDSMREGDIR)
- mkdir -p $(DESTDIR)$(ETC)/ovirt-config-setup.d/
- mkdir -p $(DESTDIR)$(ETC)/ovirt-config-boot.d/
- mkdir -p $(DESTDIR)$(LOGDIR)
- mkdir -p $(DESTDIR)$(OVIRT_CONFIG_SETUP)
-
- cp -p vdsm-reg $(DESTDIR)$(ETC)/init.d
- cp -p {logger.conf,vdsm-reg.conf} $(DESTDIR)$(CONFDIR)
- cp -p define.py config.py config-rhev-manager save-config deployUtil.py createDaemon.py $(DESTDIR)$(VDSMREGDIR)
- cp -p vdsm-reg-setup.py $(DESTDIR)$(VDSMREGDIR)/vdsm-reg-setup
- cp -p vdsm-gen-cert.py $(DESTDIR)$(VDSMREGDIR)/vdsm-gen-cert
- cp -p vdsm-complete.py $(DESTDIR)$(VDSMREGDIR)/vdsm-complete
- cp -p vdsm-upgrade.py $(DESTDIR)$(VDSMREGDIR)/vdsm-upgrade
- ln -s $(VDSMREGDIR)/config-rhev-manager $(DESTDIR)$(ETC)/ovirt-config-setup.d/"40_Configure the host for RHEV"
- cp -p vdsm-config $(DESTDIR)$(ETC)/ovirt-config-boot.d
- cp -p vdsm-reg-logrotate.conf $(DESTDIR)$(ETC)/logrotate.d/vdsm-reg
- cp -p vdsm-reg-logrotate $(DESTDIR)$(ETC)/cron.hourly
- mkdir -p $(DESTDIR)$(MANDIR)/man8
- cp -p vdsm-reg.8 $(DESTDIR)$(MANDIR)/man8/
- cp -p rhevm.py $(DESTDIR)$(OVIRT_CONFIG_SETUP)
+ $(INSTALL) -Dd $(DESTDIR)$(CONFDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(VDSMREGDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(LOGDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(OVIRT_CONFIG_SETUP)
+ $(INSTALL) -Dm 755 vdsm-reg $(DESTDIR)$(ETC)/init.d/vdsm-reg
+ $(INSTALL) -Dm 644 logger.conf $(DESTDIR)$(CONFDIR)/logger.conf
+ $(INSTALL) -Dm 644 vdsm-reg.conf $(DESTDIR)$(CONFDIR)/vdsm-reg.conf
+ $(INSTALL) -Dm 644 $(FILES) $(DESTDIR)$(VDSMREGDIR)
+ $(INSTALL) -Dm 755 save-config $(DESTDIR)$(VDSMREGDIR)
+ $(INSTALL) -Dm 755 config-rhev-manager $(DESTDIR)$(VDSMREGDIR)
+ $(INSTALL) -Dm 755 vdsm-reg-setup.py $(DESTDIR)$(VDSMREGDIR)/vdsm-reg-setup
+ $(INSTALL) -Dm 755 vdsm-gen-cert.py $(DESTDIR)$(VDSMREGDIR)/vdsm-gen-cert
+ $(INSTALL) -Dm 755 vdsm-complete.py $(DESTDIR)$(VDSMREGDIR)/vdsm-complete
+ $(INSTALL) -Dm 755 vdsm-upgrade.py $(DESTDIR)$(VDSMREGDIR)/vdsm-upgrade
+ $(INSTALL) -Dd $(DESTDIR)$(ETC)/ovirt-config-setup.d
+ $(LN_S) $(VDSMREGDIR)/config-rhev-manager \
+ "$(DESTDIR)$(ETC)/ovirt-config-setup.d/40_Configure the host for RHEV"
+ $(INSTALL) -Dm 755 vdsm-config $(DESTDIR)$(ETC)/ovirt-config-boot.d/vdsm-config
+ $(INSTALL) -Dm 644 vdsm-reg-logrotate.conf $(DESTDIR)$(ETC)/logrotate.d/vdsm-reg
+ $(INSTALL) -Dm 755 vdsm-reg-logrotate $(DESTDIR)$(ETC)/cron.hourly
+ $(INSTALL) -Dm 644 vdsm-reg.8 $(DESTDIR)$(MANDIR)/man8/vdsm-reg.8
+ $(INSTALL) -Dm 644 rhevm.py $(DESTDIR)$(OVIRT_CONFIG_SETUP)
12 years, 10 months
[NEW PATCH] [WIP] Add SCRIPTFILES group to vdsm/Makefile (via gerrit-bot)
by Federico Simoncelli
New patch submitted by Federico Simoncelli (fsimonce(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/702
commit 70e0bd7740296eb4fb528cc0700491328140fa6a
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Wed Jul 13 13:26:59 2011 +0000
[WIP] Add SCRIPTFILES group to vdsm/Makefile
Change-Id: I7c479a3f291d00f4203868f438851e69b8edc1cd
diff --git a/vdsm/Makefile b/vdsm/Makefile
index 99991bc..71d6859 100644
--- a/vdsm/Makefile
+++ b/vdsm/Makefile
@@ -5,21 +5,26 @@
# (at your option) any later version. See the files README and
# LICENSE_GPL_v2 which accompany this distribution.
#
-FILES=define.py utils.py constants.py vm.py libvirtvm.py libvirtev.py vdsm \
+FILES=define.py utils.py constants.py \
+ vm.py libvirtvm.py libvirtev.py \
caps.py clientIF.py \
hooks.py hooks/hooking.py \
- guestIF.py dsaversion.py logCollector.sh \
- configNetwork.py addNetwork delNetwork \
- SecureXMLRPCServer.py ksm.py netinfo.py neterrors.py \
- get-conf-item set-conf-item \
- kaxmlrpclib.py config.py img_verifier \
- write-net-config vdsm-restore-net-config vdsm-store-net-config \
- mk_sysprep_floppy get-vm-pid respawn logUtils.py \
- supervdsm.py supervdsmServer.py prepare-vmchannel \
- libvirtconnection.py vdsmDebugPlugin.py
-FILES += pthread.py
-FILES += betterThreading.py
+ guestIF.py dsaversion.py \
+ configNetwork.py SecureXMLRPCServer.py ksm.py \
+ netinfo.py neterrors.py \
+ kaxmlrpclib.py config.py logUtils.py \
+ supervdsm.py supervdsmServer.py \
+ libvirtconnection.py vdsmDebugPlugin.py \
+ pthread.py betterThreading.py \
+SCRIPTFILES=vdsm logCollector.sh \
+ addNetwork delNetwork \
+ get-conf-item set-conf-item \
+ img_verifier mk_sysprep_floppy \
+ write-net-config vdsm-restore-net-config \
+ vdsm-store-net-config \
+ get-vm-pid respawn \
+ prepare-vmchannel
STORAGEFILES=storageConstants.py dispatcher.py storage_exception.py \
__init__.py \
@@ -107,6 +112,7 @@ install: all sudoers.vdsm vdsm.conf.sample
mkdir -p $(DESTDIR)/etc/udev/rules.d/
mkdir -p $(DESTDIR)/var/lib/libvirt/qemu/channels/
cp $(FILES) $(DESTDIR)$(VDSMDIR)
+ cp $(SCRIPTFILES) $(DESTDIR)$(VDSMDIR)
(cd storage; cp $(STORAGEFILES) $(DESTDIR)$(VDSMDIR)/storage)
(cd storage; cp 12-vdsm-lvm.rules $(DESTDIR)$(UDEVDIR))
cp logger.conf $(DESTDIR)$(CONFDIR)
12 years, 10 months
[NEW PATCH] [WIP] Replace variable PREFIX with DESTDIR (via gerrit-bot)
by Federico Simoncelli
New patch submitted by Federico Simoncelli (fsimonce(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/701
commit 5f2b64e4587d3118e6c1633dd2fa27b7611249e5
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Wed Jul 13 12:09:17 2011 +0000
[WIP] Replace variable PREFIX with DESTDIR
Change-Id: I654d96512aabbbb13868bb485d09271e4345647f
diff --git a/vds_bootstrap/Makefile b/vds_bootstrap/Makefile
index b474b2a..76bf525 100644
--- a/vds_bootstrap/Makefile
+++ b/vds_bootstrap/Makefile
@@ -12,8 +12,8 @@ PYSRCS = vds_bootstrap.py deployUtil.py vds_bootstrap_complete.py
all: $(PYSRCS)
install:
- mkdir -p ${PREFIX}/$(TARGET)
- cp ${PYSRCS} ${PREFIX}/$(TARGET)
+ mkdir -p $(DESTDIR)/$(TARGET)
+ cp $(PYSRCS) $(DESTDIR)/$(TARGET)
clean:
$(RM) *.pyc *.pyo *~
diff --git a/vdsm.spec.in b/vdsm.spec.in
index f805602..e6af2dc 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -53,7 +53,7 @@ sed -i 's/^software_version =.*/software_version = "%{version}"/;s/software_revi
%install
rm -rf "%{buildroot}"
mkdir -p "%{buildroot}"
-make -C vdsm PREFIX="%{buildroot}" \
+make -C vdsm DESTDIR="%{buildroot}" \
VDSMDIR=%{_datadir}/%{vdsm_name} \
VDSMLOGDIR=%{_localstatedir}/log/%{vdsm_name} \
TRUSTSTORE=%{_sysconfdir}/pki/%{vdsm_name} \
@@ -67,17 +67,17 @@ make -C vdsm PREFIX="%{buildroot}" \
mkdir -p "%{buildroot}"%{_localstatedir}/log/core
# hook vhostmd
-make -C vdsm/hooks/vhostmd PREFIX="%{buildroot}" \
+make -C vdsm/hooks/vhostmd DESTDIR="%{buildroot}" \
LIBEXECDIR=%{_libexecdir}/%{vdsm_name} \
install
# hook faqemu
-make -C vdsm/hooks/faqemu PREFIX="%{buildroot}" \
+make -C vdsm/hooks/faqemu DESTDIR="%{buildroot}" \
LIBEXECDIR=%{_libexecdir}/%{vdsm_name} \
install
#vdsm-cli
-make -C vdsm_cli PREFIX="%{buildroot}" \
+make -C vdsm_cli DESTDIR="%{buildroot}" \
CONFDIR=%{_sysconfdir}/%{vdsm_name} \
BINDIR=%{_bindir} \
COMPDIR=%{_sysconfdir}/bash_completion.d \
@@ -87,7 +87,7 @@ make -C vdsm_cli PREFIX="%{buildroot}" \
#vdsm-reg
make -C vdsm_reg \
- PREFIX="%{buildroot}" \
+ DESTDIR="%{buildroot}" \
ETC=%{_sysconfdir} \
CONFDIR=%{_sysconfdir}/%{vdsm_reg} \
LOGDIR=%{_localstatedir}/log/%{vdsm_reg} \
@@ -99,7 +99,7 @@ make -C vdsm_reg \
#vdsm-bootstrap
make -C vds_bootstrap \
- PREFIX="%{buildroot}" \
+ DESTDIR="%{buildroot}" \
TARGET=%{_datadir}/%{vdsm_bootstrap} install
diff --git a/vdsm/Makefile b/vdsm/Makefile
index a1c676e..99991bc 100644
--- a/vdsm/Makefile
+++ b/vdsm/Makefile
@@ -88,44 +88,44 @@ HOOKS=before_vm_start after_vm_start before_vm_cont after_vm_cont \
before_vdsm_start after_vdsm_stop
install: all sudoers.vdsm vdsm.conf.sample
- mkdir -p $(PREFIX)$(VDSMDIR)
- mkdir -p $(PREFIX)$(VDSMDIR)/storage
- mkdir -p $(PREFIX)$(TRUSTSTORE)/{certs,keys}
- mkdir -p $(PREFIX)$(VDSMLOGDIR)
- mkdir -p $(PREFIX)$(VDSMRUNDIR)
- mkdir -p $(PREFIX)$(VDSMLIBDIR)
- mkdir -p $(PREFIX)$(VDSMLIBDIR)/netconfback
- mkdir -p $(PREFIX)$(POOLSDATADIR)
- mkdir -p $(PREFIX)$(BACKUPDIR)
- mkdir -p $(PREFIX)$(BINDIR)
- mkdir -p $(PREFIX)$(LIBEXECDIR)
- (for hook in $(HOOKS); do mkdir -p $(PREFIX)$(LIBEXECDIR)/hooks/$$hook; done)
- mkdir -p $(PREFIX)$(CONFDIR)
- mkdir -p $(PREFIX)$(POOLDATADIR)
- mkdir -p $(PREFIX)$(BACKUPDATADIR)
- mkdir -p $(PREFIX)/etc/init.d/
- mkdir -p $(PREFIX)/etc/udev/rules.d/
- mkdir -p $(PREFIX)/var/lib/libvirt/qemu/channels/
- cp $(FILES) $(PREFIX)$(VDSMDIR)
- (cd storage; cp $(STORAGEFILES) $(PREFIX)$(VDSMDIR)/storage)
- (cd storage; cp 12-vdsm-lvm.rules $(PREFIX)$(UDEVDIR))
- cp logger.conf $(PREFIX)$(CONFDIR)
- cp vdsmd $(PREFIX)/etc/init.d/vdsmd
- (cd storage/protect; cp $(PROTECTFILES) $(PREFIX)$(LIBEXECDIR))
- mkdir -p $(PREFIX)/etc/sudoers.d/
- cp sudoers.vdsm $(PREFIX)/etc/sudoers.d/50_vdsm
- mkdir -p $(PREFIX)/etc/logrotate.d
- mkdir -p $(PREFIX)/etc/cron.hourly
- mkdir -p $(PREFIX)$(SOSPLUGINDIR)
- cp -p vdsm-logrotate.conf $(PREFIX)/etc/logrotate.d/vdsm
- cp -p vdsm-logrotate $(PREFIX)/etc/cron.hourly
- cp -p vdsm-sosplugin.py $(PREFIX)$(SOSPLUGINDIR)/vdsm.py
- mkdir -p $(PREFIX)$(MANDIR)/man8
- cp -p vdsmd.8 $(PREFIX)$(MANDIR)/man8/
- mkdir -p $(PREFIX)/etc/rwtab.d/
- cp -p vdsm.rwtab $(PREFIX)/etc/rwtab.d/vdsm
- cp -p hooks/persist-vdsm-hooks $(PREFIX)$(LIBEXECDIR)
- cp -p hooks/unpersist-vdsm-hook $(PREFIX)$(LIBEXECDIR)
+ mkdir -p $(DESTDIR)$(VDSMDIR)
+ mkdir -p $(DESTDIR)$(VDSMDIR)/storage
+ mkdir -p $(DESTDIR)$(TRUSTSTORE)/{certs,keys}
+ mkdir -p $(DESTDIR)$(VDSMLOGDIR)
+ mkdir -p $(DESTDIR)$(VDSMRUNDIR)
+ mkdir -p $(DESTDIR)$(VDSMLIBDIR)
+ mkdir -p $(DESTDIR)$(VDSMLIBDIR)/netconfback
+ mkdir -p $(DESTDIR)$(POOLSDATADIR)
+ mkdir -p $(DESTDIR)$(BACKUPDIR)
+ mkdir -p $(DESTDIR)$(BINDIR)
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ (for hook in $(HOOKS); do mkdir -p $(DESTDIR)$(LIBEXECDIR)/hooks/$$hook; done)
+ mkdir -p $(DESTDIR)$(CONFDIR)
+ mkdir -p $(DESTDIR)$(POOLDATADIR)
+ mkdir -p $(DESTDIR)$(BACKUPDATADIR)
+ mkdir -p $(DESTDIR)/etc/init.d/
+ mkdir -p $(DESTDIR)/etc/udev/rules.d/
+ mkdir -p $(DESTDIR)/var/lib/libvirt/qemu/channels/
+ cp $(FILES) $(DESTDIR)$(VDSMDIR)
+ (cd storage; cp $(STORAGEFILES) $(DESTDIR)$(VDSMDIR)/storage)
+ (cd storage; cp 12-vdsm-lvm.rules $(DESTDIR)$(UDEVDIR))
+ cp logger.conf $(DESTDIR)$(CONFDIR)
+ cp vdsmd $(DESTDIR)/etc/init.d/vdsmd
+ (cd storage/protect; cp $(PROTECTFILES) $(DESTDIR)$(LIBEXECDIR))
+ mkdir -p $(DESTDIR)/etc/sudoers.d/
+ cp sudoers.vdsm $(DESTDIR)/etc/sudoers.d/50_vdsm
+ mkdir -p $(DESTDIR)/etc/logrotate.d
+ mkdir -p $(DESTDIR)/etc/cron.hourly
+ mkdir -p $(DESTDIR)$(SOSPLUGINDIR)
+ cp -p vdsm-logrotate.conf $(DESTDIR)/etc/logrotate.d/vdsm
+ cp -p vdsm-logrotate $(DESTDIR)/etc/cron.hourly
+ cp -p vdsm-sosplugin.py $(DESTDIR)$(SOSPLUGINDIR)/vdsm.py
+ mkdir -p $(DESTDIR)$(MANDIR)/man8
+ cp -p vdsmd.8 $(DESTDIR)$(MANDIR)/man8/
+ mkdir -p $(DESTDIR)/etc/rwtab.d/
+ cp -p vdsm.rwtab $(DESTDIR)/etc/rwtab.d/vdsm
+ cp -p hooks/persist-vdsm-hooks $(DESTDIR)$(LIBEXECDIR)
+ cp -p hooks/unpersist-vdsm-hook $(DESTDIR)$(LIBEXECDIR)
clean:
$(RM) *~ *.pyc storage/protect/safelease vdsm.conf.sample
diff --git a/vdsm/hooks/faqemu/Makefile b/vdsm/hooks/faqemu/Makefile
index 57ae138..00ee2f5 100644
--- a/vdsm/hooks/faqemu/Makefile
+++ b/vdsm/hooks/faqemu/Makefile
@@ -3,11 +3,11 @@ LIBEXECDIR=/usr/libexec/vdsm
HOOKSDIR=$(LIBEXECDIR)/hooks
install:
- install -d $(PREFIX)$(BINDIR)
- install -m 755 qemu $(PREFIX)$(BINDIR)
- ln -sf qemu $(PREFIX)$(BINDIR)/qemu-system-x86_64
- install -d $(PREFIX)$(HOOKSDIR)/before_vm_start
- install -m 755 before_vm_start.py $(PREFIX)$(HOOKSDIR)/before_vm_start/10_faqemu
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 qemu $(DESTDIR)$(BINDIR)
+ ln -sf qemu $(DESTDIR)$(BINDIR)/qemu-system-x86_64
+ install -d $(DESTDIR)$(HOOKSDIR)/before_vm_start
+ install -m 755 before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/10_faqemu
clean:
$(RM) *~ *.pyc
diff --git a/vdsm/hooks/vhostmd/Makefile b/vdsm/hooks/vhostmd/Makefile
index 33856e7..2efc7ce 100644
--- a/vdsm/hooks/vhostmd/Makefile
+++ b/vdsm/hooks/vhostmd/Makefile
@@ -4,13 +4,13 @@ HOOKSDIR=$(LIBEXECDIR)/hooks
all:
install:
- mkdir -p $(PREFIX)$(HOOKSDIR)/{before_vm_start,after_vm_destroy}
- cp before_vm_start.py $(PREFIX)$(HOOKSDIR)/before_vm_start/50_vhostmd
- ln -s ../before_vm_start/50_vhostmd $(PREFIX)$(HOOKSDIR)/before_vm_migrate_destination/50_vhostmd
- ln -s ../before_vm_start/50_vhostmd $(PREFIX)$(HOOKSDIR)/before_vm_dehibernate/50_vhostmd
- cp after_vm_destroy.py $(PREFIX)$(HOOKSDIR)/after_vm_destroy/50_vhostmd
- mkdir -p $(PREFIX)/etc/sudoers.d/
- cp sudoers.vdsm_hook_vhostmd $(PREFIX)/etc/sudoers.d/50_vdsm_hook_vhostmd
+ mkdir -p $(DESTDIR)$(HOOKSDIR)/{before_vm_start,after_vm_destroy}
+ cp before_vm_start.py $(DESTDIR)$(HOOKSDIR)/before_vm_start/50_vhostmd
+ ln -s ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_migrate_destination/50_vhostmd
+ ln -s ../before_vm_start/50_vhostmd $(DESTDIR)$(HOOKSDIR)/before_vm_dehibernate/50_vhostmd
+ cp after_vm_destroy.py $(DESTDIR)$(HOOKSDIR)/after_vm_destroy/50_vhostmd
+ mkdir -p $(DESTDIR)/etc/sudoers.d/
+ cp sudoers.vdsm_hook_vhostmd $(DESTDIR)/etc/sudoers.d/50_vdsm_hook_vhostmd
clean:
$(RM) *~ *.pyc
diff --git a/vdsm_cli/Makefile b/vdsm_cli/Makefile
index 17e8467..65b22cc 100644
--- a/vdsm_cli/Makefile
+++ b/vdsm_cli/Makefile
@@ -21,14 +21,14 @@ fixpaths:
sed -i "s:@TRUSTSTORE@:$(TRUSTSTORE):" vdscli.py
install: fixpaths
- mkdir -p ${PREFIX}/$(TARGET)
- cp ${PYSRCS} ${PREFIX}/$(TARGET)
- mkdir -p $(PREFIX)/$(BINDIR)
- cp vdsClient $(PREFIX)/$(BINDIR)
- mkdir -p $(PREFIX)/$(COMPDIR)
- cp vdsClient.completion $(PREFIX)$(COMPDIR)/vdsClient
- mkdir -p $(PREFIX)$(MANDIR)/man1
- cp vdsClient.1 $(PREFIX)$(MANDIR)/man1/
+ mkdir -p $(DESTDIR)/$(TARGET)
+ cp $(PYSRCS) $(DESTDIR)/$(TARGET)
+ mkdir -p $(DESTDIR)/$(BINDIR)
+ cp vdsClient $(DESTDIR)/$(BINDIR)
+ mkdir -p $(DESTDIR)/$(COMPDIR)
+ cp vdsClient.completion $(DESTDIR)$(COMPDIR)/vdsClient
+ mkdir -p $(DESTDIR)$(MANDIR)/man1
+ cp vdsClient.1 $(DESTDIR)$(MANDIR)/man1/
clean:
$(RM) *~ *.pyc
diff --git a/vdsm_reg/Makefile b/vdsm_reg/Makefile
index 2218553..bf33db8 100644
--- a/vdsm_reg/Makefile
+++ b/vdsm_reg/Makefile
@@ -13,24 +13,24 @@ fixpaths:
sed -i "s:@VDSMRUNDIR@:$(VDSMRUNDIR):" vdsm-reg.conf
install: fixpaths
- mkdir -p $(PREFIX)$(CONFDIR)
- mkdir -p $(PREFIX)$(VDSMREGDIR)
- mkdir -p $(PREFIX)$(ETC)/ovirt-config-setup.d/
- mkdir -p $(PREFIX)$(ETC)/ovirt-config-boot.d/
- mkdir -p $(PREFIX)$(LOGDIR)
- mkdir -p $(PREFIX)$(OVIRT_CONFIG_SETUP)
+ mkdir -p $(DESTDIR)$(CONFDIR)
+ mkdir -p $(DESTDIR)$(VDSMREGDIR)
+ mkdir -p $(DESTDIR)$(ETC)/ovirt-config-setup.d/
+ mkdir -p $(DESTDIR)$(ETC)/ovirt-config-boot.d/
+ mkdir -p $(DESTDIR)$(LOGDIR)
+ mkdir -p $(DESTDIR)$(OVIRT_CONFIG_SETUP)
- cp -p vdsm-reg $(PREFIX)$(ETC)/init.d
- cp -p {logger.conf,vdsm-reg.conf} $(PREFIX)$(CONFDIR)
- cp -p define.py config.py config-rhev-manager save-config deployUtil.py createDaemon.py $(PREFIX)$(VDSMREGDIR)
- cp -p vdsm-reg-setup.py $(PREFIX)$(VDSMREGDIR)/vdsm-reg-setup
- cp -p vdsm-gen-cert.py $(PREFIX)$(VDSMREGDIR)/vdsm-gen-cert
- cp -p vdsm-complete.py $(PREFIX)$(VDSMREGDIR)/vdsm-complete
- cp -p vdsm-upgrade.py $(PREFIX)$(VDSMREGDIR)/vdsm-upgrade
- ln -s $(VDSMREGDIR)/config-rhev-manager $(PREFIX)$(ETC)/ovirt-config-setup.d/"40_Configure the host for RHEV"
- cp -p vdsm-config $(PREFIX)$(ETC)/ovirt-config-boot.d
- cp -p vdsm-reg-logrotate.conf $(PREFIX)$(ETC)/logrotate.d/vdsm-reg
- cp -p vdsm-reg-logrotate $(PREFIX)$(ETC)/cron.hourly
- mkdir -p $(PREFIX)$(MANDIR)/man8
- cp -p vdsm-reg.8 $(PREFIX)$(MANDIR)/man8/
- cp -p rhevm.py $(PREFIX)$(OVIRT_CONFIG_SETUP)
+ cp -p vdsm-reg $(DESTDIR)$(ETC)/init.d
+ cp -p {logger.conf,vdsm-reg.conf} $(DESTDIR)$(CONFDIR)
+ cp -p define.py config.py config-rhev-manager save-config deployUtil.py createDaemon.py $(DESTDIR)$(VDSMREGDIR)
+ cp -p vdsm-reg-setup.py $(DESTDIR)$(VDSMREGDIR)/vdsm-reg-setup
+ cp -p vdsm-gen-cert.py $(DESTDIR)$(VDSMREGDIR)/vdsm-gen-cert
+ cp -p vdsm-complete.py $(DESTDIR)$(VDSMREGDIR)/vdsm-complete
+ cp -p vdsm-upgrade.py $(DESTDIR)$(VDSMREGDIR)/vdsm-upgrade
+ ln -s $(VDSMREGDIR)/config-rhev-manager $(DESTDIR)$(ETC)/ovirt-config-setup.d/"40_Configure the host for RHEV"
+ cp -p vdsm-config $(DESTDIR)$(ETC)/ovirt-config-boot.d
+ cp -p vdsm-reg-logrotate.conf $(DESTDIR)$(ETC)/logrotate.d/vdsm-reg
+ cp -p vdsm-reg-logrotate $(DESTDIR)$(ETC)/cron.hourly
+ mkdir -p $(DESTDIR)$(MANDIR)/man8
+ cp -p vdsm-reg.8 $(DESTDIR)$(MANDIR)/man8/
+ cp -p rhevm.py $(DESTDIR)$(OVIRT_CONFIG_SETUP)
12 years, 10 months
Change in vdsm[master]: Introduce new version system for VDSM
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: Introduce new version system for VDSM
......................................................................
Patch Set 3: Verified; Looks good to me, approved
--
Gerrit-MessageType: comment
Gerrit-Change-Id: I9b9efb781a59bc1179bdb1b10b9ec17b7d08fbc1
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
12 years, 10 months
Change in vdsm[master]: Add a recursive install target in Makefile
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: Add a recursive install target in Makefile
......................................................................
Patch Set 5: Verified; Looks good to me, approved
--
Gerrit-MessageType: comment
Gerrit-Change-Id: Id579f1ebea23e4f89e9b3b7c0e0695164c505019
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
12 years, 10 months
Change in vdsm[master]: Replace variable PREFIX with DESTDIR
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: Replace variable PREFIX with DESTDIR
......................................................................
Patch Set 5: Verified; Looks good to me, approved
--
Gerrit-MessageType: comment
Gerrit-Change-Id: I654d96512aabbbb13868bb485d09271e4345647f
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
12 years, 10 months
Change in vdsm[master]: Add SCRIPTFILES group to vdsm/Makefile
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: Add SCRIPTFILES group to vdsm/Makefile
......................................................................
Patch Set 5: Verified; Looks good to me, approved
--
Gerrit-MessageType: comment
Gerrit-Change-Id: I7c479a3f291d00f4203868f438851e69b8edc1cd
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
12 years, 10 months
Change in vdsm[master]: Replace 'cp' and 'mkdir' with $(INSTALL)
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: Replace 'cp' and 'mkdir' with $(INSTALL)
......................................................................
Patch Set 5: Verified; Looks good to me, approved
--
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib5e6215c30a3feb80e60e4feaff1d5280f7d1d08
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
12 years, 10 months
Change in vdsm[master]: Move vdsm/hooks to vdsm_hooks
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: Move vdsm/hooks to vdsm_hooks
......................................................................
Patch Set 5: Verified; Looks good to me, approved
--
Gerrit-MessageType: comment
Gerrit-Change-Id: I2247df4e87edaac6979da30b17bbdeae299944b9
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
12 years, 10 months