Federico Simoncelli has uploaded a new change for review.

Change subject: vm: remove unused reqsize and needExtend
......................................................................

vm: remove unused reqsize and needExtend

Change-Id: I2387963eebb1b97be0d32396f14817ab7219732f
Signed-off-by: Federico Simoncelli <[email protected]>
---
M vdsm/libvirtvm.py
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
3 files changed, 5 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/8381/1

diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 64a3b6b..11667c5 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -124,7 +124,7 @@
                                               vmDrive.poolID,
                                               vmDrive.imageID,
                                               vmDrive.volumeID))
-                if volSize['status']['code'] == 0 and not vmDrive.needExtend:
+                if volSize['status']['code'] == 0:
                     vmDrive.truesize = int(volSize['truesize'])
                     vmDrive.apparentsize = int(volSize['apparentsize'])
 
@@ -1010,7 +1010,6 @@
             self.serial = kwargs.get('imageID'[-20:]) or ''
         LibvirtVmDevice.__init__(self, conf, log, **kwargs)
         # Keep sizes as int
-        self.reqsize = int(kwargs.get('reqsize', '0'))
         self.truesize = int(kwargs.get('truesize', '0'))
         self.apparentsize = int(kwargs.get('apparentsize', '0'))
         self.name = self._makeName()
diff --git a/vdsm/vm.py b/vdsm/vm.py
index d49eef1..0da46d7 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -347,8 +347,6 @@
         return str(idx)
 
     def _normalizeVdsmImg(self, drv):
-        drv['needExtend'] = False
-        drv['reqsize'] = drv.get('reqsize', '0')
         if not drv.has_key('device'):
             drv['device'] = 'disk'
 
@@ -739,9 +737,7 @@
             # TODO cap newsize by max volume size
             volDict = {'poolID': d.poolID, 'domainID': d.domainID,
                        'imageID': d.imageID, 'volumeID': d.volumeID,
-                       'name': d.name}
-            d.needExtend = True
-            d.reqsize = newsize
+                       'name': d.name, 'newSize': newsize}
             # sendExtendMsg expects size in bytes
             self.cif.irs.sendExtendMsg(d.poolID, volDict, newsize * 2**20,
                                            self._afterLvExtend)
@@ -751,12 +747,6 @@
 
             volID = d.volumeID
             break
-
-        # store most recently requested size in conf, to be re-requested on
-        # migration destination
-        for dev in self.conf['devices']:
-            if dev['type'] == DISK_DEVICES and dev.get('volumeID') == volID:
-                    dev['reqsize'] = str(newsize)
 
     def _refreshLV(self, domainID, poolID, imageID, volumeID):
         """ Stop vm before refreshing LV. """
@@ -789,9 +779,8 @@
             apparentsize = int(res['apparentsize'])
             truesize = int(res['truesize'])
             self.log.debug('_afterLvExtend apparentsize %s req size %s',
-                            apparentsize / constants.MEGAB, d.reqsize) # MiB
-            if apparentsize >= d.reqsize * constants.MEGAB: #in Bytes
-                d.needExtend = False
+                    apparentsize / constants.MEGAB, drive['newSize']) # MiB
+            if apparentsize >= drive['newSize'] * constants.MEGAB: #in Bytes
                 try:
                     self.cont()
                 except libvirt.libvirtError:
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 10d2aaa..fba0339 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -1877,12 +1877,7 @@
 #
 # @name:             A user-friendly device name for display only
 #
-# @needExtend:       Indicates whether an underlying block device needs to be
-#                    expanded to accomodate growing disk allocation
-#
 # @optional:         States if the VM may start if the disk is not present
-#
-# @reqsize:          The most recently requested drive size (in bytes)
 #
 # @shared:           Indicates if this disk is intended to be shared by
 #                    multiple virtual machines
@@ -1905,8 +1900,7 @@
           'address': 'VmDeviceAddress', 'alias': 'str',
           'deviceId': 'UUID', '*specParams': 'VmDiskDeviceSpecParams',
           'apparentsize': 'uint', 'index': 'int', 'name': 'str',
-          'needExtend': 'bool', 'optional': 'bool',
-          'reqsize': 'uint', 'shared': 'bool', 'truesize': 'uint',
+          'optional': 'bool', 'shared': 'bool', 'truesize': 'uint',
           'volumeChain': ['VmDiskDeviceVolumeChainEntry'],
           '*baseVolumeID': 'UUID'}}
 


--
To view, visit http://gerrit.ovirt.org/8381
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2387963eebb1b97be0d32396f14817ab7219732f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to