Change in vdsm[master]: (Schema) Have discoverSendTargets return parsed objects
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: (Schema) Have discoverSendTargets return parsed objects
......................................................................
(Schema) Have discoverSendTargets return parsed objects
Change-Id: Ib5b0bba668e3c2532805bef3aefa7cc9302285b0
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 30 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/7149/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index b103b28..581c5ff 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2517,22 +2517,45 @@
'data': {'address': 'NetworkAddress', '*user': 'str', '*password': 'str'}}
##
+# @IscsiQualifiedName:
+#
+# An iSCSI Qualified Name in RFC 3720 format.
+# eg. "iqn.1992-01.com.example:storage:diskarrays-sn-a8675309"
+#
+# Since: 4.10.0
+##
+{'alias': 'IscsiQualifiedName', 'data': 'str'}}
+
+#
+# @IscsiTarget:
+#
+# Describes an Iscsi Target.
+#
+# @portal: The portal which contains the target.
+#
+# @tpgt: The target portal group tag.
+#
+# @iqn: The iqn of the target.
+#
+# Since: 4.10.0
+##
+{'type': 'IscsiTarget',
+ 'data': {'portal': 'IscsiPortal',
+ 'tpgt': 'uint',
+ 'iqn': 'IscsiQualifiedName'}}
+
+#
# @ISCSIConnection.discoverSendTargets:
#
# Discover available targets for this @ISCSIConnection.
#
# Returns:
-# @targets: A list of discovered target iqns
-#
-# @fullTargets: A list of discovered targets in the form:
-# '<host>:<port>,<tpgt> <iqn>'
+# @targets: A list of discovered targets.
#
# Since: 4.10.0
-# XXX: The fullTargets strings should be broken out into their respective parts
-# XXX: The return values are in the same dictionary as the command status!
##
{'command': {'class': 'ISCSIConnection', 'name': 'discoverSendTargets'},
- 'returns': {'targets': ['str'], 'fullTargets': ['str']}}
+ 'returns': {'targets': ['IscsiTarget']}}
## Category: @Image ############################################################
##
--
To view, visit http://gerrit.ovirt.org/7149
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5b0bba668e3c2532805bef3aefa7cc9302285b0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years
Change in vdsm[master]: (Schema) Consolidate changeCD and changeFloppy to a single c...
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: (Schema) Consolidate changeCD and changeFloppy to a single call
......................................................................
(Schema) Consolidate changeCD and changeFloppy to a single call
Change-Id: I10332653af4cebd42bccffe178f84feac4ba5357
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/7150/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 581c5ff..9ee296b 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -3944,18 +3944,18 @@
'DriveSpecPayload', 'DriveSpecPath']}
##
-# @VM.changeCD:
+# @VM.changeMedia:
#
-# Change the CD in the VM's CD-ROM device.
+# Change the media in a drive.
#
-# @driveSpec: The specification of the new CD
+# @driveSpec: The specification of the new media
#
# Returns:
# @vmList: The VM definition, as updated
#
# Since: 4.10.0
##
-{'command': {'class': 'VM', 'name': 'changeCD'},
+{'command': {'class': 'VM', 'name': 'changeMedia'},
'data': {'driveSpec': 'DriveSpec'},
'returns': {'vmList': 'VmDefinition'}}
--
To view, visit http://gerrit.ovirt.org/7150
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I10332653af4cebd42bccffe178f84feac4ba5357
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years
Change in vdsm[master]: (Schema) Change vm.cont to vm.coninue
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: (Schema) Change vm.cont to vm.coninue
......................................................................
(Schema) Change vm.cont to vm.coninue
Change-Id: I302c86d638bc9e2f31b33014abebfc600a52d6ee
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/7151/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 9ee296b..44e444b 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -3976,13 +3976,13 @@
'returns': {'vmList': 'VmDefinition'}}
##
-# @VM.cont:
+# @VM.continue:
#
# Resume a paused VM.
#
# Since: 4.10.0
##
-{'command': {'class': 'VM', 'name': 'cont'}}
+{'command': {'class': 'VM', 'name': 'continue'}}
##
# @VM.create:
--
To view, visit http://gerrit.ovirt.org/7151
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I302c86d638bc9e2f31b33014abebfc600a52d6ee
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years
Change in vdsm[master]: (Schema) Remove deprecated network API functinos
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: (Schema) Remove deprecated network API functinos
......................................................................
(Schema) Remove deprecated network API functinos
Change-Id: Ic12b90643e4f657510128f58fa16da19df8c8aca
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 0 insertions(+), 66 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/6838/1
--
To view, visit http://gerrit.ovirt.org/6838
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic12b90643e4f657510128f58fa16da19df8c8aca
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years
Change in vdsm[master]: (Schema) Change BlockDevicePathInfo so that it needs one les...
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: (Schema) Change BlockDevicePathInfo so that it needs one less redundant enum
......................................................................
(Schema) Change BlockDevicePathInfo so that it needs one less redundant enum
Change-Id: I5ab262a1fbadf89aec0c649822a2a5879823521d
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 6 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/6843/1
--
To view, visit http://gerrit.ovirt.org/6843
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ab262a1fbadf89aec0c649822a2a5879823521d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years
Change in vdsm[master]: (Schema) Replace host\port combos with NetworkAdress
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: (Schema) Replace host\port combos with NetworkAdress
......................................................................
(Schema) Replace host\port combos with NetworkAdress
Change-Id: Iade8796a0168561ea0902ca512a817eb2f44aecb
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 21 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/6964/1
--
To view, visit http://gerrit.ovirt.org/6964
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iade8796a0168561ea0902ca512a817eb2f44aecb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years
Change in vdsm[master]: Extend Image.move to move and copy subchains
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: Extend Image.move to move and copy subchains
......................................................................
Extend Image.move to move and copy subchains
The method Image.move was only capable of moving and copying the entire
image chain. Now it's possible to specify an (optional) volUUID to move
or copy a subchain from the base up to volUUID.
Change-Id: Icb11818f830c6f02bcb74d69f1c119efaf100cc2
---
M vdsm/storage/image.py
M vdsm/storage/sp.py
2 files changed, 33 insertions(+), 22 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/3217/1
--
To view, visit http://gerrit.ovirt.org/3217
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb11818f830c6f02bcb74d69f1c119efaf100cc2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years
Change in vdsm[master]: Added a support for a guest hibernate command.
by ghammer@redhat.com
Gal Hammer has uploaded a new change for review.
Change subject: Added a support for a guest hibernate command.
......................................................................
Added a support for a guest hibernate command.
Change-Id: I1ad6836e61e9d91ec6f46a599541f61ff12e9737
---
M vdsm/clientIF.py
M vdsm/guestIF.py
M vdsm_cli/vdsClient.py
3 files changed, 32 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/1121/1
--
To view, visit http://gerrit.ovirt.org/1121
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ad6836e61e9d91ec6f46a599541f61ff12e9737
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Gal Hammer <ghammer(a)redhat.com>
9 years, 1 month
Change in vdsm[master]: [WIP] Start moving proc parsing to it's own module
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: [WIP] Start moving proc parsing to it's own module
......................................................................
[WIP] Start moving proc parsing to it's own module
Change-Id: I7ba84c7ece95bdef7448a7c7af277e7f58695401
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm.spec.in
M vdsm/API.py
M vdsm/Makefile.am
M vdsm/caps.py
A vdsm/procfs.py
M vdsm/utils.py
M vdsm/vm.py
7 files changed, 53 insertions(+), 40 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/7513/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index bd01c2a..1f01961 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -573,6 +573,7 @@
%{_datadir}/%{vdsm_name}/supervdsmServer.py*
%{_datadir}/%{vdsm_name}/vmChannels.py*
%{_datadir}/%{vdsm_name}/vmContainer.py*
+%{_datadir}/%{vdsm_name}/procfs.py*
%{_datadir}/%{vdsm_name}/tc.py*
%{_datadir}/%{vdsm_name}/vdsm
%{_datadir}/%{vdsm_name}/vdsm-restore-net-config
diff --git a/vdsm/API.py b/vdsm/API.py
index 720c3b9..aab69cd 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -37,6 +37,7 @@
from vdsm.define import doneCode, errCode, Kbytes, Mbytes
import caps
from vdsm.config import config
+import procfs
import supervdsm
@@ -864,7 +865,7 @@
"""
def _readSwapTotalFree():
- meminfo = utils.readMemInfo()
+ meminfo = procfs.meminfo()
return meminfo['SwapTotal'] / 1024, meminfo['SwapFree'] / 1024
stats = {}
@@ -1111,17 +1112,16 @@
memCommitted = self._memCommitted()
resident = 0
for v in self._cif.vmContainer.getVMs():
- if v.conf['pid'] == '0':
- continue
try:
- statmfile = file('/proc/' + v.conf['pid'] + '/statm')
- resident += int(statmfile.read().split()[1])
+ resident += v.statm().resident
except:
pass
+
resident *= PAGE_SIZE_BYTES
- meminfo = utils.readMemInfo()
- freeOrCached = (meminfo['MemFree'] +
- meminfo['Cached'] + meminfo['Buffers']) * Kbytes
+
+ meminfo = procfs.meminfo()
+ freeOrCached = (meminfo['MemFree'] + meminfo['Cached'] +
+ meminfo['Buffers']) * Kbytes
return freeOrCached + resident - memCommitted - \
config.getint('vars', 'host_mem_reserve') * Mbytes
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 574d762..1a3ac43 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -47,6 +47,7 @@
momIF.py \
neterrors.py \
parted_utils.py \
+ procfs.py \
pthread.py \
supervdsm.py \
supervdsmServer.py \
diff --git a/vdsm/caps.py b/vdsm/caps.py
index f1641ff..39fc837 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -41,6 +41,7 @@
from vdsm import utils
from vdsm import constants
import storage.hba
+import procfs
# For debian systems we can use python-apt if available
try:
@@ -271,7 +272,7 @@
caps['HBAInventory'] = storage.hba.HBAInventory()
caps['vmTypes'] = ['kvm']
- caps['memSize'] = str(utils.readMemInfo()['MemTotal'] / 1024)
+ caps['memSize'] = str(procfs.meminfo()['MemTotal'] / 1024)
caps['reservedMem'] = str(
config.getint('vars', 'host_mem_reserve') +
config.getint('vars', 'extra_mem_reserve'))
diff --git a/vdsm/procfs.py b/vdsm/procfs.py
new file mode 100644
index 0000000..29fc973
--- /dev/null
+++ b/vdsm/procfs.py
@@ -0,0 +1,31 @@
+from collections import namedtuple
+
+buffsize = 4096
+
+MemStat = namedtuple("MemStat",
+ "size, resident, share, text, UNUSED1, data, UNUSED2")
+
+
+def statm(pid):
+ """
+ Parses statm for a pid. Note all results are in pages.
+ """
+ with open("/proc/%d/statm" % pid, "rb") as f:
+ return MemStat(*(int(val) for val in f.read().split()))
+
+
+def meminfo():
+ """
+ Parse ``/proc/meminfo`` and return its content as a dictionary.
+
+ note.
+ All values are in KB
+ """
+ meminfo = {}
+ with open("/proc/meminfo", "rb") as f:
+ f.seek(0)
+ lines = f.readlines()
+ for var, val in (l.split()[0:2] for l in lines):
+ meminfo[var[:-1]] = int(val)
+
+ return meminfo
diff --git a/vdsm/utils.py b/vdsm/utils.py
index 5e2d4e5..048a528 100644
--- a/vdsm/utils.py
+++ b/vdsm/utils.py
@@ -19,7 +19,8 @@
#
"""
-A module containing miscellaneous functions and classes that are user plentifuly around vdsm.
+A module containing miscellaneous functions and classes that are user
+plentifuly around vdsm.
.. attribute:: utils.symbolerror
@@ -28,7 +29,8 @@
from SimpleXMLRPCServer import SimpleXMLRPCServer
import SocketServer
import threading
-import os, time
+import os
+import time
import logging
import errno
import subprocess
@@ -42,6 +44,7 @@
import constants
from config import config
import netinfo
+import procfs
_THP_STATE_PATH = '/sys/kernel/mm/transparent_hugepage/enabled'
if not os.path.exists(_THP_STATE_PATH):
@@ -63,34 +66,6 @@
os.unlink(fileToRemove)
except:
pass
-
-def readMemInfo():
- """
- Parse ``/proc/meminfo`` and return its content as a dictionary.
-
- For a reason unknown to me, ``/proc/meminfo`` is is sometime
- empty when opened. If that happens, the function retries to open it
- 3 times.
-
- :returns: a dictionary representation of ``/proc/meminfo``
- """
- # FIXME the root cause for these retries should be found and fixed
- tries = 3
- meminfo = {}
- while True:
- tries -= 1
- try:
- lines = []
- lines = file('/proc/meminfo').readlines()
- for line in lines:
- var, val = line.split()[0:2]
- meminfo[var[:-1]] = int(val)
- return meminfo
- except:
- logging.warning(lines, exc_info=True)
- if tries <= 0:
- raise
- time.sleep(0.1)
#Threaded version of SimpleXMLRPCServer
class SimpleThreadedXMLRPCServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer):
@@ -225,7 +200,7 @@
"""
BaseSample.__init__(self, pid, ifids)
self.totcpu = TotalCpuSample()
- meminfo = readMemInfo()
+ meminfo = procfs.meminfo()
freeOrCached = (meminfo['MemFree'] +
meminfo['Cached'] + meminfo['Buffers'])
self.memUsed = 100 - int(100.0 * (freeOrCached) / meminfo['MemTotal'])
diff --git a/vdsm/vm.py b/vdsm/vm.py
index c1a22b0..bd436e0 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -36,6 +36,7 @@
import libvirt
from vdsm import vdscli
import caps
+import procfs
DEFAULT_BRIDGE = config.get("vars", "default_bridge")
@@ -693,6 +694,9 @@
load = len(self.cif.vmContainer.getVMs())
return base * (doubler + load) / doubler
+ def statm(self):
+ return procfs.statm(int(self.conf['pid']))
+
def saveState(self):
if self.destroyed:
return
--
To view, visit http://gerrit.ovirt.org/7513
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ba84c7ece95bdef7448a7c7af277e7f58695401
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years, 1 month
Change in vdsm[master]: Remove unnecesary preparePaths.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Remove unnecesary preparePaths.
......................................................................
Remove unnecesary preparePaths.
Recovering running VM's therefore paths are already prepared.
Prepare paths is not locking the volumes anymore (Federico).
Change-Id: I35890d36227633ca147387d670c152b9be357e50
---
M vdsm/clientIF.py
1 file changed, 0 insertions(+), 16 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/786/1
--
To view, visit http://gerrit.ovirt.org/786
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I35890d36227633ca147387d670c152b9be357e50
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
9 years, 1 month