Change in vdsm[master]: vdsm startup: fix assert statement
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: vdsm startup: fix assert statement
......................................................................
vdsm startup: fix assert statement
SyntaxWarning: assertion is always true, perhaps remove parentheses?
Change-Id: I0b8cb905494b0719147bf299bb6411c3c4616407
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/vdsm
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/9745/1
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 035ea5d..5c81a40 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -118,9 +118,9 @@
"to run from user %s" % (constants.VDSM_USER, username)
)
group = grp.getgrnam(constants.VDSM_GROUP)
- assert ((constants.VDSM_USER in group.gr_mem
- or pwd.getpwnam(constants.VDSM_USER).pw_gid == group.gr_gid),
- "VDSM failed to start: vdsm user is not in KVM group")
+ assert (constants.VDSM_USER in group.gr_mem
+ or pwd.getpwnam(constants.VDSM_USER).pw_gid == group.gr_gid), \
+ "VDSM failed to start: vdsm user is not in KVM group"
if __name__ == '__main__':
__assertVdsmUser()
--
To view, visit http://gerrit.ovirt.org/9745
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b8cb905494b0719147bf299bb6411c3c4616407
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]: iscsi.py: fix log message format
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: iscsi.py: fix log message format
......................................................................
iscsi.py: fix log message format
The logging methods accept the first argument as message, and rest
arguments as format values and options. The original code wrongly splits
a message into several arguments, so only the first part is recognized as
message and the rest are recognized as values.
Since there are no format specifiers in the actually recognized message,
it will raise error when it finds there are format values.
This patch utilizes the implicit string concat feature and fix this bug.
Change-Id: I005f6343f2d8775dbf8406dffe04f6de93a81fce
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm/storage/iscsi.py
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/9690/1
diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index ac4d7f6..d84187b 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -394,9 +394,9 @@
if (minTimeout > maxTimeout or minTimeout < 0):
minTimeout = 2
maxTimeout = 30
- log.warning("One of the following configuration arguments has an ",
- "illegal value: scsi_rescan_minimal_timeout or ",
- "scsi_rescan_maximal_timeout. Set to %s and %s seconds ",
+ log.warning("One of the following configuration arguments has an "
+ "illegal value: scsi_rescan_minimal_timeout or "
+ "scsi_rescan_maximal_timeout. Set to %s and %s seconds "
"respectively.", minTimeout, maxTimeout)
log.debug("Performing SCSI scan, this will take up to %s seconds",
maxTimeout)
--
To view, visit http://gerrit.ovirt.org/9690
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I005f6343f2d8775dbf8406dffe04f6de93a81fce
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
11 years, 5 months
Change in vdsm[master]: Add default MTU=1500 to NIC's ifcfg files.
by Igor Lvovsky
Igor Lvovsky has uploaded a new change for review.
Change subject: Add default MTU=1500 to NIC's ifcfg files.
......................................................................
Add default MTU=1500 to NIC's ifcfg files.
When we add bridge with custom MTU on top of nic, this MTU will be set properly
on interface. But if we'll remove this bridge (including removing of MTU
keyword from NIC's ifcfg file) and add instead the bridge with default MTU
(without MTU keyword at all in ifcfg file) the actual MTU on the interface
will stay as before.
The only way to change the actual MTU is add MTU keyword explicitly to ifcfg file.
Change-Id: I0553a3956ea06586e0ece758932f00a9af640611
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=873745
Signed-off-by: Igor Lvovsky <ilvovsky(a)redhat.com>
---
M vdsm/configNetwork.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/9547/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 75f6e43..570f6b1 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -515,7 +515,7 @@
try:
hwlines = [line for line in open(cf).readlines()
if line.startswith('HWADDR=')]
- l = ['DEVICE=%s\n' % nic, 'ONBOOT=yes\n'] + hwlines
+ l = ['DEVICE=%s\n' % nic, 'ONBOOT=yes\n', 'MTU=1500\n'] + hwlines
open(cf, 'w').writelines(l)
except IOError:
pass
--
To view, visit http://gerrit.ovirt.org/9547
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0553a3956ea06586e0ece758932f00a9af640611
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Igor Lvovsky <ilvovsky(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: [WIP] add host-cpu to api
by lhornyak@redhat.com
Laszlo Hornyak has uploaded a new change for review.
Change subject: [WIP] add host-cpu to api
......................................................................
[WIP] add host-cpu to api
work in progress
Change-Id: Ie9d107deec2f00912878161348ba639eaa6c4f07
Signed-off-by: Laszlo Hornyak <lhornyak(a)redhat.com>
---
M vdsm/libvirtvm.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 12 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/9367/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 3439dc3..52a45b4 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -748,6 +748,11 @@
cputune.appendChild(vcpupin)
self.dom.appendChild(cputune)
+ #cpu-host support
+ # see http://wiki.ovirt.org/wiki/Features/Cpu-host_Support
+ if 'useHostCpuFlags' in self.conf:
+ cpu.setAttribute('model', 'host-passthrough')
+
# This hack is for backward compatibility as the libvirt does not allow
# 'qemu64' guest on intel hardware
if model == 'qemu64' and not '+svm' in features:
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 843cbc7..b7bed35 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2412,6 +2412,8 @@
#
# @vmType: The type of VM
#
+# @useHostCpuFlags: use host CPU flags (host-passthrough) in the vcpus
+#
# Since: 4.10.0
##
{'type': 'VmDefinition',
@@ -2425,7 +2427,8 @@
'pid': 'uint', 'smp': 'uint', '*smpCoresPerSocket': 'uint',
'*smpThreadsPerCore': 'uint', 'status': 'VmStatus',
'timeOffset': 'uint', 'transparentHugePages': 'bool',
- 'vmId': 'UUID', 'vmName': 'str', 'vmType': 'VmType'}}
+ 'vmId': 'UUID', 'vmName': 'str', 'vmType': 'VmType',
+ 'useHostCpuFlags' : 'bool'}}
##
# @VmParameters:
@@ -2463,6 +2466,8 @@
#
# @vmType: The type of VM
#
+# @useHostCpuFlags: use host CPU flags (host-passthrough) in the vcpus
+#
# Since: 4.10.0
##
{'type': 'VmParameters',
@@ -2472,7 +2477,7 @@
'nice': 'int', 'smp': 'uint', 'smpCoresPerSocket': 'uint',
'smpThreadsPerCore': 'uint', 'timeOffset': 'uint',
'transparentHugePages': 'bool', 'vmId': 'UUID', 'vmName': 'str',
- 'vmType': 'VmType'}}
+ 'vmType': 'VmType', 'useHostCpuFlags' : 'true'}}
##
# @VmInfo:
--
To view, visit http://gerrit.ovirt.org/9367
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9d107deec2f00912878161348ba639eaa6c4f07
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <lhornyak(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: Remove duplicate implementation of prefix2netmask
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: Remove duplicate implementation of prefix2netmask
......................................................................
Remove duplicate implementation of prefix2netmask
Change-Id: I113e26ced6dc8d6318ab8e23118fb2394a7257eb
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M tests/netinfoTests.py
M vdsm/configNetwork.py
M vdsm/netinfo.py
3 files changed, 18 insertions(+), 25 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/9759/1
diff --git a/tests/netinfoTests.py b/tests/netinfoTests.py
index 36b4872..ca00046 100644
--- a/tests/netinfoTests.py
+++ b/tests/netinfoTests.py
@@ -38,7 +38,7 @@
if line.startswith('#'):
continue
bitmask, address = [value.strip() for value in line.split()]
- self.assertEqual(netinfo.bitmask_to_address(int(bitmask)),
+ self.assertEqual(netinfo.prefix2netmask(int(bitmask)),
address)
def testSpeedInvalidNic(self):
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 78fd3af..6272303 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -29,8 +29,6 @@
from xml.sax.saxutils import escape
import glob
import shutil
-import socket
-import struct
import libvirt
import selinux
@@ -867,21 +865,6 @@
_validateInterNetworkCompatibility(_netinfo, vlan, nic, bridged)
-def _prefix2netmask(prefix):
- return socket.inet_ntoa(
- struct.pack(
- "!I",
- int(
- (
- ''.ljust(prefix, '1') +
- ''.ljust(32 - prefix, '0')
- ),
- 2
- )
- )
- )
-
-
def addNetwork(network, vlan=None, bonding=None, nics=None, ipaddr=None,
netmask=None, mtu=None, gateway=None, force=False,
configWriter=None, bondingOptions=None, bridged=True,
@@ -896,7 +879,7 @@
prefix = options.get('prefix')
if prefix is not None:
if netmask is None:
- netmask = _prefix2netmask(int(prefix))
+ netmask = netinfo.prefix2netmask(int(prefix))
del options['prefix']
else:
raise ConfigNetworkError(ne.ERR_BAD_PARAMS,
diff --git a/vdsm/netinfo.py b/vdsm/netinfo.py
index 2750662..0e96b8b 100644
--- a/vdsm/netinfo.py
+++ b/vdsm/netinfo.py
@@ -24,6 +24,8 @@
import ethtool
import shlex
import logging
+import socket
+import struct
from fnmatch import fnmatch
from xml.dom import minidom
from itertools import chain
@@ -164,18 +166,26 @@
return addr
-def bitmask_to_address(bitmask):
- binary = ~((1L << (32 - bitmask)) - 1)
- return ".".join(map(lambda x: str(binary >> (x << 3) & 0xff),
- [3, 2, 1, 0]))
-
+def prefix2netmask(prefix):
+ return socket.inet_ntoa(
+ struct.pack(
+ "!I",
+ int(
+ (
+ ''.ljust(prefix, '1') +
+ ''.ljust(32 - prefix, '0')
+ ),
+ 2
+ )
+ )
+ )
def getnetmask(dev):
dev_info_list = ethtool.get_interfaces_info(dev.encode('utf8'))
netmask = dev_info_list[0].ipv4_netmask
if netmask == 0:
return ''
- return bitmask_to_address(netmask)
+ return prefix2netmask(netmask)
def gethwaddr(dev):
--
To view, visit http://gerrit.ovirt.org/9759
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I113e26ced6dc8d6318ab8e23118fb2394a7257eb
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]: cpu mode support for vdsm
by lhornyak@redhat.com
Laszlo Hornyak has uploaded a new change for review.
Change subject: cpu mode support for vdsm
......................................................................
cpu mode support for vdsm
This patch adds special hostPassthrough and hostModel as cpuType values.
If the cpuType is one of these values, the <model> tag will not be
created for libvirt, instead, a mode attribute will be crated in the
<cpu> tag with value 'host-passthrough' or 'host-model'.
Change-Id: I54fb440ef52255f0a7933b000b9b599c2d056021
Signed-off-by: Laszlo Hornyak <lhornyak(a)redhat.com>
---
M vdsm/libvirtvm.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 14 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/9507/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index f20968f..465a688 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -721,9 +721,17 @@
model = features[0]
cpu = self.doc.createElement('cpu')
cpu.setAttribute('match', 'exact')
- m = self.doc.createElement('model')
- m.appendChild(self.doc.createTextNode(model))
- cpu.appendChild(m)
+
+ #and now for something completely different
+ if model == 'hostPassthrough':
+ cpu.setAttribute('mode', 'host-passthrough')
+ elif model == 'hostModel':
+ cpu.setAttribute('mode', 'host-model')
+ else:
+ m = self.doc.createElement('model')
+ m.appendChild(self.doc.createTextNode(model))
+ cpu.appendChild(m)
+
if ('smpCoresPerSocket' in self.conf or
'smpThreadsPerCore' in self.conf):
topo = self.doc.createElement('topology')
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index aa45059..dbfe153 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2383,6 +2383,9 @@
# @clientIp: The IP address of the client connected to the display
#
# @cpuType: The type of CPU being emulated
+# special values 'hostPassthrough' and 'hostModel'
+# are reserved for host-passthrough and host-mode cpu
+# mode
#
# @custom: A dictionary of custom, free-form properties
#
--
To view, visit http://gerrit.ovirt.org/9507
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I54fb440ef52255f0a7933b000b9b599c2d056021
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <lhornyak(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: netwiring: [2/3] Add API definitions.
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netwiring: [2/3] Add API definitions.
......................................................................
netwiring: [2/3] Add API definitions.
Second of the Network Wiring feature patches. It adds the cli support
for using the new updateVmDevice feature.
Change-Id: I637b3f584e28afc5ada6496abbb6f61aadb8d64f
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm_cli/vdsClient.py
1 file changed, 14 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/9561/1
diff --git a/vdsm_cli/vdsClient.py b/vdsm_cli/vdsClient.py
index 8cb78ed..f188825 100644
--- a/vdsm_cli/vdsClient.py
+++ b/vdsm_cli/vdsClient.py
@@ -205,6 +205,10 @@
return self.ExecAndExit(self.s.create(params))
+ def updateVmDevice(self, args):
+ return self.ExecAndExit(self.s.updateVmDevice(args[0],
+ self._eqSplit(args[1:])))
+
def hotplugNic(self, args):
nic = self._parseDriveSpec(args[1])
nic['type'] = 'interface'
@@ -1737,6 +1741,16 @@
'http://libvirt.org/formatdomain.html'
'#elementsCPUTuning'
)),
+ 'updateVmDevice': (serv.updateVmDevice,
+ ('<vmId> <devicespec>',
+ 'Update a VM\'s device',
+ 'devicespec parameters list: r=required, o=optional',
+ 'r type: interface',
+ 'r network: network name',
+ 'r linkState: up|down',
+ 'r alias: libvirt\'s vnic alias',
+ 'o promisc: <blue|red> - Network traffic to mirror'
+ )),
'hotplugNic': (serv.hotplugNic,
('<vmId> <nicspec>',
'Hotplug NIC to existing VM',
--
To view, visit http://gerrit.ovirt.org/9561
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I637b3f584e28afc5ada6496abbb6f61aadb8d64f
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]: netwiring: [1/3] Add API definitions.
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netwiring: [1/3] Add API definitions.
......................................................................
netwiring: [1/3] Add API definitions.
First of the Network Wiring feature patches. It adds the schema
definitions as described in:
http://wiki.ovirt.org/wiki/Feature/DetailedNetworkWiring#New_API
Change-Id: I9d8352f237dbe0229dff368f7c1dfa4f5f8fc766
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/BindingXMLRPC.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 51 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/9560/1
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index d460910..60efbdf 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -262,6 +262,10 @@
vm = API.VM(params['vmId'])
return vm.hotunplugNic(params)
+ def updateVmDevice(self, vmId, params):
+ vm = API.VM(vmId)
+ return vm.updateDevice(params)
+
def vmSnapshot(self, vmId, snapDrives):
vm = API.VM(vmId)
return vm.snapshot(snapDrives)
@@ -789,7 +793,8 @@
(self.vmHotplugDisk, 'hotplugDisk'),
(self.vmHotunplugDisk, 'hotunplugDisk'),
(self.vmHotplugNic, 'hotplugNic'),
- (self.vmHotunplugNic, 'hotunplugNic'))
+ (self.vmHotunplugNic, 'hotunplugNic'),
+ (self.updateVmDevice, 'updateVmDevice'))
def getIrsMethods(self):
return ((self.domainActivate, 'activateStorageDomain'),
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 843cbc7..3818ab7 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -4849,6 +4849,51 @@
'data': {'hibernationVolHandle': 'HibernationVolumeHandle'}}
##
+# @updateVmDeviceParams:
+#
+# Parameters for @VM.updateVmDevice
+#
+# @type: The type of device to update. For example 'interface' for network
+# devices or 'disk' for disk storage devices.
+#
+# @alias: Alias used to identify this device in commands.
+#
+# @network: Name of the bridge the interface will be added to.
+#
+# @linkState: The state in which the link of the interface will be upon
+# successful completion of the api request. The values can be 'up' or 'down'.
+#
+# @promisc: If present, indicates the traffic of the network which should be
+# mirrored to the interface identified by alias.
+#
+# Since 4.11.0
+##
+{'type': 'updateVmDeviceParams',
+ 'data': {'type': 'str', 'network': 'str',
+ 'linkState': 'NetworkInterfaceState', 'alias': 'str', 'promisc': ''}}
+
+##
+# @VM.updateVmDevice:
+#
+# Update the status of a VM's device.
+#
+# @vmId: The UUID of the VM to modify
+#
+# @params: The VM UUID and device information.
+#
+# Returns:
+# The VM definition, as updated
+#
+# Since: 4.11.0
+#
+# Notes:
+# XXX: Split 'params' into direct parameters
+##
+{'command': {'class': 'VM', 'name': 'updateVmDevice'},
+ 'data': {'vmId': 'UUID', 'params': 'updateVmDeviceParams'},
+ 'returns': 'VmDefinition'}
+
+##
# @HotplugNicParams:
#
# Parameters for @VM.hotplugNic.
--
To view, visit http://gerrit.ovirt.org/9560
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d8352f237dbe0229dff368f7c1dfa4f5f8fc766
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]: xmlrpcTests: change skipNoKVM into a decorator
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: xmlrpcTests: change skipNoKVM into a decorator
......................................................................
xmlrpcTests: change skipNoKVM into a decorator
After using skipNoKVM as decorator, the code looks cleaner.
class XMLRPCTest(TestCaseBase):
@skipNoKVM
def testMethod(self):
...
Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M tests/functional/xmlrpcTests.py
1 file changed, 14 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/9783/1
diff --git a/tests/functional/xmlrpcTests.py b/tests/functional/xmlrpcTests.py
index 79e8109..c259533 100644
--- a/tests/functional/xmlrpcTests.py
+++ b/tests/functional/xmlrpcTests.py
@@ -86,6 +86,17 @@
return path
+def skipNoKVM(method):
+ def wrapped(self):
+ r = self.s.getVdsCapabilities()
+ self.assertVdsOK(r)
+ if r['info']['kvmEnabled'] != 'true':
+ raise SkipTest('KVM is not enabled')
+ return method(self)
+ wrapped.func_name = method.func_name
+ return wrapped
+
+
class XMLRPCTest(TestCaseBase):
UPSTATES = frozenset(('Up', 'Powering up', 'Running'))
@@ -127,15 +138,8 @@
'error code: %s, message: %s' % (vdsResult['status']['code'],
vdsResult['status']['message']))
- def skipNoKVM(self):
- r = self.s.getVdsCapabilities()
- self.assertVdsOK(r)
- if r['info']['kvmEnabled'] != 'true':
- raise SkipTest('KVM is not enabled')
-
+ @skipNoKVM
def testStartEmptyVM(self):
- self.skipNoKVM()
-
VMID = '66666666-ffff-4444-bbbb-333333333333'
r = self.s.create({'memSize': '100', 'display': 'vnc', 'vmId': VMID,
@@ -148,9 +152,8 @@
r = self.s.destroy(VMID)
self.assertVdsOK(r)
+ @skipNoKVM
def testStartSmallVM(self):
- self.skipNoKVM()
-
customization = {'vmId': '77777777-ffff-3333-bbbb-222222222222',
'vmName': 'vdsm_testSmallVM'}
@@ -198,9 +201,8 @@
with RollbackContext() as rollback:
self._createVdsmStorageLayout(conf, rollback)
+ @skipNoKVM
def testSimpleVMoLocalfs(self):
- self.skipNoKVM()
-
localfs = storageLayouts['localfs']
drives = []
for poolid, domains in localfs['layout'].iteritems():
--
To view, visit http://gerrit.ovirt.org/9783
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
11 years, 5 months
Change in vdsm[master]: remove redundant import misc
by shaohef@linux.vnet.ibm.com
ShaoHe Feng has uploaded a new change for review.
Change subject: remove redundant import misc
......................................................................
remove redundant import misc
there is already "import storage.misc as misc"
Change-Id: Iacb0b7d4510a2f44cdb3041c4ff10293e6878458
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
M vdsm/supervdsmServer.py
1 file changed, 3 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/72/9372/1
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 34fefdb..840fef0 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -47,9 +47,8 @@
from storage.fileUtils import chown, resolveGid, resolveUid
from storage.fileUtils import validateAccess as _validateAccess
from vdsm.constants import METADATA_GROUP, EXT_UDEVADM, \
- DISKIMAGE_USER, DISKIMAGE_GROUP, P_LIBVIRT_VMCHANNELS
+ DISKIMAGE_USER, DISKIMAGE_GROUP, P_LIBVIRT_VMCHANNELS
from storage.devicemapper import _removeMapping, _getPathsStatus
-import storage.misc
import configNetwork
from vdsm.config import config
import tc
@@ -216,8 +215,8 @@
@logDecorator
def udevTrigger(self, guid):
cmd = [EXT_UDEVADM, 'trigger', '--verbose', '--action', 'change',
- '--property-match=DM_NAME=%s' % guid]
- rc, out, err = storage.misc.execCmd(cmd, sudo=False)
+ '--property-match=DM_NAME=%s' % guid]
+ rc, out, err = misc.execCmd(cmd, sudo=False)
if rc:
raise OSError(errno.EINVAL, "Could not trigger change for device \
%s, out %s\nerr %s" % (guid, out, err))
--
To view, visit http://gerrit.ovirt.org/9372
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacb0b7d4510a2f44cdb3041c4ff10293e6878458
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
11 years, 5 months