Ryan Harper has uploaded a new change for review.
Change subject: Remove rhev/rhevm from vdsm_reg
......................................................................
Remove rhev/rhevm from vdsm_reg
Change-Id: I5366b674c88a75243ef701e94f4adbcb1d2e48b5
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M vdsm_reg/deployUtil.py.in
M vdsm_reg/engine.py
M vdsm_reg/vdsm-complete
M vdsm_reg/vdsm-config
M vdsm_reg/vdsm-gen-cert
M vdsm_reg/vdsm-reg-cmdline
M vdsm_reg/vdsm-reg-setup.in
M vdsm_reg/vdsm-reg.8
M vdsm_reg/vdsm-reg.conf.in
M vdsm_reg/vdsm-upgrade
10 files changed, 90 insertions(+), 90 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/3292/1
--
To view, visit http://gerrit.ovirt.org/3292
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5366b674c88a75243ef701e94f4adbcb1d2e48b5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
Ryan Harper has uploaded a new change for review.
Change subject: Move libvirt username into config
......................................................................
Move libvirt username into config
Removed hardcoded username string from specfile and source
Created a new 'auth' config section in config.py.in
- define a new variable 'libvirt_user'
Update configure.ac to contain a default value without 'rhev' in the name
Update libvirtconnection.py to use the configuration variable
Change-Id: Ibacef5ab3c1a6320086bf6d5c694ec060a6b7bbe
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M configure.ac
M vdsm.spec.in
M vdsm/config.py.in
M vdsm/libvirtconnection.py
4 files changed, 12 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/3291/1
--
To view, visit http://gerrit.ovirt.org/3291
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibacef5ab3c1a6320086bf6d5c694ec060a6b7bbe
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
Ryan Harper has uploaded a new change for review.
Change subject: Change RHEV to oVirt in guestIF.py
......................................................................
Change RHEV to oVirt in guestIF.py
Change-Id: I238e8451ea4a402713b6216e1231f670132742a0
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M vdsm/guestIF.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/3289/1
--
To view, visit http://gerrit.ovirt.org/3289
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I238e8451ea4a402713b6216e1231f670132742a0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
Ryan Harper has uploaded a new change for review.
Change subject: Remove rhevm from vds_bootstrap/
......................................................................
Remove rhevm from vds_bootstrap/
sed -e 's,RHEVM,OVIRT,g' -e 's,RHEV,oVirt,g'
Change-Id: Ib28617f0fa45ff867fcd85eeb7bd49d8d5220d4d
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M vds_bootstrap/vds_bootstrap.py
M vds_bootstrap/vds_bootstrap_complete.py
2 files changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/3287/1
--
To view, visit http://gerrit.ovirt.org/3287
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib28617f0fa45ff867fcd85eeb7bd49d8d5220d4d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
Ryan Harper has uploaded a new change for review.
Change subject: Change vmchannel name to remove rhevm
......................................................................
Change vmchannel name to remove rhevm
Change-Id: I95b44512052bdb5fed8c8c1486eafc41b85b5f13
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M vdsm/libvirtvm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/88/3288/1
--
To view, visit http://gerrit.ovirt.org/3288
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I95b44512052bdb5fed8c8c1486eafc41b85b5f13
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
Ryan Harper has uploaded a new change for review.
Change subject: Change vdsmrepo to something non-rhev specific
......................................................................
Change vdsmrepo to something non-rhev specific
Instead of /rhevm use something more distro agnostic for storage repo path.
Model this after libvirt (/var/lib/libvirt/images).
Change-Id: I080a161f6338d341c986e0aaa2270a90be10891f
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M configure.ac
M vdsm.spec.in
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/3286/1
--
To view, visit http://gerrit.ovirt.org/3286
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I080a161f6338d341c986e0aaa2270a90be10891f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
Tomas Jelinek has uploaded a new change for review.
Change subject: [RFE] Integrate Smartcard support
......................................................................
[RFE] Integrate Smartcard support
This patch is a VDSM part of the following BZs:
https://bugzilla.redhat.com/588481https://bugzilla.redhat.com/802736
This VDSM part integrates the smartcard in
a supported way, not just as an unsupported custom hook.
It also removes the smartcard hook itself.
Change-Id: I7cdaef420c8381d588f6215e66e6a80dd9d2e44b
Signed-off-by: Tomas Jelinek <tjelinek(a)redhat.com>
---
M configure.ac
M vdsm.spec.in
M vdsm/libvirtvm.py
M vdsm_hooks/Makefile.am
M vdsm_hooks/README
D vdsm_hooks/smartcard/Makefile.am
D vdsm_hooks/smartcard/README
D vdsm_hooks/smartcard/before_vm_start.py
8 files changed, 15 insertions(+), 72 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/8450/1
diff --git a/configure.ac b/configure.ac
index 450f714..1136239 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,7 +206,6 @@
vdsm_hooks/qos/Makefile
vdsm_hooks/qemucmdline/Makefile
vdsm_hooks/scratchpad/Makefile
- vdsm_hooks/smartcard/Makefile
vdsm_hooks/smbios/Makefile
vdsm_hooks/sriov/Makefile
vdsm_hooks/vhostmd/Makefile
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 716489a..536aa4f 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -318,14 +318,6 @@
the disk will be erased when the VM destroyed.
VM cannot be migrated when using scratchpad hook
-%package hook-smartcard
-Summary: Smartcard support for Spice protocol in VDSM
-BuildArch: noarch
-
-%description hook-smartcard
-Smartcard hook add support for spice in VDSM.
-Smartcard hook enable user to use its smartcard inside virtual machines.
-
%package hook-smbios
Summary: Adding custom smbios entries to libvirt domain via VDSM
BuildArch: noarch
@@ -863,10 +855,6 @@
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_scratchpad
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_source/50_scratchpad
%{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy/50_scratchpad
-
-%files hook-smartcard
-%defattr(-, root, root, -)
-%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_smartcard
%files hook-smbios
%defattr(-, root, root, -)
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 64a3b6b..bd1de6d 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -782,6 +782,18 @@
input.setAttribute('bus', 'ps2')
self._devices.appendChild(input)
+ def appendSmartcard(self):
+ """
+ Add smartcard section to domain xml
+
+ <smartcard mode='passthrough' type='spicevmc'/>
+ """
+ if self.conf['is_smartcard_enabled'] == 'true':
+ card = self.doc.createElement('smartcard')
+ card.setAttribute('mode', 'passthrough')
+ card.setAttribute('type', 'spicevmc')
+ self._devices.appendChild(card)
+
def appendGraphics(self):
"""
Add graphics section to domain xml.
@@ -1240,6 +1252,7 @@
_QEMU_GA_DEVICE_NAME)
domxml.appendInput()
domxml.appendGraphics()
+ domxml.appendSmartcard()
domxml.appendConsole()
for devType in self._devices:
diff --git a/vdsm_hooks/Makefile.am b/vdsm_hooks/Makefile.am
index e6a8280..56f714f 100644
--- a/vdsm_hooks/Makefile.am
+++ b/vdsm_hooks/Makefile.am
@@ -36,7 +36,6 @@
promisc \
qos \
scratchpad \
- smartcard \
smbios \
sriov \
vmdisk
diff --git a/vdsm_hooks/README b/vdsm_hooks/README
index b45b93e..1659610 100644
--- a/vdsm_hooks/README
+++ b/vdsm_hooks/README
@@ -24,7 +24,7 @@
If you want to enable more then one custom hook use the semicolon as
a separator:
- # rhevm-config -s UserDefinedVMProperties='pincpu=^[0-9]+$;smartcard=^(true|false)$' --cver=3.0
+ # rhevm-config -s UserDefinedVMProperties='pincpu=^[0-9]+$;sap_agent=^(true|false)$' --cver=3.0
The convention is [hook name]=[value], the value is evaluate with regular expression,
If you find regular expression too complex, you can always use the following command:
@@ -47,7 +47,7 @@
pincpu=1
if you want to use more then on hook and you did enable it with the rhevm-config
tool, you can use the semicolon as a separator:
- pincpu=1;smartcard=true
+ pincpu=1;sap_agent=true
b. Another option is to use "Run Once" dialog which mean that you add a custom property
only this time to the VM, next time that you run the VM it will run without the
custom property that you provided.
diff --git a/vdsm_hooks/smartcard/Makefile.am b/vdsm_hooks/smartcard/Makefile.am
deleted file mode 100644
index dfefff5..0000000
--- a/vdsm_hooks/smartcard/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2008 Red Hat, Inc. and/or its affiliates.
-#
-# Licensed to you under the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version. See the files README and
-# LICENSE_GPL_v2 which accompany this distribution.
-#
-
-EXTRA_DIST = \
- before_vm_start.py
-
-install-data-local:
- $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/before_vm_start
- $(INSTALL_SCRIPT) $(srcdir)/before_vm_start.py \
- $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_smartcard
-
-uninstall-local:
- $(RM) $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_smartcard
diff --git a/vdsm_hooks/smartcard/README b/vdsm_hooks/smartcard/README
deleted file mode 100644
index bd376bf..0000000
--- a/vdsm_hooks/smartcard/README
+++ /dev/null
@@ -1,9 +0,0 @@
-smartcard hook:
-===============
-add smartcard support for spice
-
-syntax:
-smartcard: smartcard=true
-
-libvirt xml:
-<smartcard mode='passthrough' type='spicevmc'/>
diff --git a/vdsm_hooks/smartcard/before_vm_start.py b/vdsm_hooks/smartcard/before_vm_start.py
deleted file mode 100755
index 07e52e7..0000000
--- a/vdsm_hooks/smartcard/before_vm_start.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python
-
-import os
-import sys
-import hooking
-import traceback
-
-'''
-smartcard vdsm hook
-adding to domain xml
-<smartcard mode='passthrough' type='spicevmc'/>
-'''
-
-if os.environ.has_key('smartcard'):
- try:
- sys.stderr.write('smartcard: adding smartcard support\n')
- domxml = hooking.read_domxml()
-
- devices = domxml.getElementsByTagName('devices')[0]
- card = domxml.createElement('smartcard')
- card.setAttribute('mode', 'passthrough')
- card.setAttribute('type', 'spicevmc')
-
- devices.appendChild(card)
-
- hooking.write_domxml(domxml)
- except:
- sys.stderr.write('smartcard: [unexpected error]: %s\n' % traceback.format_exc())
- sys.exit(2)
--
To view, visit http://gerrit.ovirt.org/8450
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7cdaef420c8381d588f6215e66e6a80dd9d2e44b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjelinek(a)redhat.com>
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding system information to getCapabilities
......................................................................
Adding system information to getCapabilities
Using dmidecode to get system info and return it by getCaps api
Change-Id: Ic429ef101fcf9047c4b552405314dc7ba9ba07a0
Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=867543
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M Makefile.am
M vdsm.spec.in
M vdsm/Makefile.am
M vdsm/caps.py
A vdsm/dmidecode_util.py
M vdsm/supervdsmServer.py
6 files changed, 61 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/9258/1
diff --git a/Makefile.am b/Makefile.am
index e15d709..da86c25 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,6 +61,7 @@
vdsm/constants.py.in \
vdsm/debugPluginClient.py \
vdsm/define.py \
+ vdsm/dmidecode_util.py \
vdsm/exception.py \
vdsm/gluster \
vdsm/guestIF.py \
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 20ad1dc..57a61cd 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -623,6 +623,7 @@
%{_datadir}/%{vdsm_name}/blkid.py*
%{_datadir}/%{vdsm_name}/caps.py*
%{_datadir}/%{vdsm_name}/clientIF.py*
+%{_datadir}/%{vdsm_name}/dmidecode_util.py*
%{_datadir}/%{vdsm_name}/API.py*
%{_datadir}/%{vdsm_name}/hooking.py*
%{_datadir}/%{vdsm_name}/hooks.py*
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 76a81c6..a7601f1 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -31,6 +31,7 @@
clientIF.py \
configNetwork.py \
debugPluginClient.py \
+ dmidecode_util.py \
guestIF.py \
hooking.py \
hooks.py \
diff --git a/vdsm/caps.py b/vdsm/caps.py
index cfe4caf..8e5b558 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -29,6 +29,7 @@
import itertools
import linecache
import glob
+import supervdsm
import libvirt
import rpm
@@ -254,6 +255,9 @@
cpuInfo = CpuInfo()
cpuTopology = CpuTopology()
+
+ caps['SystemInfo'] = supervdsm.getProxy().getSystemInfo()
+
if config.getboolean('vars', 'report_host_threads_as_cores'):
caps['cpuCores'] = str(cpuTopology.threads())
else:
diff --git a/vdsm/dmidecode_util.py b/vdsm/dmidecode_util.py
new file mode 100644
index 0000000..f009116
--- /dev/null
+++ b/vdsm/dmidecode_util.py
@@ -0,0 +1,49 @@
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+import dmidecode
+
+
+def getSystemInfo():
+ systemInfo = dmidecode.system()
+ data = None
+ for info in systemInfo:
+ try:
+ if systemInfo[info]['data']['Version'] is not None:
+ data = systemInfo[info]['data']
+ break
+ except:
+ continue
+
+ if data is None:
+ raise OSError("could not get system information")
+
+ try:
+ retData = {}
+ retData['Manufacturer'] = data['Manufacturer']
+ retData['Product Name'] = data['Product Name']
+ retData['Version'] = data['Version']
+ retData['Serial Number'] = data['Serial Number']
+ retData['UUID'] = data['UUID']
+ retData['Family'] = data['Family']
+ except:
+ raise OSError("full system information is missing")
+
+ return retData
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 34fefdb..47d9eb0 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -38,6 +38,7 @@
_glusterEnabled = False
from parted_utils import getDevicePartedInfo as _getDevicePartedInfo
from md_utils import getMdDeviceUuidMap as _getMdDeviceUuidMap
+from dmidecode_util import getSystemInfo as _getSystemInfo
from lsblk import getLsBlk as _getLsBlk
from storage.multipath import getScsiSerial as _getScsiSerial
from storage.iscsi import forceIScsiScan as _forceIScsiScan
@@ -106,6 +107,10 @@
return _getLsBlk(*args, **kwargs)
@logDecorator
+ def getSystemInfo(self):
+ return _getSystemInfo()
+
+ @logDecorator
def readMultipathConf(self):
with open(MPATH_CONF) as f:
return [x.strip("\n") for x in f.readlines()]
--
To view, visit http://gerrit.ovirt.org/9258
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic429ef101fcf9047c4b552405314dc7ba9ba07a0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Peter Portante has uploaded a new change for review.
Change subject: Attempt to name created threads appropriately.
......................................................................
Attempt to name created threads appropriately.
When debugging leaked threads, or just trying to understand
what threads are executing at a given point in time, it is
helpful to have names for the threads that relate back to the
purpose and/or individual object they are related to.
Some of the threads had names, but were not directly tied back
to the objects they were related to.
Change-Id: I8131f4cf0ef907ad7abed24065523da9a42bb0d2
Signed-off-by: Peter Portante <peter.portante(a)redhat.com>
---
M vdsm/API.py
M vdsm/clientIF.py
M vdsm/ksm.py
M vdsm/libvirtvm.py
M vdsm/storage/domainMonitor.py
M vdsm/storage/hsm.py
M vdsm/storage/misc.py
M vdsm/storage/processPool.py
M vdsm/storage/resourceManager.py
M vdsm/storage/sd.py
M vdsm/storage/sp.py
M vdsm/storage/storageServer.py
M vdsm/storage/storage_mailbox.py
M vdsm/storage/sync.py
M vdsm/storage/task.py
M vdsm/storage/taskManager.py
M vdsm/storage/threadPool.py
M vdsm/supervdsmServer.py
M vdsm/ut/ivdsm.py
M vdsm/utils.py
M vdsm/vdsmDebugPlugin.py
M vdsm/vm.py
22 files changed, 95 insertions(+), 43 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/3517/1
--
To view, visit http://gerrit.ovirt.org/3517
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8131f4cf0ef907ad7abed24065523da9a42bb0d2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter Portante <peter.portante(a)redhat.com>
Xu He Jie has uploaded a new change for review.
Change subject: Move IOUSER from misc.py to constants.py
......................................................................
Move IOUSER from misc.py to constants.py
Move IOUSER from misc.py to constants.py and add it to configure.ac.
make it configurable.
Change-Id: Id5d20317ac5a38d8ddd74b26272cd870aa4702b9
---
M configure.ac
M vdsm/constants.py.in
M vdsm/storage/misc.py
M vdsm/storage/safelease.py
4 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/3362/1
--
To view, visit http://gerrit.ovirt.org/3362
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5d20317ac5a38d8ddd74b26272cd870aa4702b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
Xu He Jie has uploaded a new change for review.
Change subject: move Global api to clientif
......................................................................
move Global api to clientif
Change-Id: I02338ed41b5d200fd0ffd9b96499ae449060f235
Signed-off-by: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
---
M vdsm/API.py
M vdsm/clientIF.py
2 files changed, 446 insertions(+), 355 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/5527/1
--
To view, visit http://gerrit.ovirt.org/5527
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I02338ed41b5d200fd0ffd9b96499ae449060f235
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
Xu He Jie has uploaded a new change for review.
Change subject: move the implement of storage related api to hsm
......................................................................
move the implement of storage related api to hsm
Change-Id: Iff7969ac4aa17d52741a5b46c00efd62fc0f9dc6
Signed-off-by: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
---
M vdsm/API.py
M vdsm/storage/hsm.py
2 files changed, 469 insertions(+), 178 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/5526/1
--
To view, visit http://gerrit.ovirt.org/5526
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff7969ac4aa17d52741a5b46c00efd62fc0f9dc6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
Xu He Jie has uploaded a new change for review.
Change subject: move VM api implement to vmm module
......................................................................
move VM api implement to vmm module
Create a vmm module to manage vm stuff. clientIF will
instance VMM and VMM will regist it's API implement to
API layer. After all API implement move to submodule,
we don't need passing clientIF to anywhere and any
global object.
* create vmm module to manager vm
* move VM api implement to vmm module
Change-Id: Ib27a0e9300b55f25fa81d66d1055688122bb33db
Signed-off-by: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
---
M vdsm.spec.in
M vdsm/API.py
M vdsm/BindingXMLRPC.py
M vdsm/Makefile.am
M vdsm/clientIF.py
A vdsm/vmm.py
6 files changed, 854 insertions(+), 598 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/5525/1
--
To view, visit http://gerrit.ovirt.org/5525
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib27a0e9300b55f25fa81d66d1055688122bb33db
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
Xu He Jie has uploaded a new change for review.
Change subject: add api registeration mechanism
......................................................................
add api registeration mechanism
add registAPI method, then other modules can implement the api and
regist their implement to API.py.
*add api registeration mechanism
*add Base class for add ABCMeta as metaclass
*add class decorator for add abstractmethod for every public method.
this can limit people to implement the api as interface.
*add PartialProxy it similar as functools.partial, but this can
access class member
Change-Id: I8eabbec2526041e548591b62252d754b1f5934b5
Signed-off-by: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
---
A tests/apiTests.py
M vdsm/API.py
2 files changed, 119 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/5524/1
--
To view, visit http://gerrit.ovirt.org/5524
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8eabbec2526041e548591b62252d754b1f5934b5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
Michal Skrivanek has uploaded a new change for review.
Change subject: Bug 852956 - 3.1 - prepareForShutdown is not called when connection to libvirt is broken with event: libvirtError: internal error client socket is closed add few more error codes from libvirt's virsh code
......................................................................
Bug 852956 - 3.1 - prepareForShutdown is not called when connection to libvirt is broken with event: libvirtError: internal error client socket is closed
add few more error codes from libvirt's virsh code
Change-Id: Ic1d9a2cd9bfd7da9118d643d0e50106e5e759590
Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=852956
Signed-off-by: Michal Skrivanek <michal.skrivanek(a)redhat.com>
---
M vdsm/libvirtconnection.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/8283/1
diff --git a/vdsm/libvirtconnection.py b/vdsm/libvirtconnection.py
index e525996..01c6db1 100644
--- a/vdsm/libvirtconnection.py
+++ b/vdsm/libvirtconnection.py
@@ -87,7 +87,10 @@
setattr(ret, name, wrapMethod(method))
return ret
except libvirt.libvirtError, e:
- if (e.get_error_domain() in (libvirt.VIR_FROM_REMOTE, libvirt.VIR_FROM_RPC)
+ if (e.get_error_domain() in (libvirt.VIR_FROM_REMOTE,
+ libvirt.VIR_FROM_RPC,
+ libvirt.VIR_ERR_NO_CONNECT,
+ libvirt.VIR_ERR_INVALID_CONN)
and e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR):
cif.log.error('connection to libvirt broken. '
'taking vdsm down.')
--
To view, visit http://gerrit.ovirt.org/8283
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1d9a2cd9bfd7da9118d643d0e50106e5e759590
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Vinzenz Feenstra has uploaded a new change for review.
Change subject: Improvement of the GuestAgent class memory usage
......................................................................
Improvement of the GuestAgent class memory usage
Introduction of a new configuration option guest_agent_max_allowed_message_size
which defines the maximum length of a message coming from the guest agent. The
default value has been set to 1 MiB.
Change in the implementation of reading and handling messages from the guest
agent. Every 64KiB the newly arrived content is checked for a newline character
and all messages are handled immediately before it continues to read.
If the received data do not contain a new line character the data is appended
to the buffer list and the _buffer_size variable increased by the size of all
stored buffers in the list. If _buffer_size exceeds the defined threshold,
defined in 'guest_agent_max_allowed_message_size', the buffer list will be
discarded and _buffer_size will be reset to 0.
If there is a started message which will be finished afterwards it will have an
invalid format and therefore be discarded.
This change has been done to improve the amount of memory consumed by instances
of the GuestAgent class.
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Change-Id: Ibf6274bb10c9e3b80962b69c5df316f03ee21214
---
M vdsm/config.py.in
M vdsm/guestIF.py
2 files changed, 39 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/9239/1
diff --git a/vdsm/config.py.in b/vdsm/config.py.in
index 8e7c6e8..fc35c71 100644
--- a/vdsm/config.py.in
+++ b/vdsm/config.py.in
@@ -89,6 +89,9 @@
'Grace period (seconds) to let guest user close his '
'applications before shutdown.'),
+ ('guest_agent_max_allowed_message_size', '1048576',
+ 'Maximum allowed size for guest agent messages.'),
+
('guest_agent_timeout', '30',
'Time (in sec) to wait for guest agent.'),
diff --git a/vdsm/guestIF.py b/vdsm/guestIF.py
index 96c421b..1b188a4 100644
--- a/vdsm/guestIF.py
+++ b/vdsm/guestIF.py
@@ -23,6 +23,7 @@
import socket
import json
import supervdsm
+from vdsm.config import config
__RESTRICTED_CHARS = set(range(8 + 1)).union(
set(range(0xB, 0xC + 1))).union(
@@ -52,6 +53,8 @@
class GuestAgent ():
def __init__(self, socketName, channelListener, log, user='Unknown',
ips='', connect=True):
+ self.MAX_MESSAGE_SIZE = \
+ config.getint('vars', 'guest_agent_max_allowed_message_size')
self.log = log
self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
# Save the socket's fileno because a call to fileno() fails if the
@@ -95,7 +98,7 @@
self.log.debug("Attempting connection to %s", self._socketName)
if self._sock.connect_ex(self._socketName) == 0:
self.log.debug("Connected to %s", self._socketName)
- self._buffer = ''
+ self._clear_read_buffer()
self._forward('refresh')
self._stopped = False
ret = True
@@ -259,23 +262,45 @@
self.log.log(logging.TRACE, "Guest connection timed out")
self.guestStatus = None
+ def _clear_read_buffer(self):
+ self._buffer = []
+ self._buffer_size = 0
+
+ def _process_message(self, line):
+ try:
+ (message, args) = self._parseLine(line)
+ self._agentTimestamp = time.time()
+ self._handleMessage(message, args)
+ except ValueError as err:
+ self.log.error("%s: %s" % (err, repr(line)))
+
+ def _handle_data(self, data):
+ while '\n' in data:
+ line, data = data.split('\n', 1)
+ line = ''.join(self._buffer) + line
+ self._clear_read_buffer()
+ self._process_message(line)
+
+ self._buffer.append(data)
+ self._buffer_size += len(data)
+
+ if self._buffer_size >= self.MAX_MESSAGE_SIZE:
+ self.log.error("[GuestAgent._handle_data] Discarding buffer with "
+ "size: %d because the message reached maximum size "
+ "of %d bytes before message end was reached." %
+ (self._buffer_size, self.MAX_MESSAGE_SIZE))
+ self._clear_read_buffer()
+
@staticmethod
def _onChannelRead(self):
try:
- while True:
- self._buffer += self._sock.recv(2 ** 16)
+ while (not self._stopped):
+ data = self._sock.recv(2 ** 16)
+ self._handle_data(data)
except socket.error as err:
if err.errno == 11:
# Nothing more to receive (Resource temporarily unavailable).
pass
- while (not self._stopped) and (self._buffer.find('\n') >= 0):
- line, self._buffer = self._buffer.split('\n', 1)
- try:
- (message, args) = self._parseLine(line)
- self._agentTimestamp = time.time()
- self._handleMessage(message, args)
- except ValueError as err:
- self.log.error("%s: %s" % (err, repr(line)))
def _parseLine(self, line):
args = json.loads(line.decode('utf8'))
--
To view, visit http://gerrit.ovirt.org/9239
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf6274bb10c9e3b80962b69c5df316f03ee21214
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Igor Lvovsky has uploaded a new change for review.
Change subject: Allow to remove NIC if it not in use
......................................................................
Allow to remove NIC if it not in use
Change-Id: Ifb8e5fce14fc38c3df9c0b12dc4077726436807e
Signed-off-by: Igor Lvovsky <ilvovsky(a)redhat.com>
---
M vdsm/configNetwork.py
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/9508/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 09d70ac..b188860 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -1133,12 +1133,12 @@
configWriter.removeBonding(bonding)
iface = None if bonding == iface else iface
- for nic in nics:
- if not nicOtherUsers(network, vlan, bonding, nic):
- ifdown(nic)
- configWriter.removeNic(nic)
- ifup(nic)
- iface = None if nic == iface else iface
+ for nic in nics:
+ if not nicOtherUsers(network, vlan, bonding, nic):
+ ifdown(nic)
+ configWriter.removeNic(nic)
+ ifup(nic)
+ iface = None if nic == iface else iface
# Now we can restart changed interface
if iface:
--
To view, visit http://gerrit.ovirt.org/9508
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb8e5fce14fc38c3df9c0b12dc4077726436807e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Igor Lvovsky <ilvovsky(a)redhat.com>
Eduardo has uploaded a new change for review.
Change subject: Related to BZ#843387 - Payload should set volPath or raise.
......................................................................
Related to BZ#843387 - Payload should set volPath or raise.
Change-Id: I0d5b36a88752ad2191226191c9502c1717033bbc
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 10 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/6803/1
--
To view, visit http://gerrit.ovirt.org/6803
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d5b36a88752ad2191226191c9502c1717033bbc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: [WIP] Don't fail silently when ifup fails.
......................................................................
[WIP] Don't fail silently when ifup fails.
Up until now we discarded ifup return codes and ignored
the possible errors present in ifup stdout. Use this
information to perform better error reporting.
Change-Id: I1cc9dcc0a6b55d36fc937e1d364bd9c256ecd70a
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/856737
---
M vdsm/configNetwork.py
M vdsm/neterrors.py
2 files changed, 28 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/8415/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index a114798..fb7cd94 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -29,6 +29,7 @@
from xml.sax.saxutils import escape
import glob
import shutil
+from functools import partial
import libvirt
import selinux
@@ -60,15 +61,23 @@
return rc
-def ifup(iface, async=False):
+def ifup(iface, async=False, final=None):
"Bring up an interface"
- _ifup = lambda netIf: execCmd([constants.EXT_IFUP, netIf], raw=True)
+ def _ifup(netIf, toCall=None):
+ rc, out, err = execCmd([constants.EXT_IFUP, netIf], raw=False)
+
+ if rc != 0:
+ # In /etc/sysconfig/network-scripts/ifup* the last line usually
+ # contains the error reason.
+ raise ConfigNetworkError(ne.ERR_FAILED_IFUP, out[-1])
+ elif toCall is not None:
+ toCall()
if async:
# wait for dhcp in another thread,
# so vdsm won't get stuck (BZ#498940)
t = threading.Thread(target=_ifup, name='ifup-waiting-on-dhcp',
- args=(iface,))
+ args=(iface, final))
t.daemon = True
t.start()
else:
@@ -899,6 +908,11 @@
nic = nics[0] if nics else None
iface = bonding or nic
blockingDhcp = utils.tobool(options.get('blockingdhcp'))
+ # Asynchronous top level ifup creation variables.
+ async = options['bootproto'] and blockingDhcp
+ libvirtNetworkCreation = partial(configWriter.createLibvirtNetwork,
+ network, bridged, iface)
+
# take down nics that need to be changed
vlanedIfaces = [v['iface'] for v in _netinfo.vlans.values()]
@@ -959,22 +973,27 @@
# Now we can run ifup for all interfaces
if bonding:
- ifup(bonding, bondBootproto == 'dhcp' and not blockingDhcp)
+ ifup(bonding, bondBootproto == 'dhcp' and not blockingDhcp,
+ libvirtNetworkCreation)
# NICs must be activated in the same order of boot time
# to expose the correct MAC address.
for nic in nicSort(nics):
- ifup(nic, options['bootproto'] and not blockingDhcp)
+ ifup(nic, options['bootproto'] and not blockingDhcp,
+ libvirtNetworkCreation)
# Now we can ifup VLAN interface, because bond and nic already up
if vlan:
- ifup(iface, vlanBootproto == 'dhcp' and not blockingDhcp)
+ ifup(iface, vlanBootproto == 'dhcp' and not blockingDhcp,
+ libvirtNetworkCreation)
if bridged:
- ifup(network, bridgeBootproto == 'dhcp' and not blockingDhcp)
+ ifup(network, bridgeBootproto == 'dhcp' and not blockingDhcp,
+ libvirtNetworkCreation)
# add libvirt network
- configWriter.createLibvirtNetwork(network, bridged, iface)
+ if not async:
+ libvirtNetworkCreation()
def assertBridgeClean(bridge, vlan, bonding, nics):
diff --git a/vdsm/neterrors.py b/vdsm/neterrors.py
index 65e2674..92faa59 100644
--- a/vdsm/neterrors.py
+++ b/vdsm/neterrors.py
@@ -27,4 +27,5 @@
ERR_BAD_VLAN = 26
ERR_BAD_BRIDGE = 27
ERR_USED_BRIDGE = 28
+ERR_FAILED_IFUP = 30
ERR_LOST_CONNECTION = 10 # noConPeer
--
To view, visit http://gerrit.ovirt.org/8415
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cc9dcc0a6b55d36fc937e1d364bd9c256ecd70a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Pradipta Banerjee has uploaded a new change for review.
Change subject: Add getOSName() method in deployUtil for OS detection
......................................................................
Add getOSName() method in deployUtil for OS detection
This patch improves the current detection of whether the running
host is RHEL6 based or Fedora by adding a new method getOSName()
Change-Id: Ifff9b08902cd234dfa03292136317d50e5e3d22b
Signed-off-by: Pradipta Kr. Banerjee <bpradip(a)in.ibm.com>
---
M vds_bootstrap/vds_bootstrap.py
M vdsm_reg/deployUtil.py.in
2 files changed, 24 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/8002/1
diff --git a/vds_bootstrap/vds_bootstrap.py b/vds_bootstrap/vds_bootstrap.py
index 537953d..c6ae08e 100755
--- a/vds_bootstrap/vds_bootstrap.py
+++ b/vds_bootstrap/vds_bootstrap.py
@@ -66,11 +66,18 @@
(LOGDIR, "phase1", strftime("%Y%m%d%H%M%S")),
filemode='w')
-rhel6based = deployUtil.versionCompare(deployUtil.getOSVersion(), "6.0") >= 0
+#Detect RHEL6 or Fedora16 as min supported version
+rhel6based = False
+fedorabased = False
+if (deployUtil.getOSName().lower() == "redhat" and
+ deployUtil.versionCompare(deployUtil.getOSVersion(), "6.0")) >= 0:
+ rhel6based = True
-# TODO this is an infra-hackish heuristic for identifying Fedora
-# drop as soon as possible
-fedorabased = deployUtil.versionCompare(deployUtil.getOSVersion(), "16") >= 0
+if (deployUtil.getOSName().lower() == "fedora" and
+ deployUtil.versionCompare(deployUtil.getOSVersion(), "16")) >= 0:
+ fedorabased = True
+
+logging.debug("fedorabased=%d rhel6based=%d", fedorabased, rhel6based)
if rhel6based:
VDSM_NAME = "vdsm"
diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index bbda70e..e410e32 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -451,6 +451,19 @@
logging.debug("OS Release Ver = %s", osVer[1])
return osVer[1]
+def getOSName():
+ """
+ Return the OS Name, Fedora, Redhat etc
+
+ Return "Unknown OS" on any failure.
+ """
+
+ # platform.linux_distribution returns a tuple (distname, version, id) or
+ # default as given in args in case of any failure
+ osName = platform.linux_distribution(distname='Unknown OS', version='')
+ logging.debug("OS Name = %s", osName[0])
+ return osName[0]
+
def getKernelVR():
"""Return current kernel version and release."""
--
To view, visit http://gerrit.ovirt.org/8002
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifff9b08902cd234dfa03292136317d50e5e3d22b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Pradipta Banerjee <bpradip(a)in.ibm.com>
Royce Lv has uploaded a new change for review.
Change subject: schema: nit fixes in vm definition
......................................................................
schema: nit fixes in vm definition
delete displayPort and displaySecurePort in vmdef
These two ports are selected by libvirt according to API.py
Add boot to vmDef
Change-Id: I14c8f2919390d65a6938b6aadfb09fb2419f74bc
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 5 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/8487/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index e3a1c2a..1c61e36 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2289,6 +2289,8 @@
#
# @acpiEnable: Indicates if ACPI is enabled inside the VM
#
+# @boot: #optional An alias for the type of device used to boot the VM
+#
# @clientIp: The IP address of the client connected to the display
#
# @cpuPinning: #optional Information about CPU pinning
@@ -2302,10 +2304,6 @@
# @display: The type of display
#
# @displayIp: The IP address to use for accessing the VM display
-#
-# @displayPort: The port in use for unencrypted display data
-#
-# @displaySecurePort: The port in use for encrypted display data
#
# @emulatedMachine: The specific machine specification being emulated
#
@@ -2345,8 +2343,9 @@
# Since: 4.10.0
##
{'type': 'VmFullStatus',
- 'data': {'acpiEnable': 'bool', 'clientIp': 'str', '*cpuPinning': 'CpuPinInfoMap',
- 'cpuType': 'str', 'custom': 'StringMap', 'devices': ['VmDevice'],
+ 'data': {'acpiEnable': 'bool', 'clientIp': 'str', '*boot': 'VmBootMode',
+ '*cpuPinning': 'CpuPinInfoMap', 'cpuType': 'str',
+ 'custom': 'StringMap', 'devices': ['VmDevice'],
'display': 'VmDisplayType', 'displayIp': 'str',
'displayPort': 'uint', 'displaySecurePort': 'uint',
'emulatedMachine': 'str', 'keyboardLayout': 'str',
--
To view, visit http://gerrit.ovirt.org/8487
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I14c8f2919390d65a6938b6aadfb09fb2419f74bc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Yaniv Bronhaim has uploaded a new change for review.
Change subject: supervdsmServer is down after failed operation (#851832)
......................................................................
supervdsmServer is down after failed operation (#851832)
https://bugzilla.redhat.com/show_bug.cgi?id=851832
After running operation that throws exception that we don't catch in
supervdsmServer, we catch it in ProxyCaller::__call__ method.
In this except code we reset supervdsmServer and call the same method
again.
If the exception is thrown again, we leave supervdsmServer down And this
is how supervdsmServer remains.
This patch omit the recall and leave the reset to keep on normal flow.
Change-Id: Idad4a622b82259b777851d1b0c1b37ec8da2b01e
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/supervdsm.py
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/7901/1
diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py
index 79e8d81..75e93e2 100644
--- a/vdsm/supervdsm.py
+++ b/vdsm/supervdsm.py
@@ -67,7 +67,6 @@
return callMethod()
except (IOError, socket.error, AuthenticationError):
self._supervdsmProxy._restartSupervdsm()
- return callMethod()
class SuperVdsmProxy(object):
--
To view, visit http://gerrit.ovirt.org/7901
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idad4a622b82259b777851d1b0c1b37ec8da2b01e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Royce Lv has uploaded a new change for review.
Change subject: add general test to be compatible for xmlrpc and rest
......................................................................
add general test to be compatible for xmlrpc and rest
this allow xmlrpc and rest to share common functional testcases
and different binding to handle their own interface
use def file to make test case dynamically changable
Change-Id: I00449f9c22800e2b00109990a7e535da986c5d48
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M configure.ac
M tests/functional/Makefile.am
A tests/functional/SampleDef/Makefile.am
A tests/functional/SampleDef/testBindingUp.def
A tests/functional/defLoader.py
A tests/functional/generalTest.py
M vdsm.spec.in
7 files changed, 121 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/5308/1
--
To view, visit http://gerrit.ovirt.org/5308
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I00449f9c22800e2b00109990a7e535da986c5d48
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)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>
Saggi Mizrahi has uploaded a new change for review.
Change subject: Refactor mom init error flow
......................................................................
Refactor mom init error flow
Splitting a log to to log invocation is bad because it could potentially
separate the 2 log lines. Further more, it usually points out to a bad
flow if you only sometimes need to log in the same flow so you resort to
such tricks.
- Add proper exception when MomThread fails to initialize
- Make the two error flows clear and have each logged properly
Change-Id: I03ff6057cdbb22b88ed2b5766bda399651c4d058
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm/clientIF.py
M vdsm/momIF.py
2 files changed, 25 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/9481/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 82603af..0bd686f 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -29,7 +29,7 @@
from storage.hsm import HSM
from vdsm.config import config
import ksm
-from momIF import MomThread
+from momIF import MomThread, isMomAvailable
from vdsm import netinfo
from vdsm.define import doneCode, errCode
import libvirt
@@ -189,14 +189,20 @@
'Please make sure it is installed.')
def _prepareMOM(self):
- try:
- momconf = config.get("mom", "conf")
- self.mom = MomThread(momconf)
- except:
- self.log.warn("MOM initialization failed and fall "
- "back to KsmMonitor")
- self.log.debug("Details:", exc_info=True)
- self.ksmMonitor = ksm.KsmMonitorThread(self)
+ momconf = config.get("mom", "conf")
+
+ if isMomAvailable():
+ try:
+ self.mom = MomThread(momconf)
+ return
+ except:
+ self.log.warn("MOM initialization failed and fall "
+ "back to KsmMonitor", exc_info=True)
+
+ else:
+ self.log.warn("MOM is not available, fallback to KsmMonitor")
+
+ self.ksmMonitor = ksm.KsmMonitorThread(self)
def _syncLibvirtNetworks(self):
"""
diff --git a/vdsm/momIF.py b/vdsm/momIF.py
index 827e9e4..807daef 100644
--- a/vdsm/momIF.py
+++ b/vdsm/momIF.py
@@ -27,11 +27,20 @@
_momAvailable = False
+class MomNotAvailableError(RuntimeError):
+ pass
+
+
+def isMomAvailable():
+ return _momAvailable
+
+
class MomThread(threading.Thread):
def __init__(self, momconf):
if not _momAvailable:
- raise Exception("MOM is not available")
+ raise MomNotAvailableError()
+
self.log = logging.getLogger("MOM")
self.log.info("Starting up MOM")
self._mom = mom.MOM(momconf)
--
To view, visit http://gerrit.ovirt.org/9481
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I03ff6057cdbb22b88ed2b5766bda399651c4d058
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Dan Kenigsberg has uploaded a new change for review.
Change subject: [WIP] a more delicate rollback
......................................................................
[WIP] a more delicate rollback
If things go wrong during setupNetwork, we try to revert the networking
state to what it used to be. Until this patch, we stopped the network
service, reverted all ifcfg-* files, and restarted networking.
This procedure disruppted all connection, even those unrelated to the
ones being set up.
With this change, we are taking down only affected devices, and revert
them to their pre-setupNetwork state.
Change-Id: If413164a34a1e6f0d7e4ef75ba931e630a26e666
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/configNetwork.py
1 file changed, 37 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/06/9506/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 09d70ac..6e8649c 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -320,6 +320,41 @@
open(confFile, 'w').write(content)
logging.info('Restored %s', confFile)
+ def _devType(self, content):
+ if re.search('^TYPE=Bridge$', content, re.MULTILINE):
+ return "Bridge"
+ elif re.search('^VLAN=yes$', content, re.MULTILINE):
+ return "Vlan"
+ else:
+ return "Other"
+
+ def _sortModifiedIfcfgs(self):
+ devdict = {'Bridge': [],
+ 'Vlan': [],
+ 'Other': []}
+ for confFile, _ in self._backups.iteritems():
+ try:
+ content = file(confFile).read()
+ except IOError as e:
+ if e.errno == os.errno.ENOENT:
+ continue
+ else:
+ raise
+ dev = confFile[len(self.NET_CONF_PREF):]
+
+ devdict[self._devType(content)].append(dev)
+
+ return nicSort(devdict['Other']) + devdict['Vlan'] + \
+ devdict['Bridge']
+
+ def _stopAtomicDevices(self):
+ for dev in reversed(self._sortModifiedIfcfgs()):
+ ifdown(dev)
+
+ def _startAtomicDevices(self):
+ for dev in self._sortModifiedIfcfgs():
+ ifup(dev)
+
@classmethod
def _persistentBackup(cls, filename):
""" Persistently backup ifcfg-* config files """
@@ -374,12 +409,12 @@
if not self._backups and not self._networksBackups:
return
- execCmd(['/etc/init.d/network', 'stop'])
+ self._stopAtomicDevices()
self.restoreAtomicNetworkBackup()
self.restoreAtomicBackup()
- execCmd(['/etc/init.d/network', 'start'])
+ self._startAtomicDevices()
@classmethod
def clearBackups(cls):
--
To view, visit http://gerrit.ovirt.org/9506
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If413164a34a1e6f0d7e4ef75ba931e630a26e666
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Vinzenz Feenstra has uploaded a new change for review.
Change subject: vdsm: Attaching a console should be controllable
......................................................................
vdsm: Attaching a console should be controllable
Added a new VmParameter 'attachConsole' which defines
whether or not a console should be attached upon creation
Change-Id: Ie92b0ad693fdde7eae9091d944403ac4477eb186
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/libvirtvm.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/9359/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index ca31a43..16e081f 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -1260,7 +1260,9 @@
_QEMU_GA_DEVICE_NAME)
domxml.appendInput()
domxml.appendGraphics()
- domxml.appendConsole()
+
+ if utils.tobool(self.conf.get('attachConsole', 'false')):
+ domxml.appendConsole()
for devType in self._devices:
for dev in self._devices[devType]:
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 6591410..f736307 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2379,6 +2379,9 @@
#
# @vmType: The type of VM
#
+# @attachConsole: Defines if a virtio-console should be attached to the
+# virtual machine
+#
# Since: 4.10.0
##
{'type': 'VmParameters',
@@ -2388,7 +2391,7 @@
'nice': 'int', 'smp': 'uint', 'smpCoresPerSocket': 'uint',
'smpThreadsPerCore': 'uint', 'timeOffset': 'uint',
'transparentHugePages': 'bool', 'vmId': 'UUID', 'vmName': 'str',
- 'vmType': 'VmType'}}
+ 'vmType': 'VmType', 'attachConsole': 'bool'}}
##
# @VmInfo:
--
To view, visit http://gerrit.ovirt.org/9359
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie92b0ad693fdde7eae9091d944403ac4477eb186
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: [WIP] netwiring: [3/3] Add API definitions.
......................................................................
[WIP] netwiring: [3/3] Add API definitions.
Third and final of the Network Wiring feature patches. It adds the
implementation for using the new updateVmDevice feature.
TODO: Add vdsm startup creation of the DUMMY_BRIDGE.
TODO: Add the port mirroring processing.
Change-Id: I3b9b4f49f80466a83e3e13f1042ac2a8866c6bcd
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/API.py
M vdsm/define.py
M vdsm/libvirtvm.py
3 files changed, 103 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/9562/1
diff --git a/vdsm/API.py b/vdsm/API.py
index e87b7e5..966a921 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -353,6 +353,17 @@
response['status']['message'] = 'Hibernation process starting'
return response
+ def updateVmDevice(self, params):
+ if 'type' not in params:
+ self.log.error('Missing a required parameters: type')
+ return {'status': {'code': errCode['MissParam']['status']['code'],
+ 'message': 'Missing one of required '
+ 'parameters: type'}}
+ v = self._cif.vmContainer.get(self._UUID)
+ if not v:
+ return errCode['noVM']
+ return v.updateDevice(params)
+
def hotplugNic(self, params):
try:
utils.validateMinimalKeySet(params, ('vmId', 'nic'))
diff --git a/vdsm/define.py b/vdsm/define.py
index 11a6ef6..e2ba196 100644
--- a/vdsm/define.py
+++ b/vdsm/define.py
@@ -124,6 +124,9 @@
'replicaErr': {'status':
{'code': 55,
'message': 'Drive replication error'}},
+ 'updateDevice': {'status':
+ {'code': 56,
+ 'message': 'Failed to update device'}},
'recovery': {'status':
{'code': 99,
'message':
@@ -137,3 +140,5 @@
#exitCodes
ERROR = 1
NORMAL = 0
+
+DUMMY_BRIDGE = 'none-br'
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 3439dc3..3fdde03 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -25,7 +25,7 @@
import threading
import vm
-from vdsm.define import ERROR, doneCode, errCode
+from vdsm.define import ERROR, doneCode, errCode, DUMMY_BRIDGE
from vdsm import utils
from vdsm import constants
import guestIF
@@ -1517,6 +1517,92 @@
return {'status': doneCode, 'vmList': self.status()}
+ def _updateNetDevice(self, params):
+ try:
+ utils.validateMinimalKeySet(params, ('alias', 'linkState'))
+ except ValueError:
+ self.log.error('Missing at least one of the required parameters: '
+ 'alias, linkState')
+ return {'status': {'code': errCode['MissParam']['status']['code'],
+ 'message': 'Missing at least one of required '
+ 'parameters: alias, linkState'}}
+
+ dev = None
+ for dev in self.conf['devices']:
+ if (dev['type'] == vm.NIC_DEVICES and
+ dev['alias'] == params['alias']):
+ break
+
+ if dev is None:
+ self.log.error('Network device %s cannot be updated. It does not'
+ 'exist', params['alias'])
+ return {'status':
+ {'code': errCode['updateDevice']['status']['code'],
+ 'message': 'Missing net device'}}
+
+ network = dev['network']
+
+ # Prepare the updateDevice xml
+ netelem = xml.dom.minidom.Element(params['type'])
+ netelem.setAttribute('type', 'bridge')
+ mac = xml.dom.minidom.Element('mac')
+ mac.setAttribute('address', dev['macAddr'])
+ netelem.appendChild(mac)
+ model = xml.dom.minidom.Element('model')
+ model.setAttribute('type', dev['nicModel'])
+ netelem.appendChild(model)
+
+ if 'network' not in params:
+ # If no network is specified we take the vnic to the dummy bridge
+ # and set the link 'down' always.
+ source = xml.dom.minidom.Element('source')
+ source.setAttribute('bridge', DUMMY_BRIDGE)
+ netelem.appendChild(source)
+ link = xml.dom.minidom.Element('link')
+ link.setAttribute('state', 'down')
+ netelem.appendChild(link)
+ else:
+ # There is a network defined. Thus, we either just modify the link
+ # status or move between network backends.
+ source = xml.dom.minidom.Element('source')
+ source.setAttribute('bridge', network)
+ netelem.appendChild(source)
+ link = xml.dom.minidom.Element('link')
+ if network != params['network']:
+ # If a different network is specified. First we take the link
+ # down and then update the device to connect to the new bridge.
+ link.setAttribute('state', 'down')
+ netelem.appendChild(link)
+ try:
+ self._dom.updateDeviceFlags(
+ netelem.toxml(),
+ libvirt.libvirt.VIR_DOMAIN_AFFECT_LIVE)
+ except:
+ self.log.debug("updateNetDevice failed", exc_info=True)
+ return {'status':
+ {'code': errCode['updateDevice']['status']['code'],
+ 'message': 'Failed to take the link down.'}}
+
+ link.setAttribute('state', params['linkState'])
+ source.setAttribute('bridge', params['network'])
+
+ try:
+ self._dom.updateDeviceFlags(
+ netelem.toxml(),
+ libvirt.libvirt.VIR_DOMAIN_AFFECT_LIVE)
+ except:
+ self.log.debug("updateNetDeviceFlags failed", exc_info=True)
+ return {'status':
+ {'code': errCode['updateDevice']['status']['code'],
+ 'message': 'Failed to take the link %s' % \
+ link.getAttribute('state')}}
+
+ def updateDevice(self, params):
+ if params['type'] == vm.NIC_DEVICES:
+ return self._updateNetDevice(params)
+ else:
+ return errCode['noimpl']
+
def hotunplugNic(self, params):
if self.isMigrating():
return errCode['migInProgress']
--
To view, visit http://gerrit.ovirt.org/9562
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b9b4f49f80466a83e3e13f1042ac2a8866c6bcd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
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>
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>
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>
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netwiring: [1/4] Extend vmInterfaceDevice API def
......................................................................
netwiring: [1/4] Extend vmInterfaceDevice API def
This patch extends the definitions of vmInterfaceDevice in
order to allow vmHotplugNic and vmCreate to set a vnic link
status as well as set portMirroring for it.
Change-Id: I4ef8ad6963682a38d5f65d718e5b2a465ef3af82
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/9599/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 843cbc7..2c02804 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -1980,6 +1980,11 @@
#
# @specParams: #optional Additional device parameters
#
+# @linkActive: #optional Whether the VM network card has its link active (up)
+# or not (down). If omitted, the link will be active
+# @portMirroring: #optional If present, indicates the traffic of which networks
+# should be mirrored to the interface.
+#
# Since: 4.10.0
##
{'type': 'VmInterfaceDevice',
@@ -1987,7 +1992,8 @@
'nicModel': 'VmInterfaceDeviceModel', 'macAddr': 'str',
'network': 'str', '*bootOrder': 'uint',
'address': 'VmDeviceAddress', 'alias': 'str', 'deviceId': 'UUID',
- '*specParams': 'VmInterfaceDeviceSpecParams'}}
+ '*specParams': 'VmInterfaceDeviceSpecParams', '*linkActive': 'bool',
+ '*portMirroring': ['str']}}
##
# @VmVideoDeviceType:
--
To view, visit http://gerrit.ovirt.org/9599
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ef8ad6963682a38d5f65d718e5b2a465ef3af82
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: Specify the ACPI flag when shutting down VMs
......................................................................
Specify the ACPI flag when shutting down VMs
In commit e460308 has been introduced the qemu guest agent support.
When such agent channel is present the default shutdown method uses the
guest agent (which might be missing).
For consistency and to maintain the old behavior we should specify to
use ACPI to shutdown the guest.
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Change-Id: I6ca628ce6f4a5c7f6a937a14b12a5078b32e89dd
---
M vdsm/libvirtvm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/6996/1
--
To view, visit http://gerrit.ovirt.org/6996
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ca628ce6f4a5c7f6a937a14b12a5078b32e89dd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: upgrade: skip volume lease for faulty metadata offsets
......................................................................
upgrade: skip volume lease for faulty metadata offsets
This check has been added to overcome bz882276 (during the domain
upgrade). Few vdsm releases (4.9 prior 496c0c3) generated metadata
offsets higher than 2048 - 100 - 1 that would not permit sanlock
to store the volume resource in the leases LV.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=882276
Change-Id: Ic84108d4fbe0dfee9fe1d57c802f99dd937cd8ec
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/imageRepository/formatConverter.py
1 file changed, 23 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/9600/1
diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py
index cd32a62..a0edaab 100644
--- a/vdsm/storage/imageRepository/formatConverter.py
+++ b/vdsm/storage/imageRepository/formatConverter.py
@@ -18,7 +18,9 @@
# Refer to the README and COPYING files for full details of the license
#
+import errno
import logging
+import sanlock
from vdsm import qemuImg
@@ -27,6 +29,10 @@
from storage import image
from storage import safelease
from storage import volume
+from storage import blockVolume
+
+
+BLKVOL_MAX_OFFSET = sd.LEASES_SIZE - blockVolume.RESERVED_LEASES - 1
def __convertDomainMetadataToTags(domain, targetVersion):
@@ -153,7 +159,23 @@
log.debug("Creating the volume lease for %s", volUUID)
metaId = vol.getMetadataId()
- vol.newVolumeLease(metaId, domain.sdUUID, volUUID)
+
+ try:
+ vol.newVolumeLease(metaId, domain.sdUUID, volUUID)
+ except sanlock.SanlockException, e:
+ metaOffset = (vol.getMetaOffset()
+ if hasattr(vol, "getMetaOffset") else 0
+ # This check has been added to overcome BZ#882276 (during
+ # the domain upgrade). Few vdsm releases (4.9 prior 496c0c3)
+ # generated metadata offsets higher than 2048 - 100 - 1 that
+ # would not permit sanlock to store the volume resource in
+ # the leases LV.
+ if e.errno == errno.ENOSPC and metaOffset > BLKVOL_MAX_OFFSET:
+ log.error("The volume lease for %s has not been "
+ "initialized due bz882276, metadata offset "
+ "too high: %s", volUUID, metaOffset)
+ else:
+ raise
# If this volume is used as a template let's update the other
# volume's permissions and share the volume lease (at the moment
--
To view, visit http://gerrit.ovirt.org/9600
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic84108d4fbe0dfee9fe1d57c802f99dd937cd8ec
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Mark Wu has uploaded a new change for review.
Change subject: Fix return value of shutdown() on failure
......................................................................
Fix return value of shutdown() on failure
Change-Id: Ice01a8db664c8c1a3ca32c15de4865f362e7210e
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/5434/1
--
To view, visit http://gerrit.ovirt.org/5434
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice01a8db664c8c1a3ca32c15de4865f362e7210e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: concurrency: Vdscli uses a new HTTP conn per req.
......................................................................
concurrency: Vdscli uses a new HTTP conn per req.
Python-2.7 changed xmlrpclib's implementation detail of spawining
a new http/https connection per each request to add support for
Keepalive. Unfortunately, this implementation detail was also what
made the xmlrpclib's Transport be thread-safe.
This change reverts the change in Transport, thus mantaining the
thread-safety of our python client code for unencrypted
communications.
Change-Id: Ifb08df759051bb340423958280e88df5792e9ed2
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm_cli/vdscli.py.in
1 file changed, 21 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/9329/1
diff --git a/vdsm_cli/vdscli.py.in b/vdsm_cli/vdscli.py.in
index 2af41b7..9d5d8a3 100644
--- a/vdsm_cli/vdscli.py.in
+++ b/vdsm_cli/vdscli.py.in
@@ -19,7 +19,8 @@
# Refer to the README and COPYING files for full details of the license
#
-import xmlrpclib
+from xmlrpclib import Server, ServerProxy, Transport
+import httplib
import subprocess
import os
from vdsm import SecureXMLRPCServer
@@ -28,6 +29,21 @@
d_tsPath = '@TRUSTSTORE@'
d_addr = '0'
d_port = '54321'
+
+
+class SingleRequestTransport(Transport):
+ '''Python 2.7 Transport introduced a change that makes it reuse connections
+ by default when new connections are requested for a host with an existing
+ connection. This class reverts the change to avoid the concurrency
+ issues.'''
+
+ def make_connection(self, host):
+ '''Creates a new HTTPConnection to the host.'''
+ # create a HTTP connection object from a host descriptor
+ chost, self._extra_headers, x509 = self.get_host_info(host)
+ #store the host argument along with the connection object
+ self._connection = host, httplib.HTTPConnection(chost)
+ return self._connection[1]
def __guessDefaults():
@@ -109,10 +125,11 @@
transport = TransportClass(key_file=KEYFILE,
cert_file=CERTFILE, ca_certs=CACERT)
- server = xmlrpclib.ServerProxy('https://%s' % addrport,
- transport=transport)
+ server = ServerProxy('https://%s' % addrport,
+ transport=transport)
else:
- server = xmlrpclib.Server('http://%s' % addrport)
+ server = Server('http://%s' % addrport,
+ transport=SingleRequestTransport(use_datetime=0))
return server
if __name__ == '__main__':
--
To view, visit http://gerrit.ovirt.org/9329
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb08df759051bb340423958280e88df5792e9ed2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: vdsm-tool: add the sebool configuration module
......................................................................
vdsm-tool: add the sebool configuration module
This patch moves the sebool configuration from a shell scriptlet in the
rpm package to the vdsm-tool command.
Change-Id: I01baf1c17f7cad2a0525b261be6b5ac648576252
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm-tool/Makefile.am
A vdsm-tool/seboolsetup.py
M vdsm.spec.in
3 files changed, 69 insertions(+), 36 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/9362/1
diff --git a/vdsm-tool/Makefile.am b/vdsm-tool/Makefile.am
index 997e339..348940e 100644
--- a/vdsm-tool/Makefile.am
+++ b/vdsm-tool/Makefile.am
@@ -29,5 +29,6 @@
__init__.py \
load_needed_modules.py \
passwd.py \
+ seboolsetup.py \
validate_ovirt_certs.py \
$(NULL)
diff --git a/vdsm-tool/seboolsetup.py b/vdsm-tool/seboolsetup.py
new file mode 100644
index 0000000..dee1e58
--- /dev/null
+++ b/vdsm-tool/seboolsetup.py
@@ -0,0 +1,63 @@
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+import seobject
+from vdsm.tool import expose
+
+SEBOOL_ENABLED = "on"
+SEBOOL_DISABLED = "off"
+
+VDSM_SEBOOL_LIST = [
+ "virt_use_fusefs",
+ "virt_use_nfs",
+ "virt_use_samba",
+ "sanlock_use_fusefs",
+ "sanlock_use_nfs",
+ "sanlock_use_samba",
+ "virt_use_sanlock",
+]
+
+
+def setup_booleans(status):
+ sebool_obj = seobject.booleanRecords()
+ sebool_status = sebool_obj.get_all()
+
+ sebool_obj.start()
+
+ for sebool_variable in VDSM_SEBOOL_LIST:
+ if status and not all(sebool_status[sebool_variable]):
+ sebool_obj.modify(sebool_variable, SEBOOL_ENABLED)
+
+ if not status and any(sebool_status[sebool_variable]):
+ sebool_obj.modify(sebool_variable, SEBOOL_DISABLED)
+
+ sebool_obj.finish()
+
+
+@expose("sebool-enable")
+def sebool_enable():
+ """Enable the required selinux booleans"""
+ setup_booleans(True)
+
+
+@expose("sebool-disable")
+def sebool_disable():
+ """Disable the required selinux booleans"""
+ setup_booleans(False)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 3fa3395..033ce1a 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -456,30 +456,8 @@
/usr/sbin/usermod -a -G %{qemu_group},%{snlk_group} %{vdsm_user}
/usr/sbin/usermod -a -G %{qemu_group},%{vdsm_group} %{snlk_user}
-# vdsm makes extensive use of nfs-exported images
-# The next lines will collect the default selinux behaviour for the booleans
-virtNFS=$(/usr/sbin/semanage boolean -l | /bin/grep virt_use_nfs | cut -d ',' -f 2)
-virtSANLOCK=$(/usr/sbin/semanage boolean -l | /bin/grep virt_use_sanlock | cut -d ',' -f 2)
-snlkNFS=$(/usr/sbin/semanage boolean -l | /bin/grep sanlock_use_nfs | cut -d ',' -f 2)
-
-# Set the booleans and persist it across reboots
-if [[ "${virtNFS}" == *off* || "${virtSANLOCK}" == *off* || \
- "${snlkNFS}" == *off* ]]; then
- /usr/sbin/semanage boolean -m -S targeted -F /dev/stdin << _EOF
-virt_use_nfs=1
-virt_use_sanlock=1
-sanlock_use_nfs=1
-_EOF
-fi
-
-# Set the current state of SELinux booleans
-if /usr/sbin/selinuxenabled; then
- /usr/sbin/setsebool virt_use_nfs on
- /usr/sbin/setsebool virt_use_sanlock on
- /usr/sbin/setsebool sanlock_use_nfs on
-fi
-
%post
+%{_bindir}/vdsm-tool sebool-enable
# set the vdsm "secret" password for libvirt
%{_bindir}/vdsm-tool set-saslpasswd
@@ -521,17 +499,7 @@
/bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
/etc/sysctl.conf
- /usr/sbin/semanage boolean -m -S targeted -F /dev/stdin << _EOF
-virt_use_nfs=0
-virt_use_sanlock=0
-sanlock_use_nfs=0
-_EOF
-
- if /usr/sbin/selinuxenabled; then
- /usr/sbin/setsebool virt_use_nfs off
- /usr/sbin/setsebool virt_use_sanlock off
- /usr/sbin/setsebool sanlock_use_nfs off
- fi
+ %{_bindir}/vdsm-tool sebool-disable
/usr/sbin/saslpasswd2 -p -a libvirt -d vdsm@ovirt
@@ -794,9 +762,10 @@
%{python_sitearch}/%{vdsm_name}/betterPopen/__init__.py*
%{python_sitearch}/%{vdsm_name}/betterPopen/createprocess.so
%{python_sitearch}/%{vdsm_name}/tool/__init__.py*
-%{python_sitearch}/%{vdsm_name}/tool/passwd.py*
-%{python_sitearch}/%{vdsm_name}/tool/validate_ovirt_certs.py*
%{python_sitearch}/%{vdsm_name}/tool/load_needed_modules.py*
+%{python_sitearch}/%{vdsm_name}/tool/passwd.py*
+%{python_sitearch}/%{vdsm_name}/tool/seboolsetup.py*
+%{python_sitearch}/%{vdsm_name}/tool/validate_ovirt_certs.py*
%files tests
%doc %{_datadir}/%{vdsm_name}/tests/README
--
To view, visit http://gerrit.ovirt.org/9362
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I01baf1c17f7cad2a0525b261be6b5ac648576252
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Alon Bar-Lev has uploaded a new change for review.
Change subject: storage: set block schedule elevator using udev
......................................................................
storage: set block schedule elevator using udev
CURRENT IMPLEMENTATION
block schedule elevator is set by bootstrap using modification to kernel
command-lines.
PROBLEMS IN CURRENT IMPLEMENTATION
1. assumption of grub bootloader.
2. assumption of active kernel.
3. assumption of user not override anything.
4. problem to port.
NEW IMPLEMENTATION
Use udev in order to set the block schedule elevator.
User may override behavior using udev rule, no bootloader dependency or
conflict.
The setting is applied also if vdsm is installed manually.
Change-Id: I0a8de1c861bf4570509599b6f47235ed38cc424d
Signed-off-by: Alon Bar-Lev <alonbl(a)redhat.com>
---
M vds_bootstrap/vds_bootstrap.py
M vdsm.spec.in
A vdsm/storage/12-vdsm-elevator.rules
M vdsm/storage/Makefile.am
A vdsm/storage/vdsm-elevator.sh
5 files changed, 31 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/8700/1
diff --git a/vds_bootstrap/vds_bootstrap.py b/vds_bootstrap/vds_bootstrap.py
index 867d6f4..9353daf 100755
--- a/vds_bootstrap/vds_bootstrap.py
+++ b/vds_bootstrap/vds_bootstrap.py
@@ -435,7 +435,7 @@
self.message = ''
self.rc = True
- args = ['elevator=deadline']
+ args = []
if rhel6based and not _constantTSC():
args += ['processor.max_cstate=1']
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4814172..18a3661 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -382,9 +382,13 @@
install -Dm 0755 vdsm/respawn \
%{buildroot}%{_datadir}/%{vdsm_name}/respawn
-# Install the lvm rules
+# Install the udev rules
install -Dm 0644 vdsm/storage/12-vdsm-lvm.rules \
%{buildroot}/lib/udev/rules.d/12-vdsm-lvm.rules
+install -Dm 0644 vdsm/storage/12-vdsm-elevator.rules \
+ %{buildroot}/lib/udev/rules.d/12-vdsm-elevator.rules
+install -Dm 0755 vdsm/storage/vdsm-elevator.sh \
+ %{buildroot}/lib/udev/vdsm-elevator.sh
install -Dm 0644 vdsm/limits.conf \
%{buildroot}/etc/security/limits.d/99-vdsm.conf
@@ -721,6 +725,8 @@
%{_datadir}/%{vdsm_name}/set-conf-item
%{python_sitelib}/sos/plugins/vdsm.py*
/lib/udev/rules.d/12-vdsm-lvm.rules
+/lib/udev/rules.d/12-vdsm-elevator.rules
+/lib/udev/vdsm-elevator.sh
/etc/security/limits.d/99-vdsm.conf
%{_mandir}/man8/vdsmd.8*
%if 0%{?rhel}
diff --git a/vdsm/storage/12-vdsm-elevator.rules b/vdsm/storage/12-vdsm-elevator.rules
new file mode 100644
index 0000000..38a7607
--- /dev/null
+++ b/vdsm/storage/12-vdsm-elevator.rules
@@ -0,0 +1,12 @@
+#
+# Copyright 2012 Red Hat, Inc. and/or its affiliates.
+#
+# Licensed to you under the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version. See the files README and
+# LICENSE_GPL_v2 which accompany this distribution.
+#
+
+# Udev rules for elevator setting.
+
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", RUN+="vdsm-elevator.sh deadline"
diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am
index cff09be..5900802 100644
--- a/vdsm/storage/Makefile.am
+++ b/vdsm/storage/Makefile.am
@@ -65,7 +65,9 @@
volume.py
EXTRA_DIST = \
- 12-vdsm-lvm.rules
+ 12-vdsm-lvm.rules \
+ 12-vdsm-elevator.rules \
+ vdsm-elevator.sh
check-local:
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(srcdir)/storage_exception.py
diff --git a/vdsm/storage/vdsm-elevator.sh b/vdsm/storage/vdsm-elevator.sh
new file mode 100755
index 0000000..6f2ff85
--- /dev/null
+++ b/vdsm/storage/vdsm-elevator.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+elevator="$1"
+scheduler="/sys/${DEVPATH}/queue/scheduler"
+
+if [ -w "${scheduler}" ]; then
+ echo "${elevator}" > "${scheduler}"
+fi
--
To view, visit http://gerrit.ovirt.org/8700
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a8de1c861bf4570509599b6f47235ed38cc424d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl(a)redhat.com>
Saggi Mizrahi has uploaded a new change for review.
Change subject: Have direct file not use the O_DIRECT flag on tmpfs and ramfs
......................................................................
Have direct file not use the O_DIRECT flag on tmpfs and ramfs
tmpfs and ramfs don't support the O_DIRECT flags. This is intentional as
O_DIRECT tells the kernel to bypass the page-cache and those file
systems live solely on the page cache. Since the effect desired by
direct IO is accomplished on these file systems without the flag there
is no reason for the use to test the FS every time before opening a file
for direct access.
The reason we keep the same class instead of falling back to the regular
file object is so we keep the semantics of the DirectFile() class and
the user doesn't have to care that the underlying FS doesn't really
support direct IO.
Change-Id: I7db4136c1a34d960b17312c2c785fc3234b24b92
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm/storage/fileUtils.py
M vdsm/storage/mount.py
2 files changed, 51 insertions(+), 16 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/9595/1
diff --git a/vdsm/storage/fileUtils.py b/vdsm/storage/fileUtils.py
index 13a8cfa..e00a004 100644
--- a/vdsm/storage/fileUtils.py
+++ b/vdsm/storage/fileUtils.py
@@ -31,11 +31,12 @@
import ctypes
from contextlib import contextmanager
import subprocess
-
import shutil
-from vdsm import constants
import logging
import errno
+
+from vdsm import constants
+import mount
libc = ctypes.CDLL("libc.so.6", use_errno=True)
log = logging.getLogger('fileUtils')
@@ -184,10 +185,13 @@
log.warning("Dir %s already exists", dirPath)
if mode is not None:
statinfo = os.stat(dirPath)
- if statinfo[stat.ST_MODE] != mode:
+ curMode = statinfo[stat.ST_MODE]
+ if curMode != mode:
raise OSError(errno.EPERM,
- "Existing %s permissions %s are not as requested %s" %
- (dirPath, oct(statinfo[stat.ST_MODE]), oct(mode)))
+ ("Existing %s permissions %s are not as "
+ "requested %s") % (dirPath,
+ oct(curMode),
+ oct(mode)))
def resolveUid(user):
@@ -219,7 +223,7 @@
currentGid = stat.st_gid
if ((uid == currentUid or user == -1) and
- (gid == currentGid or group == -1)):
+ (gid == currentGid or group == -1)):
return True
os.chown(path, uid, gid)
@@ -243,7 +247,14 @@
raise ValueError("Invalid mode parameter")
self._writable = True
- flags = os.O_DIRECT
+ # Memory only file systems don't support direct IO because direct IO
+ # means "skip the page cache" and they are 100% page cahce.
+ vfstype = mount.findMountOfPath(path).getRecord().fs_vfstype
+ if vfstype in ["tmpfs", "ramfs"]:
+ flags = 0
+ else:
+ flags = os.O_DIRECT
+
if "r" in mode:
if "+" in mode:
flags |= os.O_RDWR
diff --git a/vdsm/storage/mount.py b/vdsm/storage/mount.py
index 94cfae0..aaa9eb0 100644
--- a/vdsm/storage/mount.py
+++ b/vdsm/storage/mount.py
@@ -34,14 +34,14 @@
VFS_EXT3 = "ext3"
MountRecord = namedtuple("MountRecord", "fs_spec fs_file fs_vfstype "
- "fs_mntops fs_freq fs_passno")
+ "fs_mntops fs_freq fs_passno")
_RE_ESCAPE = re.compile(r"\\0\d\d")
def _parseFstabLine(line):
(fs_spec, fs_file, fs_vfstype, fs_mntops,
- fs_freq, fs_passno) = line.split()[:6]
+ fs_freq, fs_passno) = line.split()[:6]
fs_mntops = fs_mntops.split(",")
fs_freq = int(fs_freq)
fs_passno = int(fs_passno)
@@ -50,7 +50,7 @@
fs_mntops = [_parseFstabPath(item) for item in fs_mntops]
return MountRecord(fs_spec, fs_file, fs_vfstype, fs_mntops,
- fs_freq, fs_passno)
+ fs_freq, fs_passno)
def _iterateMtab():
@@ -118,7 +118,7 @@
continue
yield MountRecord(realSpec, rec.fs_file, rec.fs_vfstype,
- rec.fs_mntops, rec.fs_freq, rec.fs_passno)
+ rec.fs_mntops, rec.fs_freq, rec.fs_passno)
def iterMounts():
@@ -144,6 +144,30 @@
return Mount(rec.fs_spec, rec.fs_file)
raise OSError(errno.ENOENT, 'Mount target %s not found' % target)
+
+
+def findMountOfPath(path):
+ # TBD: Bind mounts, should we ignore them?
+ # Follow symlinks (if file exists)
+ path = os.path.realpath(path)
+
+ # Make sure using canonical representation
+ path = os.path.normpath(path)
+
+ # Find longest match
+ maxLen = 0
+ mountRec = None
+ for rec in _iterMountRecords():
+ mntPath = os.path.normpath(rec.fs_file)
+ if len(mntPath) > maxLen:
+ if path.startswith(mntPath):
+ maxLen = len(mntPath)
+ mountRec = rec
+
+ if mountRec is None:
+ raise OSError(errno.ENOENT, os.strerror(errno.ENOENT))
+
+ return Mount(mountRec.fs_spec, mountRec.fs_file)
def getMountFromDevice(device):
@@ -195,7 +219,7 @@
if not p.wait(timeout):
p.kill()
raise OSError(errno.ETIMEDOUT,
- "%s operation timed out" % os.path.basename(cmd[0]))
+ "%s operation timed out" % os.path.basename(cmd[0]))
out, err = p.communicate()
rc = p.returncode
@@ -232,9 +256,9 @@
return record
raise OSError(errno.ENOENT,
- "Mount of `%s` at `%s` does not exist" %
- (self.fs_spec, self.fs_file))
+ "Mount of `%s` at `%s` does not exist" %
+ (self.fs_spec, self.fs_file))
def __repr__(self):
- return "<Mount fs_spec='%s' fs_file='%s'>" % \
- (self.fs_spec, self.fs_file)
+ return ("<Mount fs_spec='%s' fs_file='%s'>" %
+ (self.fs_spec, self.fs_file))
--
To view, visit http://gerrit.ovirt.org/9595
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7db4136c1a34d960b17312c2c785fc3234b24b92
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Igor Lvovsky has uploaded a new change for review.
Change subject: Remove network.service dependencies from vdsmd.service
......................................................................
Remove network.service dependencies from vdsmd.service
In current vdsm behaviour during network rollback vdsm need to stop network service,
rollback latest network changes and start network service again,
but in host with systemd network service can't be stoped.
According to systemd concept if service required by another service it will be immediately
started again. In such situation vdsm can't revert network changes if needed.
In this patch we just remove network.service dependencies from vdsmd.service.
Anyway vdsm start network service explicitly during vdsm start
Change-Id: I03c9696022490da3204a1d5f9676066712f0653d
Signed-off-by: Igor Lvovsky <ilvovsky(a)redhat.com>
---
M vdsm/vdsmd.service
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/9363/1
diff --git a/vdsm/vdsmd.service b/vdsm/vdsmd.service
index fb6d238..6a650f4 100644
--- a/vdsm/vdsmd.service
+++ b/vdsm/vdsmd.service
@@ -1,6 +1,6 @@
[Unit]
Description=Virtual Desktop Server Manager
-Requires=multipathd.service libvirtd.service ntpd.service network.service
+Requires=multipathd.service libvirtd.service ntpd.service
Conflicts=libvirt-guests.service
[Service]
--
To view, visit http://gerrit.ovirt.org/9363
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I03c9696022490da3204a1d5f9676066712f0653d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Igor Lvovsky <ilvovsky(a)redhat.com>
Saggi Mizrahi has uploaded a new change for review.
Change subject: Catch all possible errors in apiTests:JsonRawTest.testMissingSize
......................................................................
Catch all possible errors in apiTests:JsonRawTest.testMissingSize
On old python implementation the overflow is not caught by the struct
object and the disconnection of the server is the sign of the problem.
Change-Id: I1d1a5cbd73583958812abcac1942b83aeea537b9
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M tests/apiTests.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/9594/1
diff --git a/tests/apiTests.py b/tests/apiTests.py
index ff0a785..390cd03 100644
--- a/tests/apiTests.py
+++ b/tests/apiTests.py
@@ -227,7 +227,7 @@
self.assertEquals(4, reply['error']['code'])
def testMissingSize(self):
- self.assertRaises(struct.error, self.sendMessage,
+ self.assertRaises((socket.error, struct.error), self.sendMessage,
"malformed message")
def testClientNotJson(self):
--
To view, visit http://gerrit.ovirt.org/9594
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d1a5cbd73583958812abcac1942b83aeea537b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Dan Kenigsberg has uploaded a new change for review.
Change subject: spec: hack around el6 logrotate dependency issue
......................................................................
spec: hack around el6 logrotate dependency issue
We currently require logrotate >= 3.8.0 which is not part of el6,
because we use the 'su' directive. This patch drops 'su' from el6
builds, and requires logrotate version that does not need it.
Change-Id: I68afc21eb94331204529554a5bb4d275f0dad4a0
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/69/9569/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index eebe535..0800446 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -63,7 +63,7 @@
Requires: which
Requires: sudo >= 1.7.3
-Requires: logrotate >= 3.8.0
+Requires: logrotate
Requires: xz
Requires: ntp
Requires: iproute
@@ -105,6 +105,7 @@
Requires: initscripts >= 9.03.31-2.el6_3.1
Requires: selinux-policy-targeted >= 3.7.19-80
Requires: lvm2 >= 2.02.95-10.el6_3.2
+Requires: logrotate < 3.8.0
%endif
%else
# Subprocess and thread bug was found on python 2.7.2
@@ -393,6 +394,9 @@
%prep
%setup -q
+%if 0%{?rhel} == 6
+sed -i '/ su /d' vdsm/vdsm-logrotate.conf.in
+%endif
%build
%if 0%{?enable_autotools}
--
To view, visit http://gerrit.ovirt.org/9569
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I68afc21eb94331204529554a5bb4d275f0dad4a0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Amador Pahim has uploaded a new change for review.
Change subject: libvirtvm: Removing libvirt snapshot metadata.
......................................................................
libvirtvm: Removing libvirt snapshot metadata.
Bug-Url: http://bugzilla.redhat.com/872277
After creating a new snapshot, it is not possible
to live migrate vm:
libvirtError: Requested operation is not valid:
cannot migrate domain with 1 snapshots
Issue is also affecting live storage migration
due to use of the same vm snapshot function during
the live storage migration process.
This pach removes unused libvirt snapshot metadata
just after snapshot creation allowing live
migration.
Change-Id: I928983a404f822522a0a48218f9c58fa8d6296b1
Signed-off-by: Amador Pahim <apahim(a)redhat.com>
---
M vdsm/libvirtvm.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/9139/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index ca31a43..b213206 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -1913,6 +1913,11 @@
finally:
self.startDisksStatsCollection()
+ # Removing libvirt snapshot metadata
+ curSnap = self._dom.snapshotCurrent(0)
+ snapDelFlags = (libvirt.VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY)
+ curSnap.delete(snapDelFlags)
+
# Successful
break
--
To view, visit http://gerrit.ovirt.org/9139
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I928983a404f822522a0a48218f9c58fa8d6296b1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amador Pahim <apahim(a)redhat.com>
Mark Wu has uploaded a new change for review.
Change subject: Extract a method _getCapsXMLStr() to get capabilities from libvirt
......................................................................
Extract a method _getCapsXMLStr() to get capabilities from libvirt
The new function _getCapsXMLStr() could be shared by _getCpuTopology()
and _getEmulatedMachines(). And it also saves a libvirt call by memorizing
the result.
Change-Id: I004693d64c84479f150f05d348b2e843f48238a4
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M tests/capsTests.py
M vdsm/caps.py
2 files changed, 10 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/9431/1
diff --git a/tests/capsTests.py b/tests/capsTests.py
index 74ddda8..51d23ee 100644
--- a/tests/capsTests.py
+++ b/tests/capsTests.py
@@ -56,7 +56,7 @@
testPath = os.path.realpath(__file__)
dirName = os.path.split(testPath)[0]
path = os.path.join(dirName, "caps_libvirt.out")
- t = caps.CpuTopology(path)
+ t = caps.CpuTopology(file(path).read())
self.assertEqual(t.threads(), 24)
self.assertEqual(t.cores(), 12)
self.assertEqual(t.sockets(), 2)
diff --git a/vdsm/caps.py b/vdsm/caps.py
index fdb06b1..4878f71 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -103,12 +103,15 @@
@utils.memoized
+def _getCapsXMLStr():
+ return libvirtconnection.get().getCapabilities()
+
+
+(a)utils.memoized
def _getCpuTopology(capabilities):
- if capabilities:
- caps = minidom.parse(capabilities)
- else:
- c = libvirtconnection.get()
- caps = minidom.parseString(c.getCapabilities())
+ if capabilities is None:
+ capabilities = _getCapsXMLStr()
+ caps = minidom.parseString(capabilities)
host = caps.getElementsByTagName('host')[0]
cpu = host.getElementsByTagName('cpu')[0]
cells = host.getElementsByTagName('cells')[0]
@@ -123,8 +126,7 @@
@utils.memoized
def _getEmulatedMachines():
- c = libvirtconnection.get()
- caps = minidom.parseString(c.getCapabilities())
+ caps = minidom.parseString(_getCapsXML())
guestTag = caps.getElementsByTagName('guest')
# Guest element is missing if kvm modules are not loaded
if len(guestTag) == 0:
--
To view, visit http://gerrit.ovirt.org/9431
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I004693d64c84479f150f05d348b2e843f48238a4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Dan Kenigsberg has uploaded a new change for review.
Change subject: libvirtvm: prepare for <interface type='network'>
......................................................................
libvirtvm: prepare for <interface type='network'>
In the near future (actually, in the following patch), I would like to
define virtual interfaces with <source network>. If such a VM is
migrated to a host expecting <source bridge>, bad thing would happen.
This patch extracts <interface>'s network for bridge- and network-based
interfaces alike. It should be applied to all the hosts in the cluster
before generating the first network-based interface.
Change-Id: Ib1eeb8c008d95c8812d855c7e073b5f78ffd67b2
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/libvirtvm.py
1 file changed, 9 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/9531/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 3439dc3..1f15306 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -2790,10 +2790,15 @@
mac = x.getElementsByTagName('mac')[0].getAttribute('address')
alias = x.getElementsByTagName('alias')[0].getAttribute('name')
model = x.getElementsByTagName('model')[0].getAttribute('type')
- bridge = None
+
+ network = None
source = x.getElementsByTagName('source')
if source:
- bridge = source[0].getAttribute('bridge')
+ network = source[0].getAttribute('bridge')
+ if not network:
+ network = source[0].getAttribute('network')
+ network = network[len(netinfo.LIBVIRT_NET_PREFIX):]
+
# Get nic address
address = self._getUnderlyingDeviceAddress(x)
for nic in self._devices[vm.NIC_DEVICES]:
@@ -2819,8 +2824,8 @@
'address': address,
'alias': alias,
'name': name}
- if bridge:
- nicDev['network'] = bridge
+ if network:
+ nicDev['network'] = network
self.conf['devices'].append(nicDev)
def _setWriteWatermarks(self):
--
To view, visit http://gerrit.ovirt.org/9531
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1eeb8c008d95c8812d855c7e073b5f78ffd67b2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Dan Yasny has uploaded a new change for review.
Change subject: Signed-off-by: Dan Yasny <dyasny(a)gmail.com>
......................................................................
Signed-off-by: Dan Yasny <dyasny(a)gmail.com>
Cisco VM-FEX support vdsm hooks
Change-Id: I45a7fa46919bb39a648dff190c40618395990e91
Signed-off-by: Dan Yasny <dyasny(a)dy-lappie.usersys.redhat.com>
---
A vdsm_hooks/vmfex/Makefile.am
A vdsm_hooks/vmfex/README
A vdsm_hooks/vmfex/before_vm_migrate_destination.py
A vdsm_hooks/vmfex/before_vm_start.py
4 files changed, 394 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/7547/1
diff --git a/vdsm_hooks/vmfex/Makefile.am b/vdsm_hooks/vmfex/Makefile.am
new file mode 100644
index 0000000..b921275
--- /dev/null
+++ b/vdsm_hooks/vmfex/Makefile.am
@@ -0,0 +1,36 @@
+#
+# Copyright 2011 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+EXTRA_DIST = \
+ before_vm_migrate_destination.py \
+ before_vm_start.py \
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/before_vm_start
+ $(INSTALL_SCRIPT) $(srcdir)/before_vm_start.py \
+ $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_vmfex
+ $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/before_vm_migrate_destination
+ $(INSTALL_SCRIPT) $(srcdir)/before_vm_migrate_destination.py \
+ $(DESTDIR)$(vdsmhooksdir)/before_vm_migrate_destination/50_vmfex
+
+uninstall-local: uninstall-data-sudoers
+ $(RM) $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_vmfex
+ $(RM) $(DESTDIR)$(vdsmhooksdir)/before_vm_migrate_destination/50_vmfex
+
diff --git a/vdsm_hooks/vmfex/README b/vdsm_hooks/vmfex/README
new file mode 100644
index 0000000..1eb7629
--- /dev/null
+++ b/vdsm_hooks/vmfex/README
@@ -0,0 +1,61 @@
+vmfex vdsm hook
+===================
+
+Add Cisco VM-FEX Port Profile to Virtual Machine
+Sample:
+ vmfex=NIC1:profile1,NIC2:profile2...
+
+ Will add 2 virtual nics attached to profile1 and profile2 using the vnic
+ MAC addresses specified, replacing the actual NICs assigned to the VM.
+ The mapping is by order of NIC<number> in the parameters, mapped to the
+ order of the "interface" elements in the devices of the VM xml, as well
+ as the NICs defined for a VM in the RHEV-M admin GUI.
+
+Libvirt internals:
+Replace the existing interface xml:
+ <interface type="bridge">
+ <mac address="<mac>"/>
+ <model type="virtio"/>
+ <source bridge="<logical network>"/>
+ </interface>
+
+with the following interface xml:
+ <interface type='network'>
+ <mac address='<mac>'/>
+ <source network='direct-pool'/>
+ <virtualport type='802.1Qbh'>
+ <parameters profileid='<Port Profile>'/>
+ </virtualport>
+ <model type='virtio'/>
+ </interface>
+
+Dynamic network with libvirt (define a NIC pool, so libvirt can assign VMs to NICs dynamically):
+
+ <network>
+ <name>direct-pool</name>
+ <forward mode="passthrough">
+ <interface dev="eth3"/>
+ <interface dev="eth4"/>
+ <interface dev="eth5"/>
+ <interface dev="eth6"/>
+ <interface dev="eth7"/>
+ <interface dev="eth8"/>
+ <interface dev="eth9"/>
+ <interface dev="eth10"/>
+ <interface dev="eth11"/>
+ </forward>
+ </network>
+
+Using libvirt, the network is defined like this:
+
+ virsh net-define /tmp/direct-pool.xml
+ virsh net-start direct-pool
+ virsh net-autostart direct-pool
+
+(where /tmp/direct-pool.xml contains the xml above)
+
+(everything else is autogenerated, and shouldn't be specified
+when defining a guest (but whatever is there after definition
+should be left in place, e.g. the PCI address)). Note that these
+interface definitions are completely static - you never need to modify
+them due to migration, or starting up/shutting down the guest.
diff --git a/vdsm_hooks/vmfex/before_vm_migrate_destination.py b/vdsm_hooks/vmfex/before_vm_migrate_destination.py
new file mode 100755
index 0000000..a80df7f
--- /dev/null
+++ b/vdsm_hooks/vmfex/before_vm_migrate_destination.py
@@ -0,0 +1,109 @@
+#!/usr/bin/python
+
+import os
+import subprocess
+import sys
+import hooking
+import traceback
+import libvirtconnection
+
+'''
+Placed in before_vm_migrate_destination
+
+vmfex hook on migration destination:
+
+Set up a dynamic NIC pool for incoming migrations to use
+
+ <network>
+ <name>direct-pool</name>
+ <forward mode="passthrough">
+ <interface dev="eth3"/>
+ <interface dev="eth4"/>
+ <interface dev="eth5"/>
+ <interface dev="eth6"/>
+ <interface dev="eth7"/>
+ <interface dev="eth8"/>
+ <interface dev="eth9"/>
+ <interface dev="eth10"/>
+ <interface dev="eth11"/>
+ </forward>
+ </network>
+
+Using libvirt, the network is defined like this:
+
+ virsh net-define /tmp/direct-pool.xml
+ virsh net-start direct-pool
+ virsh net-autostart direct-pool
+
+(where /tmp/direct-pool.xml contains the xml above)
+
+(everything else is autogenerated, and shouldn't be specified
+when defining a guest (but whatever is there after definition
+should be left in place, e.g. the PCI address)). Note that these
+interface definitions are completely static - you never need to modify
+them due to migration, or starting up/shutting down the guest.
+
+'''
+
+def getUsableNics():
+ # Scan localhost for physical NICs and return list of physical nics
+ # that have all zeroes MAC
+ # Example ['eth0','eth1']
+ nics = []
+ cmd = "find /sys/devices/pci* | grep '/net/' |grep address"
+ p = subprocess.Popen(cmd,stdout=subprocess.PIPE,shell=True)
+ s = p.stdout.read().split()
+ for i in s:
+ mac = open(i).read().strip()
+ if mac == '00:00:00:00:00:00':
+ nics.append(i.split('/')[-2])
+ return nics
+
+def createDirectPool(conn):
+ xmlstr = """<network> \n <name>direct-pool</name> \n <forward mode="passthrough"> \n """
+ for i in getUsableNics():
+ s = '<interface dev="' + str(i) + '"/> \n'
+ xmlstr += s
+
+ xmlstr += """ </forward> \n </network> """
+ conn.networkDefineXML(xmlstr)
+ dpool = conn.networkLookupByName('direct-pool')
+ dpool.setAutostart(1)
+ dpool.create()
+
+
+
+if os.environ.has_key('vmfex'):
+ try:
+ #connect to libvirtd
+ conn = libvirtconnection.get('qemu:///system')
+
+ #check for running VMs. If there are VMs running, skip creating a dNIC pool
+ if len(conn.listDomainsID()) == 0:
+ #check if direct-pool is created
+ if 'direct-pool' not in conn.listNetworks():
+ createDirectPool(conn)
+ else:
+ if conn.networkLookupByName('direct-pool').isActive() == 0:
+ conn.networkLookupByName('direct-pool').create()
+ conn.networkLookupByName('direct-pool').setAutostart(1)
+
+ #check if the defined dNIC pool didn't change
+ dpool = conn.networkLookupByName('direct-pool')
+ definedNics = []
+ for i in dpool.split():
+ if 'dev=' in i:
+ definedNics.append(str(i.split('=')[1].split('/')[0].strip("'")))
+ #if the defined NIC pool doesn't match the usable NIC list, recreate the network
+ if set(definedNics) != set(getUsableNics()):
+ conn.networkLookupByName('direct-pool').destroy()
+ conn.networkLookupByName('direct-pool').undefine()
+ createDirectPool(conn)
+
+ if 'direct-pool' not in conn.listNetworks():
+ createDirectPool(conn)
+
+ except:
+ sys.stderr.write('vmfex: [unexpected error]: %s\n' % traceback.format_exc())
+ sys.exit(2)
+
diff --git a/vdsm_hooks/vmfex/before_vm_start.py b/vdsm_hooks/vmfex/before_vm_start.py
new file mode 100755
index 0000000..9002e3f
--- /dev/null
+++ b/vdsm_hooks/vmfex/before_vm_start.py
@@ -0,0 +1,188 @@
+#!/usr/bin/python
+
+import os
+import subprocess
+import sys
+import xml
+import hooking
+import traceback
+from xml.dom import minidom
+import libvirtconnection
+
+'''
+Placed in before_vm_start
+
+vmfex hook:
+Add Cisco VM-FEX Port Profile to Virtual Machine
+Sample:
+ vmfex=NIC1:profile1,NIC2:profile2...
+
+ Will add 2 virtual nics attached to profile1 and profile2 using the vnic
+ MAC addresses specified, replacing the actual NICs assigned to the VM.
+ The mapping is by order of NIC<number> in the parameters, mapped to the
+ order of the "interface" elements in the devices of the VM xml, as well
+ as the NICs defined for a VM in the RHEV-M admin GUI.
+
+Libvirt internals:
+Replace the existing interface xml:
+ <interface type="bridge">
+ <mac address="<mac>"/>
+ <model type="virtio"/>
+ <source bridge="<logical network>"/>
+ </interface>
+
+with the following interface xml:
+ <interface type='network'>
+ <mac address='<mac>'/>
+ <source network='direct-pool'/>
+ <virtualport type='802.1Qbh'>
+ <parameters profileid='<Port Profile>'/>
+ </virtualport>
+ <model type='virtio'/>
+ </interface>
+
+Dynamic network with libvirt (define a NIC pool, so libvirt can assign VMs to NICs dynamically):
+
+ <network>
+ <name>direct-pool</name>
+ <forward mode="passthrough">
+ <interface dev="eth3"/>
+ <interface dev="eth4"/>
+ <interface dev="eth5"/>
+ <interface dev="eth6"/>
+ <interface dev="eth7"/>
+ <interface dev="eth8"/>
+ <interface dev="eth9"/>
+ <interface dev="eth10"/>
+ <interface dev="eth11"/>
+ </forward>
+ </network>
+
+Using libvirt, the network is defined like this:
+
+ virsh net-define /tmp/direct-pool.xml
+ virsh net-start direct-pool
+ virsh net-autostart direct-pool
+
+(where /tmp/direct-pool.xml contains the xml above)
+
+(everything else is autogenerated, and shouldn't be specified
+when defining a guest (but whatever is there after definition
+should be left in place, e.g. the PCI address)). Note that these
+interface definitions are completely static - you never need to modify
+them due to migration, or starting up/shutting down the guest.
+
+'''
+
+def getUsableNics():
+ # Scan localhost for physical NICs and return list of physical nics
+ # that have all zeroes MAC
+ # Example ['eth0','eth1']
+ nics = []
+ cmd = "find /sys/devices/pci* | grep '/net/' |grep address"
+ p = subprocess.Popen(cmd,stdout=subprocess.PIPE,shell=True)
+ s = p.stdout.read().split()
+ for i in s:
+ mac = open(i).read().strip()
+ if mac == '00:00:00:00:00:00':
+ nics.append(i.split('/')[-2])
+ return nics
+
+def enumNics(devices):
+ # Given the domxml of VM devices, return the NIC elements numbered 1 through len()+1
+ vnicmap = {}
+ i = 1
+ for interface in devices.getElementsByTagName('interface'):
+ vnicmap[i] = interface
+ i += 1
+ return vnicmap
+
+def createDirectPool(conn):
+ xmlstr = """<network> \n <name>direct-pool</name> \n <forward mode="passthrough"> \n """
+ for i in getUsableNics():
+ s = '<interface dev="' + str(i) + '"/> \n'
+ xmlstr += s
+
+ xmlstr += """ </forward> \n </network> """
+ conn.networkDefineXML(xmlstr)
+ dpool = conn.networkLookupByName('direct-pool')
+ dpool.setAutostart(1)
+ dpool.create()
+
+
+
+if os.environ.has_key('vmfex'):
+ try:
+ #connect to libvirtd
+ conn = libvirtconnection.get('qemu:///system')
+
+ #check for running VMs. If there are VMs running, skip creating a dNIC pool
+ if len(conn.listDomainsID()) == 0:
+ #check if direct-pool is created
+ if 'direct-pool' not in conn.listNetworks():
+ createDirectPool(conn)
+ else:
+ if conn.networkLookupByName('direct-pool').isActive() == 0:
+ conn.networkLookupByName('direct-pool').create()
+ conn.networkLookupByName('direct-pool').setAutostart(1)
+
+ #check if the defined dNIC pool didn't change
+ dpool = conn.networkLookupByName('direct-pool')
+ definedNics = []
+ for i in dpool.split():
+ if 'dev=' in i:
+ definedNics.append(str(i.split('=')[1].split('/')[0].strip("'")))
+ #if the defined NIC pool doesn't match the usable NIC list, recreate the network
+ if set(definedNics) != set(getUsableNics()):
+ conn.networkLookupByName('direct-pool').destroy()
+ conn.networkLookupByName('direct-pool').undefine()
+ createDirectPool(conn)
+
+ if 'direct-pool' not in conn.listNetworks():
+ createDirectPool(conn)
+
+ except:
+ pass
+
+
+ try:
+ #Get the vmfex line
+ vmfex = os.environ['vmfex']
+
+ #Get the VM's xml definition
+ domxml = hooking.read_domxml()
+ devices = domxml.getElementsByTagName('devices')[0]
+ vnicmap = enumNics(devices)
+
+ counter = 0
+
+ for entry in vmfex.split(','):
+ sys.stderr.write('vmfex: adding interface to profile: %s\n' % entry)
+ try:
+ nicnum = int(entry.split(':')[0][3:])
+ profile = entry.split(':')[1]
+ mynic = vnicmap[nicnum]
+ #replace type="bridge" with "network"
+ mynic.setAttribute('type','network')
+
+ source = mynic.getElementsByTagName('source')[0]
+ source.removeAttribute('bridge')
+ source.setAttribute('network', 'direct-pool')
+
+ virtualport = domxml.createElement('virtualport')
+ virtualport.setAttribute('type', '802.1Qbh')
+ mynic.appendChild(virtualport)
+
+ parameters = domxml.createElement('parameters')
+ parameters.setAttribute('profileid', profile)
+ virtualport.appendChild(parameters)
+
+ except:
+ sys.stderr.write('vmfex: Error in vmfex custom property line: %s\n' % entry)
+ sys.exit(2)
+
+ hooking.write_domxml(domxml)
+ except:
+ sys.stderr.write('vmfex: [unexpected error]: %s\n' % traceback.format_exc())
+ sys.exit(2)
+
--
To view, visit http://gerrit.ovirt.org/7547
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I45a7fa46919bb39a648dff190c40618395990e91
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Yasny <dyasny(a)gmail.com>
Haim Ateya has uploaded a new change for review.
Change subject: BZ#870024 - Make sure during upgrade that lease files have correct permission
......................................................................
BZ#870024 - Make sure during upgrade that lease files have correct permission
Fix a bug where we tried to initialize sanlock lock before calling
the function to set proper permissions.
Change-Id: If28c48d2aeedd092ff3b8100dd64cd8ba673e94f
Signed-off-by: Haim Ateya <hateya(a)redhat.com>
---
M vdsm/storage/imageRepository/formatConverter.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/9517/1
diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py
index 190f9b6..c7952d8 100644
--- a/vdsm/storage/imageRepository/formatConverter.py
+++ b/vdsm/storage/imageRepository/formatConverter.py
@@ -90,6 +90,10 @@
log = logging.getLogger('Storage.v3DomainConverter')
log.debug("Starting conversion for domain %s", domain.sdUUID)
+ if domain.getStorageType() in sd.FILE_DOMAIN_TYPES:
+ log.debug("Setting permissions for domain %s", domain.sdUUID)
+ domain.setMetadataPermissions()
+
log.debug("Initializing the new cluster lock for domain %s", domain.sdUUID)
newClusterLock = safelease.SANLock(domain.sdUUID, domain.getIdsFilePath(),
domain.getLeasesFilePath())
@@ -100,8 +104,6 @@
V2META_SECTORSIZE = 512
- if domain.getStorageType() in sd.FILE_DOMAIN_TYPES:
- domain.setMetadataPermissions()
def v3ResetMetaVolSize(vol):
# BZ811880 Verifiying that the volume size is the same size advertised
--
To view, visit http://gerrit.ovirt.org/9517
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If28c48d2aeedd092ff3b8100dd64cd8ba673e94f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Haim Ateya <hateya(a)redhat.com>
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Sending sigkill to verify svdsm suicide
......................................................................
Sending sigkill to verify svdsm suicide
Svdsm was alive after restart of vdsm. svdsm should use pokeParent
thread to distinguish vdsm pid status, when it recognizes that vdsm pid
is not exist, svdsm kills itself by sending SIGKILL.
The patch changes the signal to SIGKILL and verifies that in the except
scope we won't get exception before calling to os.kill.
Change-Id: I2eb8f1a74f818cd10a08572c9adb5de1c0e21f5a
Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=875486
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/supervdsmServer.py
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/9196/1
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index a1bf8e6..0836b1b 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -293,8 +293,9 @@
os.kill(parentPid, 0)
sleep(2)
except Exception:
- os.unlink(ADDRESS)
- os.kill(os.getpid(), signal.SIGTERM)
+ if os.path.exists(ADDRESS):
+ os.unlink(ADDRESS)
+ os.kill(os.getpid(), signal.SIGKILL)
def main():
--
To view, visit http://gerrit.ovirt.org/9196
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2eb8f1a74f818cd10a08572c9adb5de1c0e21f5a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Mark Wu has uploaded a new change for review.
Change subject: Remove local mount point if storage server connection fails
......................................................................
Remove local mount point if storage server connection fails
Change-Id: Ic7aa1a47b7fa3577e83daa82fbad17fdc2ebd51f
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M vdsm/storage/storageServer.py
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/4298/1
--
To view, visit http://gerrit.ovirt.org/4298
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7aa1a47b7fa3577e83daa82fbad17fdc2ebd51f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: [wip] hooks: add the nested virtualization hook
......................................................................
[wip] hooks: add the nested virtualization hook
If the nested virtualization is enabled in your kvm module this hook
will expose it to the guests.
Change-Id: I08c24c1b932370577e9687d75e292cd7c40f8e5d
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M configure.ac
M vdsm.spec.in
M vdsm_hooks/Makefile.am
A vdsm_hooks/nestedvt/Makefile.am
A vdsm_hooks/nestedvt/before_vm_start.py
5 files changed, 92 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/9225/1
diff --git a/configure.ac b/configure.ac
index 5d8b238..bd92fb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,6 +203,7 @@
vdsm_hooks/hugepages/Makefile
vdsm_hooks/isolatedprivatevlan/Makefile
vdsm_hooks/Makefile
+ vdsm_hooks/nestedvt/Makefile
vdsm_hooks/numa/Makefile
vdsm_hooks/pincpu/Makefile
vdsm_hooks/promisc/Makefile
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 5daea0b..47ce21e 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -284,6 +284,14 @@
by using <filterref filter='clean-traffic'/> libvirt filter
and by adding custom filter: isolatedprivatevlan-vdsm.xml
+%package hook-nestedvt
+Summary: Nested Virtualization support for VDSM
+BuildArch: noarch
+
+%description hook-nestedvt
+If the nested virtualization is enabled in your kvm module
+this hook will expose it to the guests.
+
%package hook-numa
Summary: numa sopport for VDSM
BuildArch: noarch
@@ -853,6 +861,10 @@
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_isolatedprivatevlan
%config(noreplace) %{_sysconfdir}/libvirt/nwfilter/isolatedprivatevlan-vdsm.xml
+%files hook-nestedvt
+%defattr(-, root, root, -)
+%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_nestedvt
+
%files hook-numa
%defattr(-, root, root, -)
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_numa
diff --git a/vdsm_hooks/Makefile.am b/vdsm_hooks/Makefile.am
index e6a8280..4ef163a 100644
--- a/vdsm_hooks/Makefile.am
+++ b/vdsm_hooks/Makefile.am
@@ -31,6 +31,7 @@
hostusb \
hugepages \
isolatedprivatevlan \
+ nestedvt \
numa \
pincpu \
promisc \
diff --git a/vdsm_hooks/nestedvt/Makefile.am b/vdsm_hooks/nestedvt/Makefile.am
new file mode 100644
index 0000000..b480407
--- /dev/null
+++ b/vdsm_hooks/nestedvt/Makefile.am
@@ -0,0 +1,32 @@
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+include $(top_srcdir)/build-aux/Makefile.subs
+
+EXTRA_DIST = \
+ before_vm_start.py
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/before_vm_start
+ $(INSTALL_SCRIPT) $(srcdir)/before_vm_start.py \
+ $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_nestedvt
+
+uninstall-local:
+ $(RM) $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_nestedvt
diff --git a/vdsm_hooks/nestedvt/before_vm_start.py b/vdsm_hooks/nestedvt/before_vm_start.py
new file mode 100755
index 0000000..446a487
--- /dev/null
+++ b/vdsm_hooks/nestedvt/before_vm_start.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+import hooking
+
+cpu_nested_features = {
+ "kvm_intel": "vmx",
+ "kvm_amd": "svm",
+}
+
+for kvm_mod in ("kvm_intel", "kvm_amd"):
+ kvm_mod_path = "/sys/module/%s/parameters/nested" % kvm_mod
+ try:
+ with file(kvm_mod_path) as f:
+ if f.readline().strip() == "Y":
+ break
+ except IOError:
+ pass
+else:
+ kvm_mod = None
+
+if kvm_mod:
+ domxml = hooking.read_domxml()
+ feature_vmx = domxml.createElement("feature")
+ feature_vmx.setAttribute("name", cpu_nested_features[kvm_mod])
+ feature_vmx.setAttribute("policy", "require")
+ domxml.getElementsByTagName("cpu")[0].appendChild(feature_vmx)
+ hooking.write_domxml(domxml)
--
To view, visit http://gerrit.ovirt.org/9225
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08c24c1b932370577e9687d75e292cd7c40f8e5d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>