Change in vdsm[master]: resourceManager: Inline LockType.validate
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: resourceManager: Inline LockType.validate
......................................................................
resourceManager: Inline LockType.validate
Inline the function in the single call site, allowing replacing LockType
with flat constants.
Change-Id: I8205fb724d52eeedcc86c0f53656b2502721e1d0
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/resourceManager.py
1 file changed, 2 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/63627/1
diff --git a/vdsm/storage/resourceManager.py b/vdsm/storage/resourceManager.py
index 82db9cb..b766082 100644
--- a/vdsm/storage/resourceManager.py
+++ b/vdsm/storage/resourceManager.py
@@ -56,12 +56,6 @@
shared = "shared"
exclusive = "exclusive"
- @classmethod
- def validate(cls, ltype):
- validValues = ["shared", "exclusive"]
- if ltype not in validValues:
- raise ValueError("invalid lock type '%s'" % ltype)
-
class LockState:
free = "free"
@@ -530,7 +524,8 @@
if not self._resourceNameValidator.match(name):
raise ValueError("Invalid resource name '%s'" % name)
- LockType.validate(lockType)
+ if lockType not in (LockType.shared, LockType.exclusive):
+ raise ValueError("invalid lock type %r" % lockType)
request = Request(namespace, name, lockType, callback)
self._log.debug("Trying to register resource '%s' for lock type '%s'",
--
To view, visit https://gerrit.ovirt.org/63627
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8205fb724d52eeedcc86c0f53656b2502721e1d0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: resourceManager: Remove unused method
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: resourceManager: Remove unused method
......................................................................
resourceManager: Remove unused method
LockType.fromState is not used. Remove it so we can replace the LockType
class with flat constants.
Change-Id: I4d50f2dc83e5f50c3bdc4b7401e06d4813c2b1e0
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/resourceManager.py
1 file changed, 0 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/63626/1
diff --git a/vdsm/storage/resourceManager.py b/vdsm/storage/resourceManager.py
index 17ee206..82db9cb 100644
--- a/vdsm/storage/resourceManager.py
+++ b/vdsm/storage/resourceManager.py
@@ -62,14 +62,6 @@
if ltype not in validValues:
raise ValueError("invalid lock type '%s'" % ltype)
- @classmethod
- def fromState(cls, lockstate):
- if lockstate == LockState.shared:
- return cls.shared
- elif lockstate == LockState.locked:
- return cls.exclusive
- raise ValueError("invalid lockstate %s" % lockstate)
-
class LockState:
free = "free"
--
To view, visit https://gerrit.ovirt.org/63626
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d50f2dc83e5f50c3bdc4b7401e06d4813c2b1e0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: remove unused fields in vm stats
by ahadas@redhat.com
Arik Hadas has uploaded a new change for review.
Change subject: remove unused fields in vm stats
......................................................................
remove unused fields in vm stats
The values of 'vmName' and 'vmType' are not read by the engine,
thus removed. The value of 'pid' is read (it is optional - the
engine first checks if it is reported) and doesn't do anything
with this value, thus it is removed as well.
Change-Id: Ia489590b8d8454bf8b5462b5bfb7d2cb4404a924
Signed-off-by: Arik Hadas <ahadas(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 0 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/73/64973/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index c38eaef..ad8f310 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1222,9 +1222,6 @@
"""
stats = {
'vmId': self.conf['vmId'],
- 'vmName': self.name,
- 'pid': self.conf['pid'],
- 'vmType': self.conf['vmType'],
'kvmEnable': self._kvmEnable,
'acpiEnable': self.conf.get('acpiEnable', 'true')}
if 'cdrom' in self.conf:
--
To view, visit https://gerrit.ovirt.org/64973
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia489590b8d8454bf8b5462b5bfb7d2cb4404a924
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <ahadas(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: spec: Require selinux-policy-targeted for CephFS
by Allon Mureinik
Allon Mureinik has uploaded a new change for review.
Change subject: spec: Require selinux-policy-targeted for CephFS
......................................................................
spec: Require selinux-policy-targeted for CephFS
RHEL bug https://bugzilla.redhat.com/1365640 describes an selinux
denial encountered when attempting to use CephFS as a POSIX
storage domain in oVirt.
This patch requires selinux-policy-3.13.1-60 which solves that issue.
Change-Id: I88fed5ee17a7f7f12cb4c442671c5d28dc83626e
Bug-Url: https://bugzilla.redhat.com/1303550
Signed-off-by: Allon Mureinik <amureini(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/05/64505/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 9e89094..9d35711 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -218,7 +218,7 @@
Requires: lvm2 >= 7:2.02.130-5.el7_2.5
Requires: python >= 2.7.5-18.el7_1.1
Requires: policycoreutils-python
-Requires: selinux-policy-targeted >= 3.13.1-16.el7
+Requires: selinux-policy-targeted >= 3.13.1-60.el7
Requires: systemd >= 219-11.el7
%if ! 0%{?centos}
# TODO drop this if when this initscripts is available on centos
--
To view, visit https://gerrit.ovirt.org/64505
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I88fed5ee17a7f7f12cb4c442671c5d28dc83626e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: spec: Bump Fedora selinux-policy-targeted req
by Allon Mureinik
Allon Mureinik has uploaded a new change for review.
Change subject: spec: Bump Fedora selinux-policy-targeted req
......................................................................
spec: Bump Fedora selinux-policy-targeted req
Bump the selinux-policy-targeted requirement on Fedora to 3.13-1 to
(partially) align with the EL requirement.
Note that all the Fedora version we support (>= 23) provide this RPM
anyway, so nothing should really change in VDSM, it's just a
"bookkeeping" improvement.
Change-Id: Ie08f00ab7053309c7cfd736fa40ce0e150ae1dc4
Signed-off-by: Allon Mureinik <amureini(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/64504/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 80360d0..9e89094 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -238,7 +238,7 @@
Requires: sed >= 4.2.1-10
Requires: ed
Requires: lvm2 >= 2.02.132
-Requires: selinux-policy-targeted >= 3.12.1-177
+Requires: selinux-policy-targeted >= 3.13-1
# In order to avoid a policycoreutils bug (rhbz 889698) when selinux is
# disabled we now require the version 2.1.13-55 (or newer) of Fedora.
Requires: policycoreutils >= 2.1.13-55
--
To view, visit https://gerrit.ovirt.org/64504
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie08f00ab7053309c7cfd736fa40ce0e150ae1dc4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: net: canonicalize IPv4 prefix to netmask
by phoracek@redhat.com
Petr Horáček has uploaded a new change for review.
Change subject: net: canonicalize IPv4 prefix to netmask
......................................................................
net: canonicalize IPv4 prefix to netmask
In order to simplify static IP handling and fix OVS switch, this
patch introduces canonicalization of passed IPv4 prefix into netmask.
It also adds missing 'prefix' to setupNetworks documentation.
Change-Id: I344eef120b4c19f90d4dd20c7857bb73ab259e9b
Bug-Url: https://bugzilla.redhat.com/1374194
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
---
M lib/vdsm/network/api.py
M lib/vdsm/network/canonicalize.py
M tests/network/func_static_ip_test.py
M tests/network/netfunctestlib.py
4 files changed, 23 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/64494/1
diff --git a/lib/vdsm/network/api.py b/lib/vdsm/network/api.py
index 9350efe..9eae392 100644
--- a/lib/vdsm/network/api.py
+++ b/lib/vdsm/network/api.py
@@ -209,7 +209,7 @@
bonding="<name>" | nic="<name>"
(bonding and nics are mutually exclusive)
ipaddr="<ipv4>"
- netmask="<ipv4>"
+ netmask="<ipv4>" | prefix=<prefixlen>
gateway="<ipv4>"
bootproto="..."
ipv6addr="<ipv6>[/<prefixlen>]"
diff --git a/lib/vdsm/network/canonicalize.py b/lib/vdsm/network/canonicalize.py
index b0bc983..655db7b 100644
--- a/lib/vdsm/network/canonicalize.py
+++ b/lib/vdsm/network/canonicalize.py
@@ -22,6 +22,7 @@
import six
from .netinfo import bridges, mtus, bonding, dns
+from .netinfo.addresses import prefix2netmask
from vdsm import utils
from .errors import ConfigNetworkError
@@ -47,6 +48,7 @@
_canonicalize_switch_type_net(attrs)
_canonicalize_ip_default_route(attrs)
_canonicalize_nameservers(attrs)
+ _canonicalize_netmask(attrs)
def canonicalize_bondings(bonds):
@@ -138,3 +140,9 @@
data['nameservers'] = dns.get_host_nameservers()
else:
data['nameservers'] = []
+
+
+def _canonicalize_netmask(data):
+ prefix = data.pop('prefix', None)
+ if prefix:
+ data['netmask'] = prefix2netmask(int(prefix))
diff --git a/tests/network/func_static_ip_test.py b/tests/network/func_static_ip_test.py
index 529e01e..d16c56e 100644
--- a/tests/network/func_static_ip_test.py
+++ b/tests/network/func_static_ip_test.py
@@ -122,6 +122,17 @@
with self.setupNetworks(netcreate, bondcreate, NOCHK):
self.assertNetworkIp(NETWORK_NAME, netcreate[NETWORK_NAME])
+ def test_add_net_with_prefix(self):
+ with dummy_device() as nic:
+ network_attrs = {'nic': nic,
+ 'ipaddr': IPv4_ADDRESS,
+ 'prefix': IPv4_PREFIX_LEN,
+ 'switch': self.switch}
+ netcreate = {NETWORK_NAME: network_attrs}
+
+ with self.setupNetworks(netcreate, {}, NOCHK):
+ self.assertNetworkIp(NETWORK_NAME, netcreate[NETWORK_NAME])
+
@attr(type='functional', switch='legacy')
class NetworkStaticIpBasicLegacyTest(NetworkStaticIpBasicTemplate):
diff --git a/tests/network/netfunctestlib.py b/tests/network/netfunctestlib.py
index 2d238aa..cdf8d78 100644
--- a/tests/network/netfunctestlib.py
+++ b/tests/network/netfunctestlib.py
@@ -32,6 +32,7 @@
from vdsm.network.ip import dhclient
from vdsm.network.ip.address import ipv6_supported
from vdsm.network.link.iface import is_oper_up
+from vdsm.network.netinfo.addresses import prefix2netmask
from testlib import VdsmTestCase
@@ -289,7 +290,8 @@
def assertStaticIPv4(self, netattrs, ipinfo):
requires_ipaddress()
address = netattrs['ipaddr']
- netmask = netattrs['netmask']
+ netmask = (netattrs.get('netmask') or
+ prefix2netmask(int(netattrs.get('prefix'))))
self.assertEqual(address, ipinfo['addr'])
self.assertEqual(netmask, ipinfo['netmask'])
ipv4 = ipaddress.IPv4Interface(
--
To view, visit https://gerrit.ovirt.org/64494
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I344eef120b4c19f90d4dd20c7857bb73ab259e9b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: guarded: Raise if attempt to lock will deadlock
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: guarded: Raise if attempt to lock will deadlock
......................................................................
guarded: Raise if attempt to lock will deadlock
Previously we did not validate that the same lock was submitted in
different modes, since we assumed that resourceManager will fail. Turns
out that resourceManager will simply deadlock.
This patch validates the locks and raise a guarded.Deadlock in this
case, without taking any locks.
Here is an example exception (wrapped):
Deadlock: Attempt to lock will deadlock: [
<FakeGuardedLock ns=02_img.dom, name=img, mode=exclusive at 0x7fab62093110>,
<FakeGuardedLock ns=02_img.dom, name=img, mode=shared at 0x7fab620931d0>]
Change-Id: I5cd539548eda04ac7b9faf0ba1be49f29bfa2ed0
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M lib/vdsm/storage/guarded.py
M tests/storage_guarded_test.py
2 files changed, 46 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/64977/1
diff --git a/lib/vdsm/storage/guarded.py b/lib/vdsm/storage/guarded.py
index 99b7ab9..98358a1 100644
--- a/lib/vdsm/storage/guarded.py
+++ b/lib/vdsm/storage/guarded.py
@@ -19,7 +19,9 @@
#
from __future__ import absolute_import
+import itertools
import logging
+import operator
import sys
import six
@@ -29,6 +31,16 @@
class ReleaseError(Exception):
pass
+
+
+class Deadlock(Exception):
+ msg = "Attempt to lock will deadlock: {self.locks}"
+
+ def __init__(self, locks):
+ self.locks = locks
+
+ def __str__(self):
+ return self.msg.format(self=self)
class context(object):
@@ -48,6 +60,9 @@
acquired in sorted order. When exiting the context the locks are released
in reverse order. Errors are handled as gracefully as possible with any
acquired locks being released in the proper order.
+
+ Attemping to lock the same lock twice with differnt mode is not supported
+ and will raise a Deadlock exception with the conflicting locks.
"""
def __init__(self, locks):
@@ -55,9 +70,23 @@
Receives a variable number of locks which must descend from
AbstractLock. The locks are deduplicated and sorted.
"""
- self._locks = sorted(set(locks))
+ self._locks = self._validate(locks)
self._held_locks = []
+ def _validate(self, locks):
+ """
+ Remove duplicate locks and sort the locks.
+
+ Raises Deadlock if trying to take the same lock with different modes.
+ """
+ locks = sorted(set(locks))
+ by_ns_name = operator.attrgetter("ns", "name")
+ for _, group in itertools.groupby(locks, by_ns_name):
+ group = list(group)
+ if len(group) > 1:
+ raise Deadlock(group)
+ return locks
+
def __enter__(self):
for lock in self._locks:
try:
diff --git a/tests/storage_guarded_test.py b/tests/storage_guarded_test.py
index 4ec1de1..ec90ed9 100644
--- a/tests/storage_guarded_test.py
+++ b/tests/storage_guarded_test.py
@@ -188,3 +188,19 @@
with guarded.context(locks):
raise RuntimeError()
self.assertEqual(expected, log)
+
+ def test_deadlock(self):
+ log = []
+ locks = [
+ FakeGuardedLock('00_storage', 'dom', 'shared', log),
+ # Attemting to lock next locks will deadlock in resourceManager.
+ FakeGuardedLock('02_img.dom', 'img', 'exclusive', log),
+ FakeGuardedLock('02_img.dom', 'img', 'shared', log),
+ FakeGuardedLock('03_vol.dom', 'vol', 'exclusive', log),
+ ]
+ # Creating a context should raise
+ with self.assertRaises(guarded.Deadlock):
+ with guarded.context(locks):
+ pass
+ # Without locking any of the locks
+ self.assertEqual([], log)
--
To view, visit https://gerrit.ovirt.org/64977
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cd539548eda04ac7b9faf0ba1be49f29bfa2ed0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: guarded: Implement __repr__ for easier debugging
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: guarded: Implement __repr__ for easier debugging
......................................................................
guarded: Implement __repr__ for easier debugging
Change-Id: I708cf5be83790a85792ae1cddd564db80521e8df
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M lib/vdsm/storage/guarded.py
M tests/storage_resourcemanager_test.py
M tests/storage_volume_test.py
3 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/64976/1
diff --git a/lib/vdsm/storage/guarded.py b/lib/vdsm/storage/guarded.py
index 19cd7fd..99b7ab9 100644
--- a/lib/vdsm/storage/guarded.py
+++ b/lib/vdsm/storage/guarded.py
@@ -132,3 +132,7 @@
def _key(self):
return type(self), self.ns, self.name, self.mode
+
+ def __repr__(self):
+ return "<%s ns=%s, name=%s, mode=%s at 0x%x>" % (
+ self.__class__.__name__, self.ns, self.name, self.mode, id(self))
diff --git a/tests/storage_resourcemanager_test.py b/tests/storage_resourcemanager_test.py
index bc3002c..64cdd62 100644
--- a/tests/storage_resourcemanager_test.py
+++ b/tests/storage_resourcemanager_test.py
@@ -757,3 +757,13 @@
lock.release()
expected.append(('releaseResource', (lock.ns, lock.name), {}))
self.assertEqual(expected, fake_rm.__calls__)
+
+ def test_repr(self):
+ mode = resourceManager.LockType.shared
+ lock = resourceManager.ResourceManagerLock('ns', 'name', mode)
+ lock_string = str(lock)
+ self.assertIn("ResourceManagerLock", lock_string)
+ self.assertIn("ns=ns", lock_string)
+ self.assertIn("name=name", lock_string)
+ self.assertIn("mode=" + mode, lock_string)
+ self.assertIn("%x" % id(lock), lock_string)
diff --git a/tests/storage_volume_test.py b/tests/storage_volume_test.py
index f6f0037..e9cec41 100644
--- a/tests/storage_volume_test.py
+++ b/tests/storage_volume_test.py
@@ -96,6 +96,15 @@
lock.release()
self.assertEqual(expected, manifest.__calls__)
+ def test_repr(self):
+ lock = volume.VolumeLease(HOST_ID, 'dom', 'img', 'vol')
+ lock_string = str(lock)
+ self.assertIn("VolumeLease", lock_string)
+ self.assertIn("ns=04_lease_dom", lock_string)
+ self.assertIn("name=vol", lock_string)
+ self.assertIn("mode=exclusive", lock_string)
+ self.assertIn("%x" % id(lock), lock_string)
+
@expandPermutations
class VolumeManifestTest(VdsmTestCase):
--
To view, visit https://gerrit.ovirt.org/64976
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I708cf5be83790a85792ae1cddd564db80521e8df
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: tests: Rename resourceManager tests to new convention
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: tests: Rename resourceManager tests to new convention
......................................................................
tests: Rename resourceManager tests to new convention
Change-Id: I756cfe23f051c7a7dda07c2578c4a4cfba14d7e0
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/Makefile.am
R tests/storage_resourcemanager_test.py
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/64975/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 132be62..dcb36f8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -99,7 +99,7 @@
protocoldetectorTests.py \
pthreadTests.py \
qemuimg_test.py \
- resourceManagerTests.py \
+ storage_resourcemanager_test.py \
responseTests.py \
rngsources_test.py \
samplingTests.py \
@@ -210,7 +210,7 @@
properties_test.py \
protocoldetectorTests.py \
qemuimg_test.py \
- resourceManagerTests.py \
+ storage_resourcemanager_test.py \
samplingTests.py \
schemaTests.py \
schemaValidationTest.py \
diff --git a/tests/resourceManagerTests.py b/tests/storage_resourcemanager_test.py
similarity index 100%
rename from tests/resourceManagerTests.py
rename to tests/storage_resourcemanager_test.py
--
To view, visit https://gerrit.ovirt.org/64975
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I756cfe23f051c7a7dda07c2578c4a4cfba14d7e0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: core: Unlink image run directory when deleting a snapshot
by ahino@redhat.com
Ala Hino has uploaded a new change for review.
Change subject: core: Unlink image run directory when deleting a snapshot
......................................................................
core: Unlink image run directory when deleting a snapshot
Unlink image run directory,
/run/vdsm/storage/sdUUID/imgUUID/volUUID, when removing a
snapshot.
Change-Id: Ib88bf92e702ac6c324b87c9459b01adf165eaca4
Bug-Url: https://bugzilla.redhat.com/1321018
Signed-off-by: Ala Hino <ahino(a)redhat.com>
---
M vdsm/storage/blockVolume.py
1 file changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/59725/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index 4476a9e..080a858 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -604,12 +604,22 @@
try:
self.log.debug("Unlinking %s", vol_path)
os.unlink(vol_path)
- return True
except Exception as e:
eFound = e
self.log.error("cannot delete volume's %s/%s link path: %s",
self.sdUUID, self.volUUID, vol_path, exc_info=True)
+ try:
+ imgRundir = os.path.join(constants.P_VDSM_STORAGE, self.sdUUID,
+ self.imgUUID, self.volUUID)
+ self.log.debug("Unlinking %s", imgRundir)
+ os.unlink(imgRundir)
+ return True
+ except Exception as e:
+ eFound = e
+ self.log.error("cannot delete volume's %s/%s link path: %s",
+ self.sdUUID, self.volUUID, imgRundir, exc_info=True)
+
raise eFound
def extend(self, newSize):
--
To view, visit https://gerrit.ovirt.org/59725
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib88bf92e702ac6c324b87c9459b01adf165eaca4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
7 years, 8 months