[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, 9 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, 9 months
[NEW PATCH] BZ#XXXXXX Use only os.access to check permissions (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/733
commit 296dd556ea6cb51301a305971e2f5a1566d9f93a
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Fri Jul 22 14:48:56 2011 +0000
BZ#XXXXXX Use only os.access to check permissions
Change-Id: Ic7b892886416e866178ac88c04cbfb68ed0c055b
diff --git a/vdsm/storage/fileUtils.py b/vdsm/storage/fileUtils.py
index adbbf4b..c76e097 100644
--- a/vdsm/storage/fileUtils.py
+++ b/vdsm/storage/fileUtils.py
@@ -182,24 +182,20 @@ def validatePermissions(targetPath):
if st.st_uid != uid or st.st_gid != gid:
raise se.StorageServerAccessPermissionError(targetPath)
-def pathExists(filename, writeable=False):
+def pathExists(filename, writable=False):
# This function is workarround for a NFS issue where
# sometimes os.exists/os.access fails due to NFS stale handle.
- # In such cases we should try again and stat the file
+ try:
+ os.stat(filename)
+ except OSError:
+ return False
+
check = os.R_OK
- if writeable:
- check |= os.W_OK
- if os.access(filename, check):
- return True
+ if writable:
+ check |= os.W_OK
- try:
- s = os.stat(filename)
- if check & s[0] == check:
- return True
- except OSError:
- pass
- return False
+ return os.access(filename, check)
def cleanupfiles(filelist):
"""
12 years, 9 months
[NEW PATCH] BZ#726410 - Ignore patitioned device (again) (via gerrit-bot)
by smizrahi@redhat.com
New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/761
commit 1c34b5109a8b53aaa5d6a97d22450601609df6e6
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Thu Jul 28 16:51:10 2011 +0300
BZ#726410 - Ignore patitioned device (again)
Change-Id: I165dd0c867e155bde3971a3600cb20429095f05b
diff --git a/vdsm/storage/devicemapper.py b/vdsm/storage/devicemapper.py
index bf155bc..bb6b7e0 100644
--- a/vdsm/storage/devicemapper.py
+++ b/vdsm/storage/devicemapper.py
@@ -60,6 +60,11 @@ def getDevName(dmId):
with open(nameFilePath, "r") as f:
return f.readline().rstrip("\n")
+def getDevUuid(dmId):
+ nameFilePath = os.path.join(getSysfsPath(dmId), "dm", "uuid")
+ with open(nameFilePath, "r") as f:
+ return f.readline().rstrip("\n")
+
def resolveDevName(devName):
try:
if os.path.exists(getSysfsPath(devName)):
@@ -83,6 +88,9 @@ def isBlockDevice(devName):
except OSError:
return False
+def isPartitioned(devName):
+ devName = resolveDevName(devName)
+ return (len(getHolders(devName)) > 0)
def getAllSlaves():
deps = {}
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 558e162..92255e0 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -719,6 +719,15 @@ class HSM:
if not typeFilter(dev):
continue
+ partitioned = devicemapper.isPartitioned(dev['guid'])
+ # One day we'll stop hiding partitioned devices and let
+ # the gui grey them out so users would not just wonder
+ # where is the device. Until that glorious day leave this
+ # here.
+ if partitioned:
+ self.log.warning("Ignoring partitioned device %s", dev)
+ continue
+
pvuuid = ""
vguuid = ""
@@ -727,11 +736,16 @@ class HSM:
pvuuid = pv.uuid
vguuid = pv.vg_uuid
- devInfo = {'GUID': dev.get("guid", ""), 'pvUUID': pvuuid, 'vgUUID': vguuid,
- 'vendorID': dev.get("vendor", ""), 'productID': dev.get("product", ""),
- 'fwrev': dev.get("fwrev", ""), "serial" : dev.get("serial", ""),
- 'capacity': dev.get("capacity", "0"), 'devtype': dev.get("devtype", ""),
- 'pathstatus': dev.get("paths", []), 'pathlist': dev.get("connections", [])}
+ devInfo = {'GUID': dev.get("guid", ""), 'pvUUID': pvuuid,
+ 'vgUUID': vguuid, 'vendorID': dev.get("vendor", ""),
+ 'productID': dev.get("product", ""),
+ 'fwrev': dev.get("fwrev", ""),
+ "serial" : dev.get("serial", ""),
+ 'capacity': dev.get("capacity", "0"),
+ 'devtype': dev.get("devtype", ""),
+ 'pathstatus': dev.get("paths", []),
+ 'pathlist': dev.get("connections", []),
+ 'partitioned': partitioned}
for path in devInfo["pathstatus"]:
path["lun"] = path["hbtl"].lun
del path["hbtl"]
@@ -739,8 +753,6 @@ class HSM:
devices.append(devInfo)
except se.InvalidPhysDev:
pass
- except se.PartitionedPhysDev:
- self.log.warning("Ignore partitioned device %s", dev)
return devices
12 years, 9 months
[NEW PATCH] BZ#716964 - Add "devcapacity" to PV info (via gerrit-bot)
by juan.hernandez@redhat.com
New patch submitted by Juan Hernandez (juan.hernandez(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/734
commit f35033484a7e8d32b32077c3cd8f2bdaa14c363c
Author: Juan Hernandez <juan.hernandez(a)redhat.com>
Date: Fri Jul 22 20:56:33 2011 +0200
BZ#716964 - Add "devcapacity" to PV info
Add a new "devcapacity" field to the PV info provided by VDSM.
This is obtained from the "dev_size" from "pvs". This and change
Ic0bd3c94a6e4999cb91f96c798a0108890321fbd in RHEV-M are required
to fix the bug.
Change-Id: Ic0bd3c94a6e4999cb91f96c798a0108890321fbd
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index ef472af..f0294e7 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1398,6 +1398,7 @@ class HSM:
info["fwrev"] = "0000"
info["devtype"] = devtype
info["capacity"] = str(pv.size)
+ info["devcapacity"] = str(pv.dev_size)
info["vgUUID"] = str(pv.vg_uuid)
info["pvUUID"] = str(pv.uuid)
info["GUID"] = str(pv.guid)
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index ef60c02..076b776 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -131,7 +131,7 @@ log = logging.getLogger("Storage.LVM")
LVM_DEFAULT_TTL = 100
-PV_FIELDS = "uuid,name,size,vg_name,vg_uuid,pe_start,pe_count,pe_alloc_count,mda_count"
+PV_FIELDS = "uuid,name,size,vg_name,vg_uuid,pe_start,pe_count,pe_alloc_count,mda_count,dev_size"
VG_FIELDS = "uuid,name,attr,size,free,extent_size,extent_count,free_count,tags"
LV_FIELDS = "uuid,name,vg_name,attr,size,seg_start_pe,devices,tags"
12 years, 9 months
[NEW PATCH] BZ#722865 - Increment multipath.conf revision (tag) so upgrade will take effect (via gerrit-bot)
by Haim Ateya
New patch submitted by Haim Ateya (hateya(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/769
commit c7e368f1ea705ecea4020ddbb97afba08a336f14
Author: Haim Ateya <hateya(a)redhat.com>
Date: Sun Jul 31 11:16:39 2011 +0300
BZ#722865 - Increment multipath.conf revision (tag) so upgrade will take effect
Change-Id: I48130d4830c8143d05cad5f81f2447e7c64ae69c
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index d2ad4ec..392f91a 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -37,8 +37,8 @@ TOXIC_CHARS = '()*+?|^$.\\'
MPATH_CONF = "/etc/multipath.conf"
-OLD_TAGS = [ "# RHAT REVISION 0.2", "# RHEV REVISION 0.3", "# RHEV REVISION 0.4", "# RHEV REVISION 0.5" ]
-MPATH_CONF_TAG = "# RHEV REVISION 0.6"
+OLD_TAGS = [ "# RHAT REVISION 0.2", "# RHEV REVISION 0.3", "# RHEV REVISION 0.4", "# RHEV REVISION 0.5", "# RHEV REVISION 0.6" ]
+MPATH_CONF_TAG = "# RHEV REVISION 0.7"
MPATH_CONF_PRIVATE_TAG = "# RHEV PRIVATE"
MPATH_CONF_TEMPLATE = MPATH_CONF_TAG + constants.STRG_MPATH_CONF
12 years, 9 months
[NEW PATCH] _initpv throws an unexpected exception. (via gerrit-bot)
by Yotam Oron
New patch submitted by Yotam Oron (yoron(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/653
commit fde88efa7db551334fc697c84d6211eebc313c86
Author: Yotam Oron <yoron(a)redhat.com>
Date: Tue Jul 5 12:14:53 2011 +0300
_initpv throws an unexpected exception.
_initpv should only throw PhysDevInitializationError exceptions, however
when a bad device argument is passed to _initpv (say /dev/null) it throws OSError.
This patch is fixing this scenario
Change-Id: I05e55b361df1523d970428d5453f36e98b2c9a2b
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index ef60c02..c5b66aa 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -676,7 +676,13 @@ def _initpv(device, withmetadata=False):
if isPvPartOfVg(device):
raise se.PhysDevInitializationError(device)
- devicemapper.removeMappingsHoldingDevice(os.path.basename(device))
+ try:
+ devicemapper.removeMappingsHoldingDevice(os.path.basename(device))
+ except OSError:
+ log.warning("removeMappingsHoldingDevice() failed with %s" % device,
+ exc_info=True)
+ raise se.PhysDevInitializationError(device)
+
rc, out, err = _lvminfo.cmd(cmd)
if rc != 0:
raise se.PhysDevInitializationError(device)
12 years, 9 months