mooli tayer has uploaded a new change for review.
Change subject: This commit only adds the libvirtd_sysv2upstart to configurator. It will be used in a seperate commit.
......................................................................
This commit only adds the libvirtd_sysv2upstart to configurator.
It will be used in a seperate commit.
Change-Id: I872100a6d28ea6da40e6896939aeff4b514f3e71
Signed-off-by: Mooli Tayer <mtayer(a)redhat.com>
---
M lib/vdsm/tool/configurator.py
1 file changed, 39 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/26958/1
diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index f0944f3..744a8c6 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -21,6 +21,10 @@
import sys
import grp
import argparse
+import filecmp
+import itertools
+import rpm
+import shutil
from .. import utils
from . import service, expose
@@ -96,6 +100,41 @@
def configure(self):
self._exec_libvirt_configure("reconfigure")
+ def libvirtd_sysv2upstart(self):
+ """
+ On RHEL 6, libvirtd can be started by either SysV init or Upstart.
+ We prefer upstart because it respawns libvirtd if when libvirtd
+ crashed.
+ """
+ INITCTL = '/sbin/initctl'
+ LIBVIRTD_UPSTART = 'libvirtd.upstart'
+ TARGET = "/etc/init/libvirtd.conf"
+ if os.path.isfile(INITCTL) and os.access(INITCTL, os.X_OK):
+ ts = rpm.TransactionSet()
+ mi = itertools.chain(*[ts.dbMatch('name', name)
+ for name in ['libvirt', 'libvirt-daemon']])
+ # libvirtd package does not provide libvirtd.upstart,
+ # this could happen in Ubuntu or other distro,
+ # so continue to use system default init mechanism
+ for filename in itertools.chain(*[h[rpm.RPMTAG_FILENAMES]
+ for h in mi]):
+ if LIBVIRTD_UPSTART in filename:
+ packeged = filename
+ break
+ if packeged is not None and os.path.isfile(packeged):
+ if not os.path.isfile(TARGET):
+ service.service_stop('libvirtd')
+ if not os.path.isfile(TARGET) or \
+ not filecmp.cmp(packeged, TARGET):
+ shutil.copyfile(packeged, TARGET)
+ rc, out, err = utils.execCmd((INITCTL,
+ "reload-configuration"))
+ if rc != 0:
+ sys.stdout.write(out)
+ sys.stderr.write(err)
+ raise RuntimeError(
+ "Failed to reload upstart configuration.")
+
def validate(self):
"""
Validate conflict in configured files
--
To view, visit http://gerrit.ovirt.org/26958
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I872100a6d28ea6da40e6896939aeff4b514f3e71
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
Tal Nisan has uploaded a new change for review.
Change subject: Create destination image as preallocated only if format is RAW
......................................................................
Create destination image as preallocated only if format is RAW
Create a destination image as preallocated only when the destination
domain does not supports sparseness and the image format is RAW, otherwise
create it as sparse
Signed-off-by: Tal Nisan <tnisan(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/1091956
Change-Id: I209bae70252a52f8a66be42a718c3dd73f2a6bd3
---
M vdsm/storage/image.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/27274/1
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 637d4c8..830c9c5 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -358,7 +358,8 @@
# we create the target as a sparse volume (since it will be
# soon filled with the data coming from the copy) and then
# we change its metadata back to the original value.
- if destDom.supportsSparseness:
+ if (destDom.supportsSparseness or
+ volParams['volFormat'] != volume.RAW_FORMAT):
tmpVolPreallocation = volume.SPARSE_VOL
else:
tmpVolPreallocation = volume.PREALLOCATED_VOL
--
To view, visit http://gerrit.ovirt.org/27274
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I209bae70252a52f8a66be42a718c3dd73f2a6bd3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Tal Nisan <tnisan(a)redhat.com>
Liron Ar has uploaded a new change for review.
Change subject: core: return lver/spm id from pool metadata
......................................................................
core: return lver/spm id from pool metadata
Currently the lver/spm id are being returned as they appear in the
cluster lock if supported.
The fenceSpmStorage verb is currently used to manually confirm that
there's no current spm on the responsibillity of the caller. This verb
updates the lver/spm id in the pool metadata to indicate that the spm
role is free.
This won't help us currently as getSpmStatus will return the info from
the cluster lock (if supported) which wasn't edited at all. As currently
we can't edit the information return from cluster lock, we can return
the same results as in case it wasn't supported by the cluster lock.
Right now the solution is implemented in StoragePoolDiskBackend only as
a bug fix, as StoragePoolMemoryBackend isn't being used at the moment.
Change-Id: I460801329a9a1c5ee940bce22566ad3d29b351de
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
M vdsm/storage/spbackends.py
1 file changed, 8 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/27226/1
diff --git a/vdsm/storage/spbackends.py b/vdsm/storage/spbackends.py
index d090d5a..86714a3 100644
--- a/vdsm/storage/spbackends.py
+++ b/vdsm/storage/spbackends.py
@@ -26,7 +26,6 @@
import sd
import storage_exception as se
-from clusterlock import InquireNotSupportedError
from persistentDict import DictValidator
from persistentDict import unicodeDecoder
from persistentDict import unicodeEncoder
@@ -217,26 +216,16 @@
@unsecured
def getSpmStatus(self):
- try:
- # If the cluster lock implements inquire (e.g. sanlock) then we
- # can fetch the spmId and the lVer from it.
- lVer, spmId = self.masterDomain.inquireClusterLock()
- lVer, spmId = lVer or LVER_INVALID, spmId or SPM_ID_FREE
- except InquireNotSupportedError:
- # Legacy implementation for cluster locks that are not able to
- # return the spmId and the lVer.
+ poolMeta = self._getPoolMD(self.masterDomain)
+
+ # if we claim that we were the SPM (but we're currently not) we
+ # have to make sure that we're not returning stale data
+ if (poolMeta[PMDK_SPM_ID] == self.id
+ and not self.spmRole == SPM_ACQUIRED):
+ self.invalidateMetadata()
poolMeta = self._getPoolMD(self.masterDomain)
- # if we claim that we were the SPM (but we're currently not) we
- # have to make sure that we're not returning stale data
- if (poolMeta[PMDK_SPM_ID] == self.id
- and not self.spmRole == SPM_ACQUIRED):
- self.invalidateMetadata()
- poolMeta = self._getPoolMD(self.masterDomain)
-
- lVer, spmId = poolMeta[PMDK_LVER], poolMeta[PMDK_SPM_ID]
-
- return lVer, spmId
+ return poolMeta[PMDK_LVER], poolMeta[PMDK_SPM_ID]
def setSpmStatus(self, lVer=None, spmId=None):
self.invalidateMetadata()
--
To view, visit http://gerrit.ovirt.org/27226
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I460801329a9a1c5ee940bce22566ad3d29b351de
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <laravot(a)redhat.com>
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: storage: fix pep issue with image.py
......................................................................
storage: fix pep issue with image.py
This patch fix the if indentation that pep complains.
Introduced by patch 7b4bd1b4.
Change-Id: I82b7e096292799b5c7e7f7f595e094643014ea69
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M vdsm/storage/image.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/73/27273/1
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 3d32a22..f50ad29 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -359,7 +359,7 @@
# soon filled with the data coming from the copy) and then
# we change its metadata back to the original value.
if (destDom.supportsSparseness or
- volParams['volFormat'] != volume.RAW_FORMAT):
+ volParams['volFormat'] != volume.RAW_FORMAT):
tmpVolPreallocation = volume.SPARSE_VOL
else:
tmpVolPreallocation = volume.PREALLOCATED_VOL
--
To view, visit http://gerrit.ovirt.org/27273
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I82b7e096292799b5c7e7f7f595e094643014ea69
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>