Change in vdsm[master]: DRAFT: v2v: Convert VM from external source to Data Domain

nsoffer at redhat.com nsoffer at redhat.com
Thu Feb 5 11:04:36 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: DRAFT: v2v: Convert VM from external source to Data Domain
......................................................................


Patch Set 37:

(3 comments)

http://gerrit.ovirt.org/#/c/34294/37/vdsm/v2v.py
File vdsm/v2v.py:

Line 140:         re_copy_disk = re.compile('.*(Copying disk \d+/\d+).*')
Line 141:         re_progress = re.compile('    \((\d+).*')
Line 142:         while proc.isalive():
Line 143:             line = proc.readline()
Line 144:             if 'Copying disk' in line:
> The line is filtering lines, once there is 'Copying disk' line we are looki
I'll check the new code.
Line 145:                 m = re_copy_disk.match(line)
Line 146:                 if m is not None:
Line 147:                     self._status = m.groups()[0]
Line 148:                     self._progress = 0


Line 153:                                                   "section: " + line)
Line 154:                 while True:
Line 155:                     buf = proc.read(1)
Line 156:                     while '\r' not in buf:
Line 157:                         buf += proc.read(1)
> I can't, this is progress which is writing to the same line, if I will wait
You can read a chunk (not a line), then separate the progress lines (terminated by \r).

You should use new infrastructure that Federico is adding for this:
http://gerrit.ovirt.org/#/c/33909/
Line 158:                     m = re_progress.match(buf)
Line 159:                     if m is not None:
Line 160:                         try:
Line 161:                             self._progress = int(m.groups()[0])


Line 172:             elif line == '':
Line 173:                 break
Line 174: 
Line 175:         if (proc.isalive()):
Line 176:             proc.wait()
> I cant use the utilsCmd since its not using shell PIPE
You can, see http://gerrit.ovirt.org/#/c/33909/
Line 177: 
Line 178:         logging.info('import vm ended, exit status %d',
Line 179:                      proc.exitstatus)
Line 180:         __jobs.remove(self)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I737f2c70fc6b8fec9ee5210cdb1d8274d3bd22aa
Gerrit-PatchSet: 37
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list