Change in vdsm[master]: Adding check of os.access to vdsm log file during startup
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding check of os.access to vdsm log file during startup
......................................................................
Adding check of os.access to vdsm log file during startup
If log file isn't accessible we'll report to syslog and exit
Change-Id: I578bdfaa199afc2d5f154a1de12241e02b1ca1a4
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/vdsm
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/9700/1
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 035ea5d..94c795b 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -111,6 +111,11 @@
sys.exit(1)
+def __assertLogPermission():
+ logfile = constants.P_VDSM_LOG + "vdsm.log"
+ assert(os.access(logfile, os.W_OK), "error in accessing vdsm log file")
+
+
def __assertVdsmUser():
username = getpass.getuser()
assert username == constants.VDSM_USER, (
@@ -124,6 +129,7 @@
if __name__ == '__main__':
__assertVdsmUser()
+ __assertLogPermission()
os.setpgrp()
parse_args()
run()
--
To view, visit http://gerrit.ovirt.org/9700
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I578bdfaa199afc2d5f154a1de12241e02b1ca1a4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: PEP8 completely fix caps and its tests.
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: PEP8 completely fix caps and its tests.
......................................................................
PEP8 completely fix caps and its tests.
This is not only nice but necessary because as of the previous
commit, the build didn't work.
Change-Id: I1108522ba9c4736a6a8a3f1ac828d3eb364206dd
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M tests/capsTests.py
M vdsm/caps.py
2 files changed, 16 insertions(+), 17 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/10034/1
diff --git a/tests/capsTests.py b/tests/capsTests.py
index dec0ec7..f0d6b54 100644
--- a/tests/capsTests.py
+++ b/tests/capsTests.py
@@ -50,7 +50,7 @@
vpid""".split()))
self.assertEqual(c.mhz(), '2533.402')
self.assertEqual(c.model(),
- 'Intel(R) Xeon(R) CPU E5649 @ 2.53GHz')
+ 'Intel(R) Xeon(R) CPU E5649 @ 2.53GHz')
def testCpuTopology(self):
testPath = os.path.realpath(__file__)
@@ -67,14 +67,14 @@
path = os.path.join(dirName, "caps_libvirt.out")
machines = caps._getEmulatedMachines(file(path).read())
expectedMachines = ['pc-1.2', 'none', 'pc', 'pc-1.1', 'pc-1.0',
- 'pc-0.15', 'pc-0.14', 'pc-0.13', 'pc-0.12', 'pc-0.11',
- 'pc-0.10', 'isapc']
+ 'pc-0.15', 'pc-0.14', 'pc-0.13', 'pc-0.12',
+ 'pc-0.11', 'pc-0.10', 'isapc']
self.assertEqual(machines, expectedMachines)
def test_parseKeyVal(self):
lines = ["x=&2", "y& = 2", " z = 2 ", " s=3=&'5", " w=", "4&"]
expectedRes = [{'x': '&2', 'y&': '2', 'z': '2', 's': "3=&'5", 'w': ''},
- {'x=': '2', 'y': '= 2', 's=3=': "'5", '4': ''}]
+ {'x=': '2', 'y': '= 2', 's=3=': "'5", '4': ''}]
sign = ["=", "&"]
for res, s in zip(expectedRes, sign):
self.assertEqual(res, caps._parseKeyVal(lines, s))
diff --git a/vdsm/caps.py b/vdsm/caps.py
index 0b16796..d1297c9 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -117,9 +117,9 @@
cells = host.getElementsByTagName('cells')[0]
topology = {'cells': int(cells.getAttribute('num')),
'sockets': int(cpu.getElementsByTagName('topology')[0].
- getAttribute('sockets')),
+ getAttribute('sockets')),
'cores': int(cpu.getElementsByTagName('topology')[0].
- getAttribute('cores')),
+ getAttribute('cores')),
'threads': cells.getElementsByTagName('cpu').length}
return topology
@@ -134,6 +134,7 @@
return [m.firstChild.data for m in archTag.childNodes
if m.nodeName == 'machine']
return []
+
def _getAllCpuModels():
cpu_map = minidom.parseString(
@@ -171,9 +172,8 @@
xml = '<cpu match="minimum"><model>%s</model>' \
'<vendor>%s</vendor></cpu>' % (model, vendor)
try:
- return c.compareCPU(xml, 0) in (
- libvirt.VIR_CPU_COMPARE_SUPERSET,
- libvirt.VIR_CPU_COMPARE_IDENTICAL)
+ return c.compareCPU(xml, 0) in (libvirt.VIR_CPU_COMPARE_SUPERSET,
+ libvirt.VIR_CPU_COMPARE_IDENTICAL)
except libvirt.libvirtError, e:
# hack around libvirt BZ#795836
if e.get_error_code() == libvirt.VIR_ERR_OPERATION_INVALID:
@@ -198,7 +198,7 @@
def _getIscsiIniName():
try:
return _parseKeyVal(
- file('/etc/iscsi/initiatorname.iscsi'))['InitiatorName']
+ file('/etc/iscsi/initiatorname.iscsi'))['InitiatorName']
except:
logging.error('reporting empty InitiatorName', exc_info=True)
return ''
@@ -248,8 +248,8 @@
caps = {}
caps['kvmEnabled'] = \
- str(config.getboolean('vars', 'fake_kvm_support') or
- os.path.exists('/dev/kvm')).lower()
+ str(config.getboolean('vars', 'fake_kvm_support') or
+ os.path.exists('/dev/kvm')).lower()
cpuInfo = CpuInfo()
cpuTopology = CpuTopology()
@@ -289,9 +289,8 @@
caps['vmTypes'] = ['kvm']
caps['memSize'] = str(utils.readMemInfo()['MemTotal'] / 1024)
- caps['reservedMem'] = str(
- config.getint('vars', 'host_mem_reserve') +
- config.getint('vars', 'extra_mem_reserve'))
+ caps['reservedMem'] = str(config.getint('vars', 'host_mem_reserve') +
+ config.getint('vars', 'extra_mem_reserve'))
caps['guestOverhead'] = config.get('vars', 'guest_ram_overhead')
return caps
@@ -301,7 +300,7 @@
remote = struct.unpack('I', socket.inet_aton(addr))[0]
for line in itertools.islice(file(fileName), 1, None):
iface, dest, gateway, flags, refcnt, use, metric, \
- mask, mtu, window, irtt = line.split()
+ mask, mtu, window, irtt = line.split()
dest = int(dest, 16)
mask = int(mask, 16)
if remote & mask == dest & mask:
@@ -313,7 +312,7 @@
def kernelDict():
try:
ver, rel = file('/proc/sys/kernel/osrelease').read(). \
- strip().split('-', 1)
+ strip().split('-', 1)
except:
logging.error('kernel release not found', exc_info=True)
ver, rel = '0', '0'
--
To view, visit http://gerrit.ovirt.org/10034
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1108522ba9c4736a6a8a3f1ac828d3eb364206dd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: add "uptime" field to the getStats (getVdsStats in vdsClient...
by peet@redhat.com
Peter V. Saveliev has uploaded a new change for review.
Change subject: add "uptime" field to the getStats (getVdsStats in vdsClient) call.
......................................................................
add "uptime" field to the getStats (getVdsStats in vdsClient) call.
"uptime" field, measured in seconds, contains VDSM run time since
start, actually -- since first API.py import
Signed-off-by: Peter V. Saveliev <peet(a)redhat.com>
Change-Id: Ibc998117e25faff17c2f3f6d66e2a961fc93e029
---
M vdsm/API.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8008/1
diff --git a/vdsm/API.py b/vdsm/API.py
index 566d6e5..2c21a9e 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -47,7 +47,7 @@
USER_SHUTDOWN_MESSAGE = 'System going down'
PAGE_SIZE_BYTES = os.sysconf('SC_PAGESIZE')
-
+STARTTIME = time.time()
class APIBase(object):
@@ -1103,6 +1103,7 @@
stats['netConfigDirty'] = str(self._cif._netConfigDirty)
stats['generationID'] = self._cif._generationID
+ stats['uptime'] = time.time() - STARTTIME
return {'status': doneCode, 'info': stats}
def setLogLevel(self, level):
--
To view, visit http://gerrit.ovirt.org/8008
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc998117e25faff17c2f3f6d66e2a961fc93e029
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: spec: two minor beautifications
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: spec: two minor beautifications
......................................................................
spec: two minor beautifications
Change-Id: I2d720b038cfeca00c4984b9ddbe63faec060a528
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/10000/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 58ae87c..606090d 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -140,9 +140,10 @@
Requires: %{name}-python = %{version}-%{release}
Requires: pyparted
-Requires(pre,preun): policycoreutils-python
Requires(post): /usr/sbin/saslpasswd2
Requires(post): /bin/hostname
+Requires(post): policycoreutils-python
+Requires(preun): policycoreutils-python
%description
The VDSM service is required by a Virtualization Manager to manage the
@@ -205,7 +206,7 @@
Summary: VDSM python libraries
%description python
-Shared libraries beween the various VDSM packages.
+Shared libraries between the various VDSM packages.
%package debug-plugin
Summary: VDSM Debug Plugin
--
To view, visit http://gerrit.ovirt.org/10000
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d720b038cfeca00c4984b9ddbe63faec060a528
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: schema: Missing comment for new VmDeviceType
by agl@us.ibm.com
Adam Litke has uploaded a new change for review.
Change subject: schema: Missing comment for new VmDeviceType
......................................................................
schema: Missing comment for new VmDeviceType
When adding a new 'console' VmDeviceType, the submitter forgot to include
documentation in the comment block. This caused process-schema.py to fail.
Change-Id: Icd7db71a4cd1a2addd31815a73dcd5c1cda7af4f
Signed-off-by: Adam Litke <agl(a)us.ibm.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/10013/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index cf02f31..1b1c075 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -1681,6 +1681,8 @@
#
# @channel: A host-guest communication channel
#
+# @console: A console device
+#
# Since: 4.10.0
##
{'enum': 'VmDeviceType',
--
To view, visit http://gerrit.ovirt.org/10013
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd7db71a4cd1a2addd31815a73dcd5c1cda7af4f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <agl(a)us.ibm.com>
11 years, 5 months
Change in vdsm[master]: schema: Fix schema for VM.updateDevice
by agl@us.ibm.com
Adam Litke has uploaded a new change for review.
Change subject: schema: Fix schema for VM.updateDevice
......................................................................
schema: Fix schema for VM.updateDevice
Another recent update broke the schema file. I'll take the blame for this one
since I approved the change :) Some missing and/or malformed data in comments
was causing the process-schema script to fail. Another reason for validating
the schema during the build.
Change-Id: If88596050ace9511bcc7be65ee46645359e30532
Signed-off-by: Adam Litke <agl(a)us.ibm.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/10012/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index bd15cbb..cf02f31 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -4909,10 +4909,12 @@
##
# @vmUpdateDeviceParams:
#
+# A discriminated record of update parameters for a VM device.
+#
# @deviceType: The VM device type to update. For example 'interface' for
# network devices or 'disk' for disk storage devices.
#
-# Since 4.10.3
+# Since: 4.10.3
##
{'type': 'vmUpdateDeviceParams',
'data': {'deviceType': 'VmDeviceType'},
@@ -4939,11 +4941,11 @@
# by alias. If omitted, it keeps the current mirroring
# configuration.
#
-# Since 4.10.3
+# Since: 4.10.3
##
{'type': 'vmUpdateInterfaceDeviceParams',
'data': {'*network': 'str', '*linkActive': 'bool',
- 'alias': 'str', '*portMirroring': '[str]'}}
+ 'alias': 'str', '*portMirroring': ['str']}}
##
# @VM.updateDevice:
@@ -4958,7 +4960,6 @@
# The VM definition, as updated
#
# Since: 4.10.3
-#
##
{'command': {'class': 'VM', 'name': 'updateDevice'},
'data': {'vmId': 'UUID', 'params': 'vmUpdateDeviceParams'},
--
To view, visit http://gerrit.ovirt.org/10012
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If88596050ace9511bcc7be65ee46645359e30532
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <agl(a)us.ibm.com>
11 years, 5 months
Change in vdsm[master]: schema: Missing schema information for 'syncType'
by agl@us.ibm.com
Adam Litke has uploaded a new change for review.
Change subject: schema: Missing schema information for 'syncType'
......................................................................
schema: Missing schema information for 'syncType'
Commit <> added a new API Image.syncData but did not fully spec the arguments.
The referenced enum type 'syncData' has no definition. Adding the missing bit
based on my examination of the code.
This is why we need something like http://gerrit.ovirt.org/#/c/9433/ to validate
the schema at build time.
Change-Id: Ib2c5df5d39e9bb184958b32449d671f74c3af494
Signed-off-by: Adam Litke <agl(a)us.ibm.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/10011/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 9772e18..bd15cbb 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -3065,6 +3065,21 @@
'returns': 'UUID'}
##
+# @syncType:
+#
+# An enumeration of possible Image synchronization types.
+#
+# @ALL: Sync all volumes
+#
+# @INTERNAL: Sync internal volumes only
+#
+# @LEAF: Sync leaf volumes only
+#
+# Since: 4.11.0
+##
+{'enum': 'syncType', 'data': ['ALL', 'INTERNAL', 'LEAF']}
+
+##
# @Image.syncData:
#
# Synchronize image data between storage domains within same Storage Pool.
--
To view, visit http://gerrit.ovirt.org/10011
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2c5df5d39e9bb184958b32449d671f74c3af494
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <agl(a)us.ibm.com>
11 years, 5 months
Change in vdsm[master]: Fix duplicate emulated machines returned
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: Fix duplicate emulated machines returned
......................................................................
Fix duplicate emulated machines returned
The old code use getElementsByTagName('machine') to collect machines
information, which will hit the default info for that arch and the
kvm domain's. This patch changes to collect machines information from
the node of kvm domain.
Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M vdsm/caps.py
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8208/1
diff --git a/vdsm/caps.py b/vdsm/caps.py
index 98b33ab..c00c957 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -98,15 +98,15 @@
def _getEmulatedMachines():
c = libvirtconnection.get()
caps = minidom.parseString(c.getCapabilities())
- guestTag = caps.getElementsByTagName('guest')
- # Guest element is missing if kvm modules are not loaded
- if len(guestTag) == 0:
+ for domainNode in caps.getElementsByTagName('domain'):
+ if domainNode.getAttribute('type') == 'kvm':
+ break
+ else:
+ # KVM domain is missing if kvm modules are not loaded
return []
- guestTag = guestTag[0]
-
return [m.firstChild.toxml()
- for m in guestTag.getElementsByTagName('machine')]
+ for m in domainNode.getElementsByTagName('machine')]
def _getAllCpuModels():
--
To view, visit http://gerrit.ovirt.org/8208
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
11 years, 5 months
Change in vdsm[master]: add check-local for Makefile.am of vdsm api
by shaohef@linux.vnet.ibm.com
ShaoHe Feng has uploaded a new change for review.
Change subject: add check-local for Makefile.am of vdsm api
......................................................................
add check-local for Makefile.am of vdsm api
check-local can make it easy to check the errors, when new APIs are
added in vdsmapi-schema.json.
Change-Id: I7a07e291822dae9179d3e8a4a90d654a776f085c
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
M vdsm_api/Makefile.am
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/9433/1
diff --git a/vdsm_api/Makefile.am b/vdsm_api/Makefile.am
index 655586f..ebafc3b 100644
--- a/vdsm_api/Makefile.am
+++ b/vdsm_api/Makefile.am
@@ -1,4 +1,9 @@
+CLEANFILES = \
+ schema.html \
+ $(NULL)
+
EXTRA_DIST = \
+ process-schema.py \
vdsmapi-schema.json \
$(NULL)
@@ -11,3 +16,7 @@
dist_vdsm_DATA = \
vdsmapi-schema.json \
$(NULL)
+
+check-local:
+ PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(srcdir)/process-schema.py \
+ $(srcdir)/vdsmapi-schema.json $(srcdir)/schema.html
--
To view, visit http://gerrit.ovirt.org/9433
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a07e291822dae9179d3e8a4a90d654a776f085c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
11 years, 5 months
Change in vdsm[master]: spec: add python-pthreading build require
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: spec: add python-pthreading build require
......................................................................
spec: add python-pthreading build require
Change-Id: Iacfe39f7b50ead3ee2b851bcdfbdc79849c9e8f7
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/9994/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 2cc6ae5..58ae87c 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -60,6 +60,7 @@
BuildRequires: pyflakes
BuildRequires: python-pep8
BuildRequires: systemd-units
+BuildRequires: python-pthreading
%endif
Requires: which
--
To view, visit http://gerrit.ovirt.org/9994
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacfe39f7b50ead3ee2b851bcdfbdc79849c9e8f7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
11 years, 5 months