Compare commits

...
This repository has been archived on 2026-09-10. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.

75 commits

Author SHA1 Message Date
Fedora Release Engineering
6f1df621f6 vdsm fails to build from source: https://bugzilla.redhat.com/show_bug.cgi?id=1676186 2019-08-08 16:48:01 +00:00
Fedora Release Engineering
30079500a2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-27 02:53:48 +00:00
Marcin Sobczyk
b40ba2c232 Restore arch restrictions, use "python2_sitelib" 2019-06-13 09:50:26 +02:00
Marcin Sobczyk
c182e9907c vdsm-4.30.17 2019-06-12 17:12:28 +02:00
Fedora Release Engineering
ccda24edbd - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-03 11:12:02 +00:00
fe5e9df1b4 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:54 +01:00
Miro Hrončok
b6e7880860 https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 2018-11-15 12:53:57 +01:00
be4bcec861
%{python_sitelib} → %{python2_sitelib}
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-07-29 23:11:37 +02:00
Fedora Release Engineering
c29489e7cd - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-14 08:29:10 +00:00
Fedora Release Engineering
810d65931e - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-09 20:25:49 +00:00
09d024629f Drop Provides with %_isa — the package is noarch 2017-08-29 07:50:35 -04:00
4ba9d18ab2 Fix order of BuildArch and Provides 2017-08-28 11:46:25 -04:00
765ec660ef Drop dependency on python-argparse (part of python stdlib) 2017-08-28 10:38:14 -04:00
28a446966d Fix %_isa and update internal Requires 2017-08-19 23:14:59 -04:00
f525c36be4 Python 2 binary package renamed to python2-vdsm 2017-08-19 09:44:24 -04:00
Fedora Release Engineering
3579ddc42a - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 10:02:11 +00:00
Fedora Release Engineering
9810cc7673 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-27 21:15:21 +00:00
Fedora Release Engineering
958c723b12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-11 17:01:09 +00:00
Peter Robinson
561e4a0e84 Build on aarch64 and ppc64le 2016-08-31 15:12:18 +01:00
Yaniv Bronhaim
454dac7f60 Vdsm build after re-review in koji
Vdsm 4.18, ovirt 4.0 component that allows to manage and monitor VMs.
2016-08-20 17:10:21 +03:00
Yaniv Bronhaim
1ca531003e Vdsm build after re-review in koji
Vdsm 4.18, ovirt 4.0 component that allows to manage and monitor VMs.
2016-08-20 17:05:44 +03:00
Yaniv Bronhaim
ccb9a73c2b Vdsm build after re-review in koji
Vdsm 4.18, ovirt 4.0 component that allows to manage and monitor VMs.
2016-08-20 16:53:16 +03:00
Yaniv Bronhaim
bf94dbfa12 vdsm build fedora master branch - 4.18 ovirt4.0 2016-08-17 02:01:10 +03:00
Yaniv Bronhaim
9b6362d5bb master 4.18.999 build 2016-08-14 11:26:38 +03:00
Yaniv Bronhaim
be412df1ff Remove make check and gluster-mgmt build due to missing arch deps
This build is for upstream use in master branch. We will add back those
parts after having all requirements.
2016-07-28 20:09:24 +03:00
Yaniv Bronhaim
19694170da Refresh build of vdsm - stable ovirt-4.0 2016-07-28 20:08:34 +03:00
Till Maas
eda3f5b415 2016-05-30: Retired because of broken deps in preparation of Fedora 24
Reference: https://fedorahosted.org/rel-eng/ticket/
2016-05-30 17:55:50 +02:00
Dennis Gilmore
36ee23731c spec cleanups
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2016-03-11 15:18:50 -06:00
Fedora Release Engineering
8267936503 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-05 02:38:23 +00:00
Yaniv Bronhaim
9f1690ebc4 Build vdsm 4.17.9 2015-10-21 11:18:25 +03:00
Yaniv Bronhaim
026071b741 Build of vdsm 4.17 for ovirt-3.6 2015-10-18 16:54:28 +03:00
Dennis Gilmore
1022f59047 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-19 01:55:46 +00:00
Peter Robinson
a8caa5c684 Disable check as it's broken 2015-03-21 14:02:37 +00:00
Yaniv Bronhaim
556f2070ad Latest upstream master vdsm 4.17 2015-01-13 17:56:11 +02:00
Yaniv Bronhaim
0a19886087 Vdsm 4.16.10 ovirt 3.5 2014-12-28 22:38:48 +02:00
Yaniv Bronhaim
dfa6381ab7 vdsm 4.16.7 2014-10-14 21:13:36 +03:00
Douglas Schilling Landgraf
8da15110f5 vdsm-4.16.5-20.gita40634a 2014-10-01 21:21:22 -04:00
Douglas Schilling Landgraf
194beb78d4 vdsm tag 4.16.5-5 2014-09-28 18:05:10 -04:00
Douglas Schilling Landgraf
0df834649a vdsm 4.16.4 2014-09-10 16:43:48 -04:00
1f7865337c - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-18 07:46:06 +00:00
Yaniv Bronhaim
bef30d0676 Adding ppc arch 2014-07-28 15:46:19 +03:00
Douglas Schilling Landgraf
bffb143da2 vdsm-4.16.0-6.git5d3ed2d.fc20 2014-06-30 20:57:12 -04:00
Dennis Gilmore
427b5e468e - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 22:30:39 -05:00
Douglas Schilling Landgraf
ed1a10e3c8 vdsm 4.14.8.1-0 2014-05-07 10:54:13 -04:00
Douglas Schilling Landgraf
abcc2f188e vdsm 4.14.7-0 2014-04-24 01:54:58 -04:00
Douglas Schilling Landgraf
9c52fef553 vdsm tag 4.14.6-0 2014-03-25 22:47:57 -04:00
Yaniv Bronhaim
8ed99246eb Build for vdsm 4.14.5 2014-03-09 08:55:11 +02:00
Yaniv Bronhaim
e4fea062a9 Updating changelog 2014-03-09 08:35:13 +02:00
Yaniv Bronhaim
2e9e564cd3 Tag 4.14.5 2014-03-09 08:33:06 +02:00
Douglas Schilling Landgraf
49358b3055 vdsm-4.14.2-0 2014-02-10 10:38:12 -05:00
Yaniv Bronhaim
f7ccd98b6e Adding patch 0001-Adding-configure-sanlock-on-force.patch 2014-02-06 17:41:27 +02:00
Yaniv Bronhaim
f41b6ad56e Adding configure sanlock on force patch and bump the release 2014-02-06 17:36:00 +02:00
Douglas Schilling Landgraf
47cae72e9a vdsm 4.14.1-3
- execCmd with sudo=root raise require tty fault when running as root
- sysvinit: Ensure that iscsid is started (BZ#1056948)
- Add missing libnl buildrequires dependency
- vdsm.spec: vdsm-python requires python-cpopen
- netconfig: set ETHTOOL_OPTS when a NIC goes up (BZ#1059680)
- sos: plugin should ignore /var/run/vdsm/storage
- vdsm.spec: vdsm should own vdsm.log (BZ#1055153)
- vdsm.spec: own metadata supervdsm mom logs (BZ#1055153)
- spec: do not remove vdsm logs when pkg removed (BZ#1055153)
- gluster: add host uuid in volume status
- gluster: interpret and use correct xml elements
- gluster: adopt xml changes of rebalance and remove-brick status
- vm: do not pause during refreshVolume (BZ#889097)
- spec: vdsm pkg for EL distro must include pkla (BZ#1060524)
2014-02-05 22:56:32 -05:00
Douglas Schilling Landgraf
1e2a95d3c3 vdsm-4.14.1-2
- vdsm.spec: Add BuildRequires to python-argparse
2014-01-21 07:36:50 -05:00
Douglas Schilling Landgraf
1e0c1c2a5b vdsm 4.14.1-1
Rebuild 4.14.1 from ovirt-3.4 branch
2014-01-20 15:58:25 -05:00
Douglas Schilling Landgraf
ca6e46d4df vdsm 4.14.1-0 2014-01-20 15:05:31 -05:00
Yaniv Bronhaim
bd475bad20 Adding new revert patches 2014-01-13 20:16:33 +02:00
Yaniv Bronhaim
2b68010b9c Bumping release 2014-01-13 20:15:21 +02:00
Yaniv Bronhaim
e07e184375 Adding 4.13.3 tar 2014-01-13 16:20:33 +02:00
Yaniv Bronhaim
7017ead39d Fix patch name in spec to 0001-Using-old-form-of-zombiereaper.patch 2014-01-13 16:02:19 +02:00
Yaniv Bronhaim
088eb71d57 Removing patches from ovirt-3.3, using new 4.13.3 tag
Additional fix for import error
2014-01-13 15:50:39 +02:00
Yaniv Bronhaim
0375459d8f Removing additional patches and replacing tarball 2014-01-13 13:45:28 +02:00
Yaniv Bronhaim
f9deeff504 Adding patch files 2014-01-13 12:46:12 +02:00
Yaniv Bronhaim
13a767c472 Adding 4.13.3 patches of ovirt-3.3 2014-01-13 12:06:21 +02:00
Yaniv Bronhaim
3c7e810941 Imported src.rpm 2013-12-11 11:35:25 +02:00
Yaniv Bronhaim
9a160b11f9 Format in ovirt-3.3.3 patches 2013-12-11 11:34:28 +02:00
Yaniv Bronhaim
b745e44cd1 Removing patchset of ovirt-3.3 patches from repository 2013-12-11 09:12:51 +02:00
Yaniv Bronhaim
ec83ab33b2 Bumping vdsm version to 4.13.2 - ovirt-3.3.2 tag 2013-12-11 09:11:28 +02:00
Yaniv Bronhaim
234e9a34da vdsm 4.13.0-14 2013-12-09 22:36:22 +02:00
Douglas Schilling Landgraf
798d9999cc remove duplicate require hostname entry
rawhide only
2013-11-19 21:52:13 -05:00
Douglas Schilling Landgraf
0c53bf9d23 replace %{_bindir}/hostname to hostname for >= F21 2013-11-16 23:03:10 -05:00
Douglas Schilling Landgraf
0e2b9140cd Update spec to fit a new validation for hostname 2013-11-14 11:27:17 -05:00
Douglas Schilling Landgraf
617a4420f1 4.13.0-11 - update from 3.3 branch
update from branch ovirt-3.3 which include:
    upgrade-fix-v3ResetMetaVolSize-argument
    lvm-Do-not-use-udev-cache-for-obtaining-device-list
    Fix-ballooning-rules-for-computing-the-minimum-avail
    Avoid-M2Crypto-races
    spec-declare-we-provide-an-existing-python-cpopen
    configuring-selinux-allowing-qemu-kvm-to-generate-co
2013-11-12 22:43:36 -05:00
Douglas Schilling Landgraf
8fc34a90c2 update to 4.13.0-9 2013-11-05 11:42:37 -05:00
Cole Robinson
03249a2f5a Fix broken hostname dep on rawhide 2013-10-30 10:00:12 -04:00
11 changed files with 1 additions and 1913 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
/vdsm-*.tar.gz

View file

@ -1,38 +0,0 @@
From 6bfb990b3711631ea2cd13fac243d3de9587e1da Mon Sep 17 00:00:00 2001
From: Dan Kenigsberg <danken@redhat.com>
Date: Tue, 10 Sep 2013 09:15:49 +0100
Subject: [PATCH] systemd init: no need to stop conflicting services
We use the explict systemd Conflicts= statement for that.
This patch is sent only to the ovirt-3.3 branch, as in master branch we
already have an independent systemd service management.
Bug-Url: https://bugzilla.redhat.com/999664
Change-Id: I7b5469ce61ae8aca353c2c7345a8a719ab0e898f
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19046
Reviewed-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Reviewed-by: Yaniv Bronhaim <ybronhei@redhat.com>
---
vdsm/vdsmd.init.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in
index 56f07bd..b38791d 100755
--- a/vdsm/vdsmd.init.in
+++ b/vdsm/vdsmd.init.in
@@ -186,7 +186,9 @@ start() {
local ret_val
"@PYTHON@" "@VDSMDIR@/hooks.pyc" before_vdsm_start
- shutdown_conflicting_srv
+ if ! has_systemd; then
+ shutdown_conflicting_srv
+ fi
if ! "@LIBEXECDIR@/vdsm-gencerts.sh" --check; then
printf $"Configuring a self-signed VDSM host certificate: "
--
1.8.3.1

View file

@ -1,32 +0,0 @@
From cac71a74f4d4b91eac76be60c050632cfb2d9dba Mon Sep 17 00:00:00 2001
From: Douglas Schilling Landgraf <dougsland@redhat.com>
Date: Thu, 12 Sep 2013 11:52:04 -0400
Subject: [PATCH] vdsmd.init: Add service-is-managed in
shutdown_conflicting_srv
We should not throw a stack trace if a service does not exist
Change-Id: I8916a73c446ea2f296b66f5fcf133b07c2d7a66c
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1006842
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19197
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
---
vdsm/vdsmd.init.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in
index b38791d..482d2ec 100755
--- a/vdsm/vdsmd.init.in
+++ b/vdsm/vdsmd.init.in
@@ -83,6 +83,7 @@ shutdown_conflicting_srv() {
local srv
for srv in ${CONFLICTING_SERVICES}; do
+ "$VDSM_TOOL" service-is-managed "$srv" >/dev/null 2>&1 || continue
"$VDSM_TOOL" service-disable "$srv"
if "$VDSM_TOOL" service-status "$srv" > /dev/null 2>&1; then
if [ "$srv" = "libvirt-guests" ]; then
--
1.8.3.1

View file

@ -1,47 +0,0 @@
From 5751ff1a2390c0145d4c0f48345ab9b062afd648 Mon Sep 17 00:00:00 2001
From: Federico Simoncelli <fsimonce@redhat.com>
Date: Fri, 13 Sep 2013 11:07:46 -0400
Subject: [PATCH] imageSharing: return proper size in httpGetSize
When importing images from OpenStack Glance the Content-Length is 0
so we need to override the value with the content of the custom header
X-Image-Meta-Size.
Change-Id: Icbcc601767d7f5b044b9e0e32f35abccdfb5746b
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19222
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19284
---
vdsm/storage/imageSharing.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/vdsm/storage/imageSharing.py b/vdsm/storage/imageSharing.py
index 5db0a4e..26f299a 100644
--- a/vdsm/storage/imageSharing.py
+++ b/vdsm/storage/imageSharing.py
@@ -29,11 +29,18 @@ def httpGetSize(methodArgs):
headers = curlImgWrap.head(methodArgs.get('url'),
methodArgs.get("headers", {}))
+ size = None
+
if 'Content-Length' in headers:
size = int(headers['Content-Length'])
- elif 'X-Image-Meta-Size' in headers:
- size = int(headers['X-Image-Meta-Size'])
- else:
+
+ # OpenStack Glance returns Content-Length = 0 so we need to
+ # override the value with the content of the custom header
+ # X-Image-Meta-Size.
+ if 'X-Image-Meta-Size' in headers:
+ size = max(size, int(headers['X-Image-Meta-Size']))
+
+ if size is None:
raise RuntimeError("Unable to determine image size")
return size
--
1.8.3.1

View file

@ -1,31 +0,0 @@
From 61dbd7ff62551b368301de89cd72d541d36d9b8e Mon Sep 17 00:00:00 2001
From: Dan Kenigsberg <danken@redhat.com>
Date: Fri, 6 Sep 2013 20:25:59 +0100
Subject: [PATCH] Require libvirt that allows vmUpdateDevice
Change-Id: I50b9af97887c2e00e87d34620153a82e28c2a310
Bug-Url: https://bugzilla.redhat.com/1001001
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/18937
Reviewed-by: Antoni Segura Puimedon <asegurap@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/18950
---
vdsm.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 74ad331..b4218a6 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -117,7 +117,7 @@ Requires: libvirt-daemon-driver-nwfilter
Requires: libvirt-daemon-driver-qemu
%else
%if 0%{?rhel}
-Requires: libvirt >= 0.10.2-18.el6_4.4
+Requires: libvirt >= 0.10.2-18.el6_4.10
%else
Requires: libvirt >= 1.0.2-1
%endif
--
1.8.3.1

View file

@ -1,41 +0,0 @@
From e5b3bc3b4c6e613e25988294ab3306b88deb061d Mon Sep 17 00:00:00 2001
From: Dan Kenigsberg <danken@redhat.com>
Date: Mon, 7 Oct 2013 01:46:54 +0100
Subject: [PATCH] vm.Vm._getUnderlyingDriveInfo: extract path of gluster disks
_getUnderlyingDriveInfo() is broken by design. It has no reliable means
to match Engine-requested devices with libvirt-produced ones. As a
heuristic, it uses the device's as matching key. However, before this
patch, it failed to extract the path from the xml definition of gluster
disks.
Bug-Url: https://bugzilla.redhat.com/1007980
Change-Id: I4459916cab24d735c067a6eb7020d4f43505fc97
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19906
Reviewed-by: Vinzenz Feenstra <vfeenstr@redhat.com>
Reviewed-by: Michal Skrivanek <michal.skrivanek@redhat.com>
Reviewed-by: Martin Polednik <mpoledni@redhat.com>
Tested-by: Martin Polednik <mpoledni@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19950
---
vdsm/vm.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/vdsm/vm.py b/vdsm/vm.py
index f0690b7..662eacc 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -4579,7 +4579,8 @@ class Vm(object):
sources = x.getElementsByTagName('source')
if sources:
devPath = (sources[0].getAttribute('file') or
- sources[0].getAttribute('dev'))
+ sources[0].getAttribute('dev') or
+ sources[0].getAttribute('name'))
else:
devPath = ''
--
1.8.3.1

View file

@ -1,41 +0,0 @@
From e086b7a3d1de694d3335304442a3564c277acc30 Mon Sep 17 00:00:00 2001
From: Yeela Kaplan <ykaplan@redhat.com>
Date: Mon, 9 Sep 2013 11:04:39 +0200
Subject: [PATCH] remoteFileHandler: Add create exclusive option for
truncateFile
Change-Id: Idfeff348e0f6fc240954e7d304b794dd99ea098c
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=979193
Signed-off-by: Yeela Kaplan <ykaplan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19022
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/20062
Reviewed-by: Federico Simoncelli <fsimonce@redhat.com>
Tested-by: Federico Simoncelli <fsimonce@redhat.com>
---
vdsm/storage/remoteFileHandler.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index abe9915..47b237b 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -334,8 +334,13 @@ def directWriteLines(path, lines):
return f.writelines(lines)
-def truncateFile(path, size, mode=None):
- with open(path, "w") as f:
+def truncateFile(path, size, mode=None, creatExcl=False):
+ flags = os.O_CREAT | os.O_WRONLY
+ if creatExcl:
+ flags |= os.O_EXCL
+
+ fd = os.open(path, flags)
+ with os.fdopen(fd, 'w') as f:
if mode is not None:
os.chmod(path, mode)
f.truncate(size)
--
1.8.3.1

View file

@ -1,105 +0,0 @@
From 22b94817d1647e2bfdce66a24d0c25ead47fdedc Mon Sep 17 00:00:00 2001
From: Federico Simoncelli <fsimonce@redhat.com>
Date: Wed, 9 Oct 2013 15:03:25 -0400
Subject: [PATCH] oop: improve safety for truncateFile
In order to make truncateFile safer and to avoid any confusion on its
behavior:
* a new comment has been added mentioning O_TRUNC and "w" to avoid any
future mistake in this area
* a new test has been added to check the expected outcomes
* the "w" mode has been removed from truncateFile (used in os.fdopen)
to prevent any future reconversion to open(path, "w")
* the risk of a file descriptor leak (for a failing os.fdopen call)
has been removed using the relevant posix calls
Change-Id: Ib71b53498c7bc4ea7a1ab725feb18bc5929f8c85
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/20046
Reviewed-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-by: Sergey Gotliv <sgotliv@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/20063
---
tests/remoteFileHandlerTests.py | 28 ++++++++++++++++++++++++++++
vdsm/storage/remoteFileHandler.py | 14 +++++++++++---
2 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/tests/remoteFileHandlerTests.py b/tests/remoteFileHandlerTests.py
index 544ec28..a2ca574 100644
--- a/tests/remoteFileHandlerTests.py
+++ b/tests/remoteFileHandlerTests.py
@@ -18,6 +18,8 @@
# Refer to the README and COPYING files for full details of the license
#
import os
+import string
+import tempfile
from vdsm import utils
from testrunner import VdsmTestCase as TestCaseBase
@@ -69,3 +71,29 @@ class PoolHandlerTests(TestCaseBase):
test = lambda: self.assertFalse(os.path.exists(procPath))
utils.retry(test, AssertionError, timeout=4, sleep=0.1)
+
+
+class RemoteFileHandlerFunctionTests(TestCaseBase):
+ def testTruncateFile(self):
+ fd, path = tempfile.mkstemp()
+ try:
+ os.write(fd, string.ascii_uppercase)
+ os.close(fd)
+
+ # Verifying content
+ data = string.ascii_uppercase
+ self.assertEquals(data, file(path).read())
+
+ # Testing truncate to a larger size
+ data = string.ascii_uppercase + chr(0) * 16
+
+ rhandler.truncateFile(path, len(data))
+ self.assertEquals(data, file(path).read())
+
+ # Testing truncate to a smaller size
+ data = string.ascii_uppercase
+
+ rhandler.truncateFile(path, len(data))
+ self.assertEquals(data, file(path).read())
+ finally:
+ os.unlink(path)
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index 47b237b..3a22bc4 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -335,15 +335,23 @@ def directWriteLines(path, lines):
def truncateFile(path, size, mode=None, creatExcl=False):
+ # NOTE: Under no circumstance you should add the O_TRUNC
+ # flag here. We rely on the fact that the file content is
+ # not deleted when truncating to a larger size.
+ # Please also note that the "w" option used in open/file
+ # contains O_TRUNC and therefore should not be used here.
flags = os.O_CREAT | os.O_WRONLY
+
if creatExcl:
flags |= os.O_EXCL
fd = os.open(path, flags)
- with os.fdopen(fd, 'w') as f:
+ try:
if mode is not None:
- os.chmod(path, mode)
- f.truncate(size)
+ os.fchmod(fd, mode)
+ os.ftruncate(fd, size)
+ finally:
+ os.close(fd)
def readLines(path):
--
1.8.3.1

1
dead.package Normal file
View file

@ -0,0 +1 @@
vdsm fails to build from source: https://bugzilla.redhat.com/show_bug.cgi?id=1676186

View file

@ -1 +0,0 @@
6b09314cd4aa11b102ea6187f1dcbd4f vdsm-4.12.1.tar.gz

1576
vdsm.spec

File diff suppressed because it is too large Load diff