Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: Add man page for vdsm.conf
......................................................................
Add man page for vdsm.conf
Show to user the vdsm.conf options.
Change-Id: Id8e5a47d484fa06070d4566a39cab8a7a53ea717
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M debian/vdsm.install
M vdsm.spec.in
M vdsm/Makefile.am
A vdsm/vdsm.conf.5
4 files changed, 400 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/22891/1
diff --git a/debian/vdsm.install b/debian/vdsm.install
index ef46ed3..0c2b137 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -31,6 +31,7 @@
./usr/libexec/vdsm/unpersist-vdsm-hook
./usr/libexec/vdsm/vdsm-gencerts.sh
./usr/libexec/vdsm/vdsmd_init_common.sh
+./usr/share/man/man5/vdsm.conf.5
./usr/share/man/man8/vdsmd.8
./usr/share/vdsm/API.py
./usr/share/vdsm/BindingJsonRpc.py
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 385a29b..364997b 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1014,6 +1014,7 @@
%{python_sitelib}/sos/plugins/vdsm.py*
/lib/udev/rules.d/12-vdsm-lvm.rules
/etc/security/limits.d/99-vdsm.conf
+%{_mandir}/man5/vdsm.conf.5*
%{_mandir}/man8/vdsmd.8*
%if 0%{?rhel}
%dir %{_localstatedir}/log/core
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 3834f55..1c1671e 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -89,6 +89,9 @@
vdsm-restore-net-config \
$(NULL)
+dist_man5_MANS = \
+ vdsm.conf.5
+
nodist_man8_MANS = \
vdsmd.8
diff --git a/vdsm/vdsm.conf.5 b/vdsm/vdsm.conf.5
new file mode 100644
index 0000000..98b4ccd
--- /dev/null
+++ b/vdsm/vdsm.conf.5
@@ -0,0 +1,395 @@
+.\"Copyright 2010-2013 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.
+.\"
+.\"
+.\" File Name macro definition plagiarized from bash.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+.TH VDSM.CONF 5 "December 6, 2013" "" ""
+.SH NAME
+vdsm.conf \- The configuration file for Virtual Desktops and Servers Manager (VDSM)
+.br
+.SH SYNOPSIS
+.PP
+The
+vdsm\&.conf
+file is a configuration file for VDSM.
+vdsm\&.conf
+contains runtime configuration information for the VDSM\&.
+The complete description of the file format and possible parameters held within are here for reference
+purposes\&.
+.SH "FILE FORMAT"
+.PP
+The file consists of sections and parameters\&. A section begins with the name of the section in square brackets and
+continues until the next section begins\&. Sections contain parameters of the form:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+\fIname\fR = \fIvalue \fR
+.fi
+.if n \{\
+.RE
+.\}
+
+.SH CONFIGURATION BY SECTION (EXAMPLE)
+.PP
+.B [vars]
+
+\fBcore_dump_enable\fR = true
+.br
+Enable core dump
+
+\fBhost_mem_reserve\fR = 256
+.br
+Reserves memory for the host to prevent VMs from using all the physical pages. The values are in Mbytes.
+
+\fBguest_ram_overhead\fR = 65
+
+\fBextra_mem_reserve\fR = 65
+.br
+Memory reserved for non-vds-administered programs.
+
+\fBfake_nics\fR
+.br
+Comma-separated list of fnmatch-patterns for dummy hosts nics to be shown to vdsm.
+
+\fBnic_model\fR = rtl8139,pv
+.br
+NIC model is rtl8139, ne2k_pci pv or any other valid device recognized by kvm/qemu if a coma separated list
+given then a NIC per device will be created.
+
+\fBmigration_timeout\fR = 300
+.br
+Maximum time the destination waits for migration to end. Source waits twice aslong (to avoid races)
+
+\fBmigration_listener_timeout\fR = 30
+.br
+Time to wait (in seconds) for migration destination to start listening before migration begins.
+
+\fBmigration_max_bandwidth\fR = 32
+.br
+Maximum bandwidth for migration, in MiBps, 0 means libvirt's default, since 0.10.x default in libvirt is unlimited
+
+\fBmigration_monitor_intervang\fR = 10
+.br
+How often (in seconds) should the monitor thread pulse, 0 means the thread is disabled
+
+\fBhidden_nics\fR = wlan*,usb*
+.br
+Comma-separated list of fnmatch-patterns for host nics to be hidden from vdsm.
+
+\fBdefault_bridge\fR = engine
+.br
+Default bridge
+
+\fBmigration_downtime\fR = 500
+.br
+Maxmium allowed downtime for live migration in milliseconds (anything below 100ms is ignored) if you do not care about
+liveness of migration, set to a very high value, such as 600000.
+
+\fBmigration_downtime_steps\fR = 10
+.br
+Incremental steps used to reach migration_downtime
+
+\fBmax_outgoing_migrations\fR = 3
+.br
+Maximum concurrent outgoing migrations
+
+\fBsys_shutdown_timeout\fR = 10
+.br
+Destroy and shutdown timeouts (in sec) before completing the action.
+
+\fBuser_shutdown_timeout\fR = 30
+.br
+Grace period (seconds) to let guest user close his applications before shutdown.
+
+\fBguest_agent_timeout\fR = 30
+.br
+Time (in sec) to wait for guest agent.
+
+\fBvm_command_timeout\fR = 60
+.br
+Time to wait (in seconds) for vm to respond to a monitor command, 30 secs is a nice default. Set to 300 if the vm is expected to freeze during cluster failover.
+
+\fBvm_watermark_interval\fR = 2
+.br
+How often should we sample each vm for statistics (seconds).
+
+\fBvm_sample_cpu_interval\fR = 15
+.br
+Interval to collect sampe from CPU
+
+\fBvm_sample_cpu_window\fR = 2
+.br
+Interval to collect from CPU window
+
+\fBvm_sample_disk_interval\fR = 60
+.br
+Interval to collect sample from disk
+
+\fBvm_sample_disk_window\fR = 2
+.br
+Interval to collect disk window
+
+\fBvm_sample_disk_latency_interval\fR = 60
+.br
+Interval to collect disk latency
+
+\fBvm_sample_disk_latency_window\fR = 2
+.br
+Interval to collect disk latency window
+
+\fBvm_sample_net_interval\fR = 5
+.br
+Interval to collect sample from net
+
+\fBvm_sample_net_window\fR = 2
+.br
+Interval to collect sample from net window
+
+\fBtrust_store_path\fR = /etc/pki/vdsm
+.br
+Where the certificates and keys are situated
+
+\fBssl\fR = true
+.br
+Whether to use ssl encryption and authentication.
+
+\fBvds_responsiveness_timeout\fR = 60
+.br
+Responsiveness timeout
+
+\fBvdsm_nice\fR = -5
+.br
+Set vdsm scheduling priority
+
+\fBqemu_drive_cache\fR = none
+.br
+Qemu drive cache
+
+\fBfake_kvm_support\fR = false
+.br
+Emulate kvm support
+
+\fBxmlrpc_enable\fR = true
+.br
+Enable the xmlrpc server
+
+\fBjsonrpc_enable\fR = true
+.br
+Enable the JSON RPC server
+
+\fBreport_host_threads_as_cores\fR = false
+.br
+Count each cpu hyperthread as an individual core
+
+\fBlibvirt_env_variable_log_filters\fR
+.br
+Specify the log filters to track libvirt calls
+
+\fBlibvirt_env_variable_log_outputs\fR
+.br
+Specify the output to track libvirt calls
+
+.B [ksm]
+.br
+\fBksm_monitor_thread\fR = true
+.br
+KSM Monitor
+
+.br
+.B [mom]
+.br
+\fBconf\fR = /etc/vdsm/mom.conf
+.br
+Mom conf file
+.br
+
+.B [irs]
+.br
+\fBirs_enable\fR = true
+.br
+Enable IRS
+
+\fBrepository\fR = path to repository
+.br
+Image Repository
+
+\fBhsm_tasks\fR = (repository)/hsm
+.br
+hsm dir
+
+\fBimages\fR = images/
+.br
+images dir
+
+\fBirsd\fR = (images)/irsd
+.br
+irsd dir
+
+\fBimages_check_times\fR = 0
+.br
+Image repository check period (seconds).
+
+\fBvolume_utilization_percent\fR = 50
+.br
+Volume utilization percent
+
+\fBvolume_utilization_chunk_mb\fR = 1024
+.br
+Volume utilization chunk of mb
+
+\fBvol_size_sample_interval\fR = 60
+.br
+How often should the volume size be checked (seconds).
+
+\fBsd_validate_timeout\fR = 80
+.br
+Storage domain validate timeout, the maximum number of seconds to wait until all the domains will be validated.
+
+\fBscsi_rescan_minimal_timeout\fR = 2
+.br
+The minimum number of seconds to wait for scsi scan to return.
+
+\fBscsi_rescan_maximal_timeout\fR = 30
+.br
+The maximal number of seconds to wait for scsi scan to return.
+
+\fBsd_health_check_delay\fR = 10
+.br
+Storage domain health check delay, the amount of seconds to wait between two successive run of the domain health check.
+
+\fBnfs_mount_options\fR = soft,nosharecache
+.br
+NFS mount options, comma-separated list (NB: no white space allowed!)
+
+\fBpools_data_dir\fR = /var/run/vdsm/pools
+.br
+Pool data dir
+
+\fBvol_extend_policy\fR = ON
+.br
+Volume extend policy
+
+\fBlock_util_path\fR = /usr/libexec/vdsm
+.br
+Block util path
+
+\fBlock_cmd\fR = spmprotect.sh
+.br
+The lock command
+
+\fBfree_lock_cmd\fR = spmstop.sh
+.br
+The free lock command
+
+\fBthread_pool_size\fR = 10
+.br
+Thread pool size
+
+\fBmax_tasks\fR = 500
+.br
+Number max of tasks
+
+\fBlvm_dev_whitelist\fR
+.br
+LVM whitelist
+
+\fBmd_backup_versions\fR = 30
+.br
+Versions of backup
+
+\fBmd_backup_dir\fR = /var/log/vdsm/backup
+.br
+Backup dir
+
+\fBmaximum_allowed_pvs\fR = 8
+.br
+The number of PVs per VG has a hard-coded limit of 10.
+
+\fBrepo_stats_cache_refresh_timeout\fR = 300
+.br
+Repo stats cache refresh
+
+\fBtask_resource_default_timeout\fR = 120000
+.br
+Task resource default timeout
+
+\fBprepare_image_timeout\fR = 600000
+.br
+Prepare image timeout
+
+\fBgc_blocker_force_collect_interval\fR = 60
+.br
+Force collect interval
+
+\fBmaximum_domains_in_pool\fR = 100
+.br
+Process pool configuration.
+
+\fBprocess_pool_size\fR = 100
+.br
+Pool size
+
+\fBprocess_pool_timeout\fR = 60
+.br
+Pool timeout
+
+\fBprocess_pool_grace_period\fR = 2
+.br
+Pool grace period
+
+\fBprocess_pool_max_slots_per_domain\fR = 10
+.br
+Max slots per domain
+
+\fBiscsi_default_ifaces\fR = default
+.br
+Comma seperated ifaces to connect with. i.e. iser,default
+
+\fBuse_volume_leases\fR = false
+.br
+Whether to use the volume leases or not.
+
+.B [address]
+.br
+\fBmanagement_port\fR = 54321
+.br
+Port on which the vdsmd server listens to network clients
+
+\fBss_pool_timeoutjson_port\fR = 4044
+.br
+Port on which the vdsmd Json RPC server listens to network clients
+
+\fBmanagement_ip\fR
+.br
+IP address of management server
+
+\fBguests_gateway_ip\fR
+.br
+Guests gateway IP address
+
+.SH "SEE ALSO"
+.PP
+
+\fBvdsClient\fR(1),
+\fBvdsmd\fR(8)
+
+.SH AUTHOR
+VDSM was written by Ayal Baron, Barak Azulay, Cyril Plisko, Dan Kenigsberg,
+Doron Fediuck, Igor Lvovsky, Saggi Mizrahi, Shahar Frank, Simon Grinberg and
+others.
+
+.SH BUGS
+Report bugs to <http://bugzilla.redhat.com>
+
+.SH COPYRIGHT
+Copyright 2010-2013 Red Hat, Inc. License GPLv2: GNU GPL Version 2 <http://gnu.org/licenses/gpl.html>.
--
To view, visit http://gerrit.ovirt.org/22891
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8e5a47d484fa06070d4566a39cab8a7a53ea717
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: migration: exponential downtime increment
......................................................................
vm: migration: exponential downtime increment
Migration downtime is calculated using an interpolation
using the current downtime step (up to a configurabile
maximum) and the maximum downtime.
The downtime is incremented at each downtime step until
it reaches the maximum, or the migration is finished.
This patch changes the interpolation formula from linear
to exponential, being the new one:
d = c ** s
where d is the downtime, s is the step and c is the
exponentiation coefficient computed in such a way
of when s = S (number of steps to perform),
then we will have d = D (selected downtime).
Please note that this patch still preserve an linear
increment of the wait time.
Change-Id: I6401772f52ea28144452e67198bddff18f6703eb
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1004101
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/25820/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index c53f1d4..1d7b643 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -722,6 +722,7 @@
delay_per_gib = config.getint('vars', 'migration_downtime_delay')
memSize = int(vm.conf['memSize'])
self._wait = (delay_per_gib * max(memSize, 2048) + 1023) / 1024
+ self._coeff = self._downtime ** (1 / float(self.DOWNTIME_STEPS))
self.daemon = True
self.start()
@@ -735,7 +736,7 @@
if self._stop.isSet():
break
- downtime = self._downtime * (i + 1) / self.DOWNTIME_STEPS
+ downtime = int(self._coeff ** i)
self._vm.log.debug('setting migration downtime to %d', downtime)
self._vm._dom.migrateSetMaxDowntime(downtime, 0)
--
To view, visit http://gerrit.ovirt.org/25820
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6401772f52ea28144452e67198bddff18f6703eb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Vinzenz Feenstra has uploaded a new change for review.
Change subject: vdsm: Refactoring of retrieving device info from xml
......................................................................
vdsm: Refactoring of retrieving device info from xml
Reworked a bit the retrieval of device info from the libvirt domain xml.
Now VDSM won't parse the code in lastXmlDesc every time and the retrieval
of elements from the domain xml has been a bit abstracted.
Additionally the retrieval of an alias has been moved into a separate
function call to make the readability a bit better.
Change-Id: I7e106b2f2d3f4160d4e882f1a2880cb1b52fbb22
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 63 insertions(+), 76 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/17694/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index dc52909..e51050e 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1698,6 +1698,7 @@
self._guestSocketFile = self._makeChannelPath(_VMCHANNEL_DEVICE_NAME)
self._qemuguestSocketFile = self._makeChannelPath(_QEMU_GA_DEVICE_NAME)
self._lastXMLDesc = '<domain><uuid>%s</uuid></domain>' % self.id
+ self._lastParsedXmlDesc = _domParseStr(self._lastXMLDesc)
self._devXmlHash = '0'
self._released = False
self._releaseLock = threading.Lock()
@@ -2722,24 +2723,30 @@
self._guestCpuRunning = (self._dom.info()[0] ==
libvirt.VIR_DOMAIN_RUNNING)
+ def _getDevicesXml(self, parsedXml=None):
+ parsedXml = parsedXml or self._lastParsedXmlDesc
+ return parsedXml.childNodes[0].getElementsByTagName('devices')[0]
+
def _getUnderlyingVmDevicesInfo(self):
"""
Obtain underlying vm's devices info from libvirt.
"""
- self._getUnderlyingNetworkInterfaceInfo()
- self._getUnderlyingDriveInfo()
- self._getUnderlyingDisplayPort()
- self._getUnderlyingSoundDeviceInfo()
- self._getUnderlyingVideoDeviceInfo()
- self._getUnderlyingControllerDeviceInfo()
- self._getUnderlyingBalloonDeviceInfo()
- self._getUnderlyingWatchdogDeviceInfo()
- self._getUnderlyingSmartcardDeviceInfo()
- self._getUnderlyingConsoleDeviceInfo()
+ devicesXml = self._getDevicesXml(parsedXml=self._lastParsedXmlDesc)
+ self._getUnderlyingNetworkInterfaceInfo(devicesXml=devicesXml)
+ self._getUnderlyingDriveInfo(devicesXml=devicesXml)
+ self._getUnderlyingDisplayPort(xml=self._lastParsedXmlDesc)
+ self._getUnderlyingSoundDeviceInfo(devicesXml=devicesXml)
+ self._getUnderlyingVideoDeviceInfo(devicesXml=devicesXml)
+ self._getUnderlyingControllerDeviceInfo(devicesXml=devicesXml)
+ self._getUnderlyingBalloonDeviceInfo(devicesXml=devicesXml)
+ self._getUnderlyingWatchdogDeviceInfo(devicesXml=devicesXml)
+ self._getUnderlyingSmartcardDeviceInfo(devicesXml=devicesXml)
+ self._getUnderlyingConsoleDeviceInfo(devicesXml=devicesXml)
# Obtain info of all unknown devices. Must be last!
- self._getUnderlyingUnknownDeviceInfo()
+ self._getUnderlyingUnknownDeviceInfo(devicesXml=devicesXml)
+ self._updateAgentChannels(devicesXml=devicesXml)
- def _updateAgentChannels(self):
+ def _updateAgentChannels(self, devicesXml):
"""
We moved the naming of guest agent channel sockets. To keep backwards
compatability we need to make symlinks from the old channel sockets, to
@@ -2747,9 +2754,7 @@
This is necessary to prevent incoming migrations, restoring of VMs and
the upgrade of VDSM with running VMs to fail on this.
"""
- agentChannelXml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0]. \
- getElementsByTagName('channel')
+ agentChannelXml = devicesXml.getElementsByTagName('channel')
for channel in agentChannelXml:
try:
name = channel.getElementsByTagName('target')[0].\
@@ -2781,7 +2786,6 @@
self._getUnderlyingVmInfo()
self._getUnderlyingVmDevicesInfo()
- self._updateAgentChannels()
#Currently there is no protection agains mirroring a network twice,
for nic in self._devices[NIC_DEVICES]:
@@ -2937,9 +2941,8 @@
or revert to snapshot.
"""
parsedSrcDomXML = _domParseStr(srcDomXML)
-
- allDiskDeviceXmlElements = parsedSrcDomXML.childNodes[0]. \
- getElementsByTagName('devices')[0].getElementsByTagName('disk')
+ devicesXml = self._getDevicesXml(parsedXml=parsedSrcDomXML)
+ allDiskDeviceXmlElements = devicesXml.getElementsByTagName('disk')
snappableDiskDeviceXmlElements = \
_filterSnappableDiskDevices(allDiskDeviceXmlElements)
@@ -3008,7 +3011,8 @@
with self._confLock:
self.conf['devices'].append(nicParams)
self.saveState()
- self._getUnderlyingNetworkInterfaceInfo()
+ self._getUnderlyingNetworkInterfaceInfo(
+ devicesXml=self._getDevicesXml())
hooks.after_nic_hotplug(nicXml, self.conf,
params=customProps)
@@ -3264,7 +3268,7 @@
with self._confLock:
self.conf['devices'].append(diskParams)
self.saveState()
- self._getUnderlyingDriveInfo()
+ self._getUnderlyingDriveInfo(devicesXml=self._getDevicesXml())
hooks.after_disk_hotplug(driveXml, self.conf,
params=customProps)
@@ -4181,8 +4185,8 @@
def _getUnderlyingVmInfo(self):
self._lastXMLDesc = self._dom.XMLDesc(0)
- devxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0]
+ self._lastParsedXmlDesc = _domParseStr(self._lastXMLDesc)
+ devxml = self._getDevicesXml()
self._devXmlHash = str(hash(devxml.toxml()))
return self._lastXMLDesc
@@ -4331,6 +4335,9 @@
self.saveState()
return {'status': doneCode}
+ def _getUnderlyingDeviceAliasName(self, devXml):
+ return devXml.getElementsByTagName('alias')[0].getAttribute('name')
+
def _getUnderlyingDeviceAddress(self, devXml):
"""
Obtain device's address from libvirt
@@ -4347,7 +4354,7 @@
return address
- def _getUnderlyingUnknownDeviceInfo(self):
+ def _getUnderlyingUnknownDeviceInfo(self, devicesXml):
"""
Obtain unknown devices info from libvirt.
@@ -4360,16 +4367,13 @@
return True
return False
- devsxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0]
-
- for x in devsxml.childNodes:
+ for x in devicesXml.childNodes:
# Ignore empty nodes and devices without address
if (x.nodeName == '#text' or
not x.getElementsByTagName('address')):
continue
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
if not isKnownDevice(alias):
address = self._getUnderlyingDeviceAddress(x)
# I general case we assume that device has attribute 'type',
@@ -4381,18 +4385,16 @@
'address': address}
self.conf['devices'].append(newDev)
- def _getUnderlyingControllerDeviceInfo(self):
+ def _getUnderlyingControllerDeviceInfo(self, devicesXml):
"""
Obtain controller devices info from libvirt.
"""
- ctrlsxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0]. \
- getElementsByTagName('controller')
+ ctrlsxml = devicesXml.getElementsByTagName('controller')
for x in ctrlsxml:
# Ignore controller devices without address
if not x.getElementsByTagName('address'):
continue
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
device = x.getAttribute('type')
# Get model and index. Relevant for USB controllers.
model = x.getAttribute('model')
@@ -4428,20 +4430,18 @@
'address': address,
'alias': alias})
- def _getUnderlyingBalloonDeviceInfo(self):
+ def _getUnderlyingBalloonDeviceInfo(self, devicesXml):
"""
Obtain balloon device info from libvirt.
"""
- balloonxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0]. \
- getElementsByTagName('memballoon')
+ balloonxml = devicesXml.getElementsByTagName('memballoon')
for x in balloonxml:
# Ignore balloon devices without address.
if not x.getElementsByTagName('address'):
address = None
else:
address = self._getUnderlyingDeviceAddress(x)
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
for dev in self._devices[BALLOON_DEVICES]:
if address and not hasattr(dev, 'address'):
@@ -4456,16 +4456,14 @@
if not dev.get('alias'):
dev['alias'] = alias
- def _getUnderlyingConsoleDeviceInfo(self):
+ def _getUnderlyingConsoleDeviceInfo(self, devicesXml):
"""
Obtain the alias for the console device from libvirt
"""
- consolexml = _domParseStr(self._lastXMLDesc).childNodes[0].\
- getElementsByTagName('devices')[0].\
- getElementsByTagName('console')
+ consolexml = devicesXml.getElementsByTagName('console')
for x in consolexml:
# All we care about is the alias
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
for dev in self._devices[CONSOLE_DEVICES]:
if not hasattr(dev, 'alias'):
dev.alias = alias
@@ -4475,19 +4473,17 @@
not dev.get('alias'):
dev['alias'] = alias
- def _getUnderlyingSmartcardDeviceInfo(self):
+ def _getUnderlyingSmartcardDeviceInfo(self, devicesXml):
"""
Obtain smartcard device info from libvirt.
"""
- smartcardxml = _domParseStr(self._lastXMLDesc).childNodes[0].\
- getElementsByTagName('devices')[0].\
- getElementsByTagName('smartcard')
+ smartcardxml = devicesXml.getElementsByTagName('smartcard')
for x in smartcardxml:
if not x.getElementsByTagName('address'):
continue
address = self._getUnderlyingDeviceAddress(x)
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
for dev in self._devices[SMARTCARD_DEVICES]:
if not hasattr(dev, 'address'):
@@ -4500,19 +4496,17 @@
dev['address'] = address
dev['alias'] = alias
- def _getUnderlyingWatchdogDeviceInfo(self):
+ def _getUnderlyingWatchdogDeviceInfo(self, devicesXml):
"""
Obtain watchdog device info from libvirt.
"""
- watchdogxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0]. \
- getElementsByTagName('watchdog')
+ watchdogxml = devicesXml.getElementsByTagName('watchdog')
for x in watchdogxml:
# PCI watchdog has "address" different from ISA watchdog
if x.getElementsByTagName('address'):
address = self._getUnderlyingDeviceAddress(x)
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
for wd in self._devices[WATCHDOG_DEVICES]:
if not hasattr(wd, 'address') or not hasattr(wd, 'alias'):
@@ -4525,14 +4519,13 @@
dev['address'] = address
dev['alias'] = alias
- def _getUnderlyingVideoDeviceInfo(self):
+ def _getUnderlyingVideoDeviceInfo(self, devicesXml):
"""
Obtain video devices info from libvirt.
"""
- videosxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0].getElementsByTagName('video')
+ videosxml = devicesXml.getElementsByTagName('video')
for x in videosxml:
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
# Get video card address
address = self._getUnderlyingDeviceAddress(x)
@@ -4553,14 +4546,13 @@
dev['alias'] = alias
break
- def _getUnderlyingSoundDeviceInfo(self):
+ def _getUnderlyingSoundDeviceInfo(self, devicesXml):
"""
Obtain sound devices info from libvirt.
"""
- soundsxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0].getElementsByTagName('sound')
+ soundsxml = devicesXml.getElementsByTagName('sound')
for x in soundsxml:
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
# Get sound card address
address = self._getUnderlyingDeviceAddress(x)
@@ -4581,12 +4573,11 @@
dev['alias'] = alias
break
- def _getUnderlyingDriveInfo(self):
+ def _getUnderlyingDriveInfo(self, devicesXml):
"""
Obtain block devices info from libvirt.
"""
- disksxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0].getElementsByTagName('disk')
+ disksxml = devicesXml.getElementsByTagName('disk')
# FIXME! We need to gather as much info as possible from the libvirt.
# In the future we can return this real data to management instead of
# vm's conf
@@ -4600,7 +4591,7 @@
target = x.getElementsByTagName('target')
name = target[0].getAttribute('dev') if target else ''
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
readonly = bool(x.getElementsByTagName('readonly'))
boot = x.getElementsByTagName('boot')
bootOrder = boot[0].getAttribute('order') if boot else ''
@@ -4646,12 +4637,11 @@
diskDev['bootOrder'] = bootOrder
self.conf['devices'].append(diskDev)
- def _getUnderlyingDisplayPort(self):
+ def _getUnderlyingDisplayPort(self, xml):
"""
Obtain display port info from libvirt.
"""
- graphics = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('graphics')[0]
+ graphics = xml.childNodes[0].getElementsByTagName('graphics')[0]
port = graphics.getAttribute('port')
if port:
self.conf['displayPort'] = port
@@ -4659,18 +4649,16 @@
if port:
self.conf['displaySecurePort'] = port
- def _getUnderlyingNetworkInterfaceInfo(self):
+ def _getUnderlyingNetworkInterfaceInfo(self, devicesXml):
"""
Obtain network interface info from libvirt.
"""
# TODO use xpath instead of parseString (here and elsewhere)
- ifsxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
- getElementsByTagName('devices')[0]. \
- getElementsByTagName('interface')
+ ifsxml = devicesXml.getElementsByTagName('interface')
for x in ifsxml:
devType = x.getAttribute('type')
mac = x.getElementsByTagName('mac')[0].getAttribute('address')
- alias = x.getElementsByTagName('alias')[0].getAttribute('name')
+ alias = self._getUnderlyingDeviceAliasName(x)
if devType == 'hostdev':
name = alias
model = 'passthrough'
@@ -4802,8 +4790,7 @@
"during migration at destination host" %
devType)
- devices = _domParseStr(xml).childNodes[0]. \
- getElementsByTagName('devices')[0]
+ devices = self._getDevicesXml(parsedXml=_domParseStr(xml))
for deviceXML in devices.childNodes:
if deviceXML.nodeType != Node.ELEMENT_NODE:
--
To view, visit http://gerrit.ovirt.org/17694
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e106b2f2d3f4160d4e882f1a2880cb1b52fbb22
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Vered Volansky has uploaded a new change for review.
Change subject: testing storageTest.py as CI job.
......................................................................
testing storageTest.py as CI job.
Change-Id: I4d0caab1749e075f3650c91161b473e66b19977d
Signed-off-by: Vered Volansky <vvolansk(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/23343/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 0bab95d..0cb7164 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1,6 +1,7 @@
#
# Copyright 2009-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
--
To view, visit http://gerrit.ovirt.org/23343
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d0caab1749e075f3650c91161b473e66b19977d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vered Volansky <vvolansk(a)redhat.com>