Change in vdsm[master]: v2v: support for block devices

2016-09-27 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: support for block devices
..


Patch Set 4: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/64272
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5f7a85715764efded7b296e858b130a05fe10f2a
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: v2v: support for block devices

2016-09-27 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: support for block devices
..


Patch Set 2:

(2 comments)

https://gerrit.ovirt.org/#/c/64272/2/tests/v2vTests.py
File tests/v2vTests.py:

PS2, Line 130: file
> is this correct for the test you added?
yes,
the source can be file or dev for block.


Line 534:ProtectedPassword('password'),
Line 535:None)['vmList']
Line 536: 
Line 537: self.assertEqual(len(vms), len(VM_SPECS))
Line 538: self.assertTrue('mapper' in vms[0]['disks'][0]['alias'])
> This is a bit clearer, IMO:
Done
Line 539: 
Line 540: def testXenBlockDevice(self):
Line 541: def _connect(uri, username, passwd):
Line 542: self._vms[0].setDiskType('block')


-- 
To view, visit https://gerrit.ovirt.org/64272
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5f7a85715764efded7b296e858b130a05fe10f2a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: v2v: support for block devices

2016-09-22 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: support for block devices
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/64272
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5f7a85715764efded7b296e858b130a05fe10f2a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: v2v: support for block devices

2016-09-22 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: support for block devices
..

v2v: support for block devices

extended support for block devices for KVM and VMWare.
currently we do support block devices that exported as file in libvirt:

  
  ...

Added support for type block:

  
  ...

Bug-Url: https://bugzilla.redhat.com/1378340
Change-Id: I5f7a85715764efded7b296e858b130a05fe10f2a
Signed-off-by: Shahar Havivi 
---
M lib/vdsm/v2v.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/72/64272/1

diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index 4752477..ceb2b2b 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -1066,6 +1066,7 @@
 def _add_disks(root, params):
 params['disks'] = []
 disks = root.findall('.//disk[@type="file"]')
+disks = disks + root.findall('.//disk[@type="block"]')
 for disk in disks:
 d = {}
 device = disk.get('device')
@@ -1077,6 +1078,11 @@
 source = disk.find('./source/[@file]')
 if source is not None:
 d['alias'] = source.get('file')
+else:
+source = disk.find('./source/[@dev]')
+if source is not None:
+d['alias'] = source.get('dev')
+
 driver = disk.find('./driver/[@type]')
 if driver is not None:
 try:


-- 
To view, visit https://gerrit.ovirt.org/64272
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f7a85715764efded7b296e858b130a05fe10f2a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: v2v: add test for Xen block device

2016-09-18 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add test for Xen block device
..


Patch Set 4: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/63022
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1afc7d21857e59ebf69856e99e15cc3796149e4e
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: v2v: add test for Xen block device

2016-09-18 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add test for Xen block device
..


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/63022/3/tests/v2vTests.py
File tests/v2vTests.py:

Line 533: vms = v2v.get_external_vms(self.xen_url, 'user',
Line 534:ProtectedPassword('password'),
Line 535:None)['vmList']
Line 536: 
Line 537: self.assertEqual(len(vms), len(VM_SPECS) - 1)
> please check that the missing VM is the one you set the disk type as block.
Done
Line 538: 
Line 539: @MonkeyPatch(v2v, '_VIRT_V2V', FAKE_VIRT_V2V)
Line 540: @MonkeyPatch(v2v, '_LOG_DIR', None)
Line 541: def testSuccessfulImportOVA(self):


-- 
To view, visit https://gerrit.ovirt.org/63022
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1afc7d21857e59ebf69856e99e15cc3796149e4e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: v2v: Support for ova exported from AWS

2016-09-15 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Support for ova exported from AWS
..


Patch Set 3:

> (1 comment)

no, it works without extension as well:
print os.path.splitext(os.path.basename("/a/b/c"))[0]

-- 
To view, visit https://gerrit.ovirt.org/63517
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6215491cb724c2131d440b00e767a5690070a7b
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Support for ova exported from AWS

2016-09-15 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Support for ova exported from AWS
..


Patch Set 3: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/63517
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6215491cb724c2131d440b00e767a5690070a7b
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Support for ova exported from AWS

2016-09-15 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Support for ova exported from AWS
..


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/63517/2/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 1187: vmName = node.find('./ovf:VirtualSystem/ovf:Name', ns)
Line 1188: if vmName is not None:
Line 1189: vm['vmName'] = vmName.text
Line 1190: else:
Line 1191: vm['vmName'] = 'default'
> perhaps the id? vm-id?
we don't have an id...
we can use the ova file name as a name...
Line 1192: 
Line 1193: memSize = node.find('.//ovf:Item[rasd:ResourceType="%d"]/'
Line 1194: 'rasd:VirtualQuantity' % 
_OVF_RESOURCE_MEMORY, ns)
Line 1195: if memSize is not None:


-- 
To view, visit https://gerrit.ovirt.org/63517
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6215491cb724c2131d440b00e767a5690070a7b
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Support for ova exported from AWS

2016-09-08 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Support for ova exported from AWS
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/63517/1//COMMIT_MSG
Commit Message:

Line 8: 
Line 9: When exporting VM from AWS as VMWare OVA file it doesn't export 
Line 10: tag for the VM.
Line 11: The Name is not Mandatory for the ovf format - using default as a name
Line 12: AWS the name tag is not mandatory - using default as a name.
> This line seems superfluous or the wording of the sentence is confusing.
right it is
Line 13: 
Line 14: The Name is not relevant from the engine point of view since the user
Line 15: can change it while importing the OVA.
Line 16: 


-- 
To view, visit https://gerrit.ovirt.org/63517
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6215491cb724c2131d440b00e767a5690070a7b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Support for ova exported from AWS

2016-09-08 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Support for ova exported from AWS
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/63517
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6215491cb724c2131d440b00e767a5690070a7b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Support for ova exported from AWS

2016-09-08 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: Support for ova exported from AWS
..

v2v: Support for ova exported from AWS

When exporting VM from AWS as VMWare OVA file it doesn't export 
tag for the VM.
The Name is not Mandatory for the ovf format - using default as a name
AWS the name tag is not mandatory - using default as a name.

The Name is not relevant from the engine point of view since the user
can change it while importing the OVA.

Change-Id: Id6215491cb724c2131d440b00e767a5690070a7b
Bug-Url: https://bugzilla.redhat.com/1371843
Signed-off-by: Shahar Havivi 
---
M lib/vdsm/v2v.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/63517/1

diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index 4c052da..b6453fc 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -1188,7 +1188,7 @@
 if vmName is not None:
 vm['vmName'] = vmName.text
 else:
-raise V2VError('Error parsing ovf information: no ovf:Name')
+vm['vmName'] = 'default'
 
 memSize = node.find('.//ovf:Item[rasd:ResourceType="%d"]/'
 'rasd:VirtualQuantity' % _OVF_RESOURCE_MEMORY, ns)


-- 
To view, visit https://gerrit.ovirt.org/63517
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6215491cb724c2131d440b00e767a5690070a7b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[ovirt-4.0]: v2v: filter out Xen VMs with block storage

2016-09-01 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: filter out Xen VMs with block storage
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/63133
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[ovirt-4.0]: v2v: filter out Xen VMs with block storage

2016-09-01 Thread shavivi
Hello Francesco Romani, Tomas Golembiovsky,

I'd like you to do a code review.  Please visit

https://gerrit.ovirt.org/63133

to review the following change.

Change subject: v2v: filter out Xen VMs with block storage
..

v2v: filter out Xen VMs with block storage

virt-v2v is not support importing Xen VMs with block storage domain.
No need to return these VMs via get_external_vms verb

Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Bug-Url: https://bugzilla.redhat.com/1365411
Signed-off-by: Shahar Havivi 
Reviewed-on: https://gerrit.ovirt.org/62368
Reviewed-by: Tomas Golembiovsky 
Tested-by: Shahar Havivi 
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani 
---
M lib/vdsm/v2v.py
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/63133/1

diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index 62ccd3c..057704d 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -861,6 +861,8 @@
 except ET.ParseError as e:
 logging.error('error parsing domain xml: %s', e)
 return
+if not _block_disk_supported(conn, root):
+return
 try:
 _add_general_info(root, params)
 except InvalidVMConfiguration as e:
@@ -876,6 +878,16 @@
 vms.append(params)
 
 
+def _block_disk_supported(conn, root):
+'''
+Currently we do not support importing VMs with block device from
+Xen on Rhel 5.x
+'''
+if conn.getType() == 'Xen':
+return len(root.findall('.//disk[@type="block"]')) == 0
+return True
+
+
 def _add_vm_info(vm, params):
 params['vmName'] = vm.name()
 # TODO: use new API: vm.state()[0] == libvirt.VIR_DOMAIN_SHUTOFF


-- 
To view, visit https://gerrit.ovirt.org/63133
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Tomas Golembiovsky 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: add test for Xen block device

2016-08-31 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add test for Xen block device
..


Patch Set 2: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/63022
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1afc7d21857e59ebf69856e99e15cc3796149e4e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: filter out Xen VMs with block storage

2016-08-30 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: filter out Xen VMs with block storage
..


Patch Set 3:

> OK, I'll bump to +2 as soon as the new patch is posted!

sent at
https://gerrit.ovirt.org/#/c/63022

-- 
To view, visit https://gerrit.ovirt.org/62368
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: add test for Xen block device

2016-08-30 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add test for Xen block device
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/63022
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1afc7d21857e59ebf69856e99e15cc3796149e4e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: add test for Xen block device

2016-08-30 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: add test for Xen block device
..

v2v: add test for Xen block device

Change-Id: I1afc7d21857e59ebf69856e99e15cc3796149e4e
Signed-off-by: Shahar Havivi 
---
M tests/v2vTests.py
1 file changed, 28 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/63022/1

diff --git a/tests/v2vTests.py b/tests/v2vTests.py
index 013a56a..7c1d5a9 100644
--- a/tests/v2vTests.py
+++ b/tests/v2vTests.py
@@ -84,6 +84,7 @@
 self._id = id
 self._active = active
 self._has_snapshots = has_snapshots
+self._disk_type = 'file'
 
 def name(self):
 return self._name
@@ -106,6 +107,9 @@
 def isActive(self):
 return self._active
 
+def setDiskType(self, disk_type):
+self._disk_type = disk_type
+
 def XMLDesc(self, flags=0):
 return """
 
@@ -122,7 +126,7 @@
 restart
 destroy
 
-
+
 
 
 
@@ -140,6 +144,7 @@
 """.format(
 name=self._name,
 uuid=self._uuid,
+disk_type=self._disk_type,
 mac=self._mac_address)
 
 def hasCurrentSnapshot(self):
@@ -151,12 +156,16 @@
 
 def __init__(self, vms):
 self._vms = vms
+self._type = 'ESX'
 
 def close(self):
 pass
 
+def setType(self, type_name):
+self._type = type_name
+
 def getType(self):
-return "ESX"
+return self._type
 
 def listAllDomains(self):
 return [vm for vm in self._vms]
@@ -512,6 +521,23 @@
 def testSuccessfulXenImport(self):
 self._commonConvertExternalVM(self.xen_url)
 
+def testXenBlockDevice(self):
+def _connect(uri, username, passwd):
+self._vms[0].setDiskType('block')
+conn = MockVirConnect(vms=self._vms)
+conn.setType('Xen')
+return conn
+
+with MonkeyPatchScope([(libvirtconnection, 'open_connection',
+_connect)]):
+vms = v2v.get_external_vms(self.xen_url, 'user',
+   ProtectedPassword('password'),
+   None)['vmList']
+
+self._vms[0].setDiskType('block')
+print '\n>>> %r\n' % self._vms[0]
+self.assertEqual(len(vms), len(VM_SPECS) - 1)
+
 @MonkeyPatch(v2v, '_VIRT_V2V', FAKE_VIRT_V2V)
 @MonkeyPatch(v2v, '_LOG_DIR', None)
 def testSuccessfulImportOVA(self):


-- 
To view, visit https://gerrit.ovirt.org/63022
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1afc7d21857e59ebf69856e99e15cc3796149e4e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: filter out Xen VMs with block storage

2016-08-30 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: filter out Xen VMs with block storage
..


Patch Set 2:

> thanks, looks nice. Is this covered by tests?
 > If not, any plan to make it so?
Yep,
I will send a new patch that will handle the disk type that is missing (file 
and block)

-- 
To view, visit https://gerrit.ovirt.org/62368
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[ovirt-4.0]: v2v: Running virt-v2v with some sane environment

2016-08-29 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Running virt-v2v with some sane environment
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/62919
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae6455c3189b7fbbf0d9d3ad5369a06b3cd6017e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[ovirt-3.6]: v2v: Running virt-v2v with some sane environment

2016-08-29 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Running virt-v2v with some sane environment
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/62920
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae6455c3189b7fbbf0d9d3ad5369a06b3cd6017e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: filter out Xen VMs with block storage

2016-08-28 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: filter out Xen VMs with block storage
..


Patch Set 2: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/62368
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: filter out Xen VMs with block storage

2016-08-25 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: filter out Xen VMs with block storage
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/62368/1/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 901: '''
Line 902: Currently we do not support importing VMs with block device from
Line 903: Xen on Rhel 5.x
Line 904: '''
Line 905: if conn.getURI().startswith(_XEN_SSH_PROTOCOL):
> elsewhere below we are using
Done
Line 906: return len(root.findall('.//disk[@type="block"]')) == 0
Line 907: return True
Line 908: 
Line 909: 


-- 
To view, visit https://gerrit.ovirt.org/62368
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Running virt-v2v with some sane environment

2016-08-24 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Running virt-v2v with some sane environment
..


Patch Set 3: Code-Review+1

(1 comment)

https://gerrit.ovirt.org/#/c/62765/3/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

PS3, Line 467: env['LIBGUESTFS_BACKEND'] = 'direct'
wasn't it always mandatory?


-- 
To view, visit https://gerrit.ovirt.org/62765
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae6455c3189b7fbbf0d9d3ad5369a06b3cd6017e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: filter out Xen VMs with block storage

2016-08-24 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: filter out Xen VMs with block storage
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/62368/1//COMMIT_MSG
Commit Message:

Line 6: 
Line 7: v2v: filter out Xen VMs with block storage
Line 8: 
Line 9: virt-v2v is not support importing Xen VMs with block storage domain.
Line 10: No need to return these VMs via get_external_vms verb
> Shouldn't we rather behave like with snapsnots and running VMs and leave th
There is no filter in the engine for snapshots... (there is an RFE but solution 
not dissected yet).
In this case its limited that will never be solved (block for Xen on Rhel 5.x) 
so I think filtering in vdsm is ok.
Line 11: 
Line 12: Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Line 13: Bug-Url: https://bugzilla.redhat.com/1365411


-- 
To view, visit https://gerrit.ovirt.org/62368
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Add PipelineProc, pipeline wrapper object

2016-08-24 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Add PipelineProc, pipeline wrapper object
..


Patch Set 4: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/62094
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0c3741ae7ef9731a2cd9d587e86766b9e6e64f62
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Add helper that redirects stdin/out/err

2016-08-23 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Add helper that redirects stdin/out/err
..


Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/62092
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6c748155e233ebfb2c0c223308693ccaab0ebc18
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Add PipelineProc, pipeline wrapper object

2016-08-23 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Add PipelineProc, pipeline wrapper object
..


Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/62094
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0c3741ae7ef9731a2cd9d587e86766b9e6e64f62
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: filter out Xen VMs with block storage

2016-08-16 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: filter out Xen VMs with block storage
..

v2v: filter out Xen VMs with block storage

virt-v2v is not support importing Xen VMs with block storage domain.
No need to return these VMs via get_external_vms verb

Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Bug-Url: https://bugzilla.redhat.com/1365411
Signed-off-by: Shahar Havivi 
---
M lib/vdsm/v2v.py
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/62368/1

diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index c6a9943..0d9882f 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -880,6 +880,8 @@
 except ET.ParseError as e:
 logging.error('error parsing domain xml: %s', e)
 return
+if not _block_disk_supported(conn, root):
+return
 try:
 _add_general_info(root, params)
 except InvalidVMConfiguration as e:
@@ -895,6 +897,16 @@
 vms.append(params)
 
 
+def _block_disk_supported(conn, root):
+'''
+Currently we do not support importing VMs with block device from
+Xen on Rhel 5.x
+'''
+if conn.getURI().startswith(_XEN_SSH_PROTOCOL):
+return len(root.findall('.//disk[@type="block"]')) == 0
+return True
+
+
 def _add_vm_info(vm, params):
 params['vmName'] = vm.name()
 # TODO: use new API: vm.state()[0] == libvirt.VIR_DOMAIN_SHUTOFF


-- 
To view, visit https://gerrit.ovirt.org/62368
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: filter out Xen VMs with block storage

2016-08-16 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: filter out Xen VMs with block storage
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/62368
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I84512f54f9949640a568a444dd7eeb78db852134
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Add execCmd() that accepts stdin/out/err

2016-08-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Add execCmd() that accepts stdin/out/err
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/62092
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6c748155e233ebfb2c0c223308693ccaab0ebc18
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Bump version requirement on python-cpopen.

2016-08-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Bump version requirement on python-cpopen.
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/62093
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I540180130a80f5c3c19007e10851b7713db596f9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Log detailed output of virt-v2v

2016-07-03 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Log detailed output of virt-v2v
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/59834/1/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 383: self._vmid = vmid
Line 384: self._irs = irs
Line 385: self._prepared_volumes = []
Line 386: self._passwd_file = os.path.join(_V2V_DIR, "%s.tmp" % vmid)
Line 387: self._base_command = [_VIRT_V2V.cmd, '-v', '-x']
> Tomas, good point. The import process is sporadic enough that we can afford
yes,
I am convinced too,
if its not cost too much it worth it!,
I am seeing some mailing list with questions that with that log it will make 
easier investigation.
Line 388: 
Line 389: def execute(self):
Line 390: raise NotImplementedError("Subclass must implement this")
Line 391: 


-- 
To view, visit https://gerrit.ovirt.org/59834
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a8d9284316a551edeaffdd66dfcd299fa02478e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Log detailed output of virt-v2v

2016-06-28 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Log detailed output of virt-v2v
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/59834/1/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 785: yield ImportProgress(int(current_disk), 
int(disk_count),
Line 786:  description)
Line 787: for chunk in self._iter_progress(stream):
Line 788: progress = self._parse_progress(chunk)
Line 789: if progress is not None:
> unrelated?
Maybe its verbose flag related?
Tomas can this cause problems in the progress?
Line 790: yield DiskProgress(progress)
Line 791: if progress == 100:
Line 792: break
Line 793: 


-- 
To view, visit https://gerrit.ovirt.org/59834
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a8d9284316a551edeaffdd66dfcd299fa02478e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: v2v: Log detailed output of virt-v2v

2016-06-28 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Log detailed output of virt-v2v
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/59834/1/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 383: self._vmid = vmid
Line 384: self._irs = irs
Line 385: self._prepared_volumes = []
Line 386: self._passwd_file = os.path.join(_V2V_DIR, "%s.tmp" % vmid)
Line 387: self._base_command = [_VIRT_V2V.cmd, '-v', '-x']
I don't think we always need to use -v -x,
maybe a parameter or on debug...
Line 388: 
Line 389: def execute(self):
Line 390: raise NotImplementedError("Subclass must implement this")
Line 391: 


-- 
To view, visit https://gerrit.ovirt.org/59834
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a8d9284316a551edeaffdd66dfcd299fa02478e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org


Change in vdsm[master]: cdrom: API change: require interface & index

2016-05-17 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: cdrom: API change: require interface & index
..


Patch Set 7: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/56805
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I178c1a02bbad962f9dc9b67bed7691cf170ee896
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik 
Gerrit-Reviewer: Arik Hadas 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Piotr Kliczewski 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: Lazy loading of external VMs info

2016-05-16 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Lazy loading of external VMs info
..


Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/57418
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3dc6fc4573b2c0b1c03ed87025452e14af2fc566
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Tomas Jelinek 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: remove ovirt_image_common soft dependency

2016-05-16 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: remove ovirt_image_common soft dependency
..


Patch Set 1: Verified+1

Push it only when ovirt_image_common dependency is in vdsm.spec.in

-- 
To view, visit https://gerrit.ovirt.org/57497
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifb2679a007197524091b241e17fbec234c1f66bc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: remove ovirt_image_common soft dependency

2016-05-16 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: remove ovirt_image_common soft dependency
..

v2v: remove ovirt_image_common soft dependency

Now that ovirt_image_common is a dependency for vdsm no need to check if
its installed.

Change-Id: Ifb2679a007197524091b241e17fbec234c1f66bc
Signed-off-by: Shahar Havivi 
---
M lib/vdsm/v2v.py
1 file changed, 0 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/97/57497/1

diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index a4a4f17..c2fbe94 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -47,11 +47,6 @@
 from vdsm.infra import zombiereaper
 from vdsm.utils import traceback, CommandPath, NICENESS, IOCLASS
 
-try:
-import ovirt_image_common
-except ImportError:
-ovirt_image_common = None
-
 
 _lock = threading.Lock()
 _jobs = {}
@@ -165,9 +160,6 @@
 elif uri.startswith(_VMWARE_PROTOCOL):
 command = LibvirtCommand(uri, username, password, vminfo, job_id, irs)
 elif uri.startswith(_KVM_PROTOCOL):
-if ovirt_image_common is None:
-raise V2VError('Unsupported protocol KVM, ovirt_image_common'
-   'package is needed for importing KVM images')
 command = KVMCommand(uri, username, password, vminfo, job_id, irs)
 else:
 raise ClientError('Unknown protocol for Libvirt uri: %s', uri)


-- 
To view, visit https://gerrit.ovirt.org/57497
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb2679a007197524091b241e17fbec234c1f66bc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: schema: Marked optional fields in ExternalVmInfo.

2016-05-15 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: schema: Marked optional fields in ExternalVmInfo.
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/57417
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8e2e7f81ba39be2616f732de1deff477a1ca6c65
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Tomas Jelinek 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: Lazy loading of external VMs info

2016-05-15 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Lazy loading of external VMs info
..


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/57418/1/lib/api/vdsm-api.yml
File lib/api/vdsm-api.yml:

Line 7095: type: string
Line 7096: 
Line 7097: -   defaultvalue: False
Line 7098: description: Request only names, not complete info about 
hosts
Line 7099: name: names_only
> This is a misnomer actually, because we are returning also VM state and not
maybe basic_info...
Line 7100: added: '4.0'
Line 7101: type: boolean
Line 7102: 
Line 7103: -   defaultvalue: null


https://gerrit.ovirt.org/#/c/57418/1/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 166: _add_vm(conn, vms, vm)
Line 167: else:
Line 168: vms.append({'vmName': vm.name(),
Line 169: 'status': 'Up' if vm.ID() > -1 else 
'Down'})
Line 170: 
maybe _add_vm can handle the "names_only"...
Please use the _add_vm_info() method to add the name and status - so we have 
consistency in case of a change
Line 171: return {'status': doneCode, 'vmList': vms}
Line 172: 
Line 173: 
Line 174: def convert_external_vm(uri, username, password, vminfo, job_id, irs):


-- 
To view, visit https://gerrit.ovirt.org/57418
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3dc6fc4573b2c0b1c03ed87025452e14af2fc566
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Tomas Jelinek 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-10 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 6: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Piotr Kliczewski 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: Detect VM with snapshots

2016-05-10 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Detect VM with snapshots
..


Patch Set 10: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/56574
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9aa4de2faff92625cd0de8e3ae2a10a2d58aa823
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Piotr Kliczewski 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-10 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 5: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-10 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 4: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-10 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/57247/3/lib/api/vdsmapi-schema.json
File lib/api/vdsmapi-schema.json:

Line 4021: # @allocation:  #optional disk allocation type (sparse, 
preallocated)
Line 4022: #
Line 4023: # @virtio_iso_path: #optional path for iso contains virtio guest 
drivers
Line 4024: #
Line 4025: # @graphics:#optional graphics supported byt libvirt
> please update lib/api/vdsm-api.yml accordingly, at the moment we ship both.
Done
Line 4026: #   such as: spice, vnc
Line 4027: #   (new in version 4.18.0)
Line 4028: #
Line 4029: # @video:   #optional video supported byt libvirt such as: 
qxl, vga


-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-10 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms return format for KVM images
..


Patch Set 8:

(1 comment)

https://gerrit.ovirt.org/#/c/56912/8/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 946: d['alias'] = source.get('file')
Line 947: driver = disk.find('./driver/[@type]')
Line 948: if driver is not None:
Line 949: try:
Line 950: d["format"] = _convert_disk_format(driver.get('type'))
> What about the schema? we need to document this key and its type.
Schema does have a format.
This is the same structure that we use to import the VM which have the format 
in the schema (not the video and the graphics due)
Line 951: except KeyError:
Line 952: logging.warning("Disk %s has unsupported format: %r", 
d,
Line 953: format)
Line 954: params['disks'].append(d)


-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms return format for KVM images
..


Patch Set 8: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms return format for KVM images
..


Patch Set 7: Verified-1

-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 3: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/57247/2/lib/api/vdsmapi-schema.json
File lib/api/vdsmapi-schema.json:

Line 4019: # @format:  #optional converted disk format (raw, cow etc)
Line 4020: #
Line 4021: # @allocation:  #optional disk allocation type (sparse, 
preallocated)
Line 4022: #
Line 4023: # @virtio_iso_path: #optional path for iso contains virtio guest 
drivers
> better:
Done
Line 4024: #
Line 4025: # Since: 4.17.0
Line 4026: ##
Line 4027: {'type': 'ExternalVmInfo',


-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms return format for KVM images
..


Patch Set 6: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 2: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/57247/1/vdsm/storage/volume.py
File vdsm/storage/volume.py:

Line 96: COW_FORMAT: qemuimg.FORMAT.QCOW2,
Line 97: RAW_FORMAT: qemuimg.FORMAT.RAW,
Line 98: }
Line 99: 
Line 100: STR2FMT = {v: k for k, v in FMT2STR.items()}
> this belongs in the storage patch, not here
right...
Line 101: 
Line 102: # At the moment this is static and it has been introduced to group 
all the
Line 103: # previous implicit references to the block size in FileVolume. In 
the future
Line 104: # it will depend on the storage domain.


-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms return format for KVM images
..


Patch Set 5: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional video info for kvm ...

2016-05-09 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: get_external_vms returns additional video info for kvm 
images
..

v2v: get_external_vms returns additional video info for kvm images

When importing kvm images we don't have the generate ovf from
virt-v2v since we use our kvm2ovirt tool.
engine needs additional video and graphics information.

Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Signed-off-by: Shahar Havivi 
---
M lib/api/vdsmapi-schema.json
M lib/vdsm/v2v.py
M vdsm/storage/volume.py
3 files changed, 22 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/57247/1

diff --git a/lib/api/vdsmapi-schema.json b/lib/api/vdsmapi-schema.json
index 1da8cc0..9a4a5dc 100644
--- a/lib/api/vdsmapi-schema.json
+++ b/lib/api/vdsmapi-schema.json
@@ -4028,7 +4028,8 @@
  'data': {'vmName': 'str', 'status': 'VmStatus', 'vmId': 'UUID', 'smp': 'uint',
   'memSize': 'uint', '*disks': ['ExternalDiskInfo'],
   '*networks': ['ExternalNetworkInfo'], '*format': 'VolumeFormat',
-  '*allocation': 'VolumeAllocation', '*virtio_iso_path': 'str'}}
+  '*allocation': 'VolumeAllocation', '*virtio_iso_path': 'str',
+  '*graphics': 'str', '*video': 'str'}}
 
 ##
 # @Host.getExternalVMs:
diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index fbc07df..c8431ed 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -864,6 +864,8 @@
 return
 _add_networks(root, params)
 _add_disks(root, params)
+_add_graphics(root, params)
+_add_video(root, params)
 for disk in params['disks']:
 _add_disk_info(conn, disk)
 vms.append(params)
@@ -935,6 +937,18 @@
 params['disks'].append(d)
 
 
+def _add_graphics(root, params):
+e = root.find('./devices/graphics/[@type]')
+if e is not None:
+params['graphics'] = e.get('type')
+
+
+def _add_video(root, params):
+e = root.find('./devices/video/model/[@type]')
+if e is not None:
+params['video'] = e.get('type')
+
+
 def _add_networks(root, params):
 params['networks'] = []
 interfaces = root.findall('.//interface')
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index b2847da..5eead1f 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -97,6 +97,8 @@
 RAW_FORMAT: qemuimg.FORMAT.RAW,
 }
 
+STR2FMT = {v: k for k, v in FMT2STR.items()}
+
 # At the moment this is static and it has been introduced to group all the
 # previous implicit references to the block size in FileVolume. In the future
 # it will depend on the storage domain.
@@ -146,6 +148,10 @@
 return FMT2STR[format]
 
 
+def str2fmt(format):
+return STR2FMT[format]
+
+
 def type2name(volType):
 try:
 return VOLUME_TYPES[volType]


-- 
To view, visit https://gerrit.ovirt.org/57247
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49d8af456e959fa877b9f8cda8ae1f5d75c32b1e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional info for kvm images

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional info for kvm images
..


Patch Set 4:

(2 comments)

https://gerrit.ovirt.org/#/c/56912/4/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

PS4, Line 868: _add_graphics
> you could split this part from the storage one. This part looks ready and c
Done


PS4, Line 953: e = root.find('./devices/video/model/[@type]')
 : if e is not None:
 : params['video'] = e.get('type')
> in case you split this patch in virt and storage, please make two functions
Done


-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: Detect VM with snapshots

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Detect VM with snapshots
..


Patch Set 8: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/56574
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9aa4de2faff92625cd0de8e3ae2a10a2d58aa823
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: add support for importing kvm based vms from libvirt

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add support for importing kvm based vms from libvirt
..


Patch Set 6:

rebasing...

-- 
To view, visit https://gerrit.ovirt.org/56459
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0ddbab700f2e0c54d53ed02ec61477b92c9c7960
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional info for kvm images

2016-05-09 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional info for kvm images
..


Patch Set 4:

rebasing...

-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: add support for importing kvm based vms from libvirt

2016-05-05 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add support for importing kvm based vms from libvirt
..


Patch Set 5: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/56459
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0ddbab700f2e0c54d53ed02ec61477b92c9c7960
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvm2ovirt: tool for copying images from libvirt

2016-05-05 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvm2ovirt: tool for copying images from libvirt
..


Patch Set 8: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/55797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional info for kvm images

2016-05-05 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional info for kvm images
..


Patch Set 3: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms returns additional info for kvm images

2016-05-05 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms returns additional info for kvm images
..


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/56912/3/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 938: if driver is not None:
Line 939: try:
Line 940: format = driver.get('type')
Line 941: fid = volume.str2fmt(format)
Line 942: d["format"] = volume.VOLUME_TYPES[fid]
the new str2fmt() return the index
is using VOLUME_TYPES is the right way to get the string?
Line 943: except KeyError:
Line 944: logging.warning("Disk %s has unsupported format: %r", 
d,
Line 945: format)
Line 946: params['disks'].append(d)


-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-05 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms return format for KVM images
..


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/56912/2/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 935: driver = disk.find('./driver/[@type]')
Line 936: if driver is not None:
Line 937: format = driver.get('type')
Line 938: if format.lower().startswith('qcow'):
Line 939: d['format'] = 'cow'
> You must use vdsm public constants - there is no way that vdsm will publish
sure,
I did add str2fmt...
Will send it in the next patch
Line 940: params['disks'].append(d)
Line 941: 
Line 942: 
Line 943: def _add_networks(root, params):


-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-05 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms return format for KVM images
..


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/56912/2/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 935: driver = disk.find('./driver/[@type]')
Line 936: if driver is not None:
Line 937: format = driver.get('type')
Line 938: if format.lower().startswith('qcow'):
Line 939: d['format'] = 'cow'
> Also, this must be documented in the schema, we cannot return undocumented 
I wanted to return cow since the engine enum will be easy conversion (raw is 
the default) - if we use the str2fmt there will needed additional engine work 
so its better to return the value as Is.
I will update the schema, btw the next patch will present two more values that 
the engine is needed and I will verify all the patches
Line 940: params['disks'].append(d)
Line 941: 
Line 942: 
Line 943: def _add_networks(root, params):


-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Daniel Erez 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tal Nisan 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: Detect VM with snapshots

2016-05-04 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Detect VM with snapshots
..


Patch Set 6: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/56574
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9aa4de2faff92625cd0de8e3ae2a10a2d58aa823
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-04 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: get_external_vms return format for KVM images
..


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/56912/2/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 935: driver = disk.find('./driver/[@type]')
Line 936: if driver is not None:
Line 937: format = driver.get('type')
Line 938: if format.lower().startswith('qcow'):
Line 939: d['format'] = 'cow'
> Few issues here:
ok,
We do want to return cow, raw or Unassigned values since engine works with this 
formats or we need another conversion in the engine as well...
Line 940: params['disks'].append(d)
Line 941: 
Line 942: 
Line 943: def _add_networks(root, params):


-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: Detect VM with snapshots

2016-05-04 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Detect VM with snapshots
..


Patch Set 5: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/56574
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9aa4de2faff92625cd0de8e3ae2a10a2d58aa823
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: get_external_vms return format for KVM images

2016-05-02 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: get_external_vms return format for KVM images
..

v2v: get_external_vms return format for KVM images

Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Signed-off-by: Shahar Havivi 
---
M lib/vdsm/v2v.py
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/56912/1

diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index fbc07df..e52af39 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -932,6 +932,11 @@
 source = disk.find('./source/[@file]')
 if source is not None:
 d['alias'] = source.get('file')
+driver = disk.find('./driver/[@type]')
+if driver is not None:
+format = driver.get('type')
+if format.lower().startswith('qcow'):
+d['format'] = 'cow'
 params['disks'].append(d)
 
 


-- 
To view, visit https://gerrit.ovirt.org/56912
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d4985aafc21e5ff5c11ec7bca71ab9aa5b2cd9d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvm2ovirt: tool for copying images from libvirt

2016-05-02 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvm2ovirt: tool for copying images from libvirt
..


Patch Set 6:

(17 comments)

https://gerrit.ovirt.org/#/c/55797/5/helpers/kvm2ovirt
File helpers/kvm2ovirt:

Line 108: with progress(op):
Line 109: op.run()
Line 110: finally:
Line 111: stream.finish()
Line 112: 
> If you don't cache exceptions in stream.finish, and both stream.finish and 
Done
Line 113: 
Line 114: def get_password(options):
Line 115: ret = ''
Line 116: if options.password_file:


https://gerrit.ovirt.org/#/c/55797/6/helpers/kvm2ovirt
File helpers/kvm2ovirt:

Line 51: parser.add_argument('--source', dest='source', nargs='+', 
required=True,
Line 52: help='Source remote volumes path')
Line 53: parser.add_argument('--dest', dest='dest', nargs='+', 
required=True,
Line 54: help='Destination local volumes path')
Line 55: parser.add_argument('--bufsize', dest='bufsize', default=1048576,
> add type=int
Done
Line 56: help='Size of packets in bytes, default 
1048676')
Line 57: parser.add_argument('--verbose', action='store_true',
Line 58: help='verbose output')
Line 59: return parser.parse_args(sys.argv)


Line 72: sys.stdout.write('(%d/100%%)\r' % progress)
Line 73: sys.stdout.flush()
Line 74: 
Line 75: 
Line 76: def volume_progress(op, done):
> Add estimated_size argument
did it, its looks like the wrong patch
Line 77: while op.done < op.size:
Line 78: progress = op.done * 100 // op.size
Line 79: write_progress(progress)
Line 80: if done.wait(1):


Line 73: sys.stdout.flush()
Line 74: 
Line 75: 
Line 76: def volume_progress(op, done):
Line 77: while op.done < op.size:
> op.size is None, we cannot use it, pass the estimated size as argument.
Done
Line 78: progress = op.done * 100 // op.size
Line 79: write_progress(progress)
Line 80: if done.wait(1):
Line 81: break


Line 74: 
Line 75: 
Line 76: def volume_progress(op, done):
Line 77: while op.done < op.size:
Line 78: progress = op.done * 100 // op.size
> progress = min(99, op.done * 100 // estimated_size)
Done
Line 79: write_progress(progress)
Line 80: if done.wait(1):
Line 81: break
Line 82: write_progress(100)


Line 82: write_progress(100)
Line 83: 
Line 84: 
Line 85: @contextmanager
Line 86: def progress(op):
> Add estimated_size argument, pass it to volume_progress thread
Done
Line 87: done = threading.Event()
Line 88: th = concurrent.thread(volume_progress, args=(op, done))
Line 89: th.start()
Line 90: try:


Line 93: done.set()
Line 94: th.join()
Line 95: 
Line 96: 
Line 97: def download_volume(con, vol, dest, diskno, disks, bufsize, verbose):
> remove diskno, disks, verbose.
Done
Line 98: write_output('Copying disk %d/%d to %s' % (diskno, disks, dest))
Line 99: if verbose:
Line 100: write_output('>>> disk %d, capacity: %d allocation %d' %
Line 101:  (diskno, vol.info()[1], vol.info()[2]))


Line 97: def download_volume(con, vol, dest, diskno, disks, bufsize, verbose):
Line 98: write_output('Copying disk %d/%d to %s' % (diskno, disks, dest))
Line 99: if verbose:
Line 100: write_output('>>> disk %d, capacity: %d allocation %d' %
Line 101:  (diskno, vol.info()[1], vol.info()[2]))
> Move both to main loop
Done
Line 102: 
Line 103: stream = con.newStream()
Line 104: try:
Line 105: vol.download(stream, 0, 0, 0)


Line 107: op = directio.Receive(dest, sr, buffersize=bufsize)
Line 108: with progress(op):
Line 109: op.run()
Line 110: finally:
Line 111: stream.finish()
> If op.run raises, and stream.finish raises, the error from stream finish wi
Done
Line 112: 
Line 113: 
Line 114: def get_password(options):
Line 115: ret = ''


Line 111: stream.finish()
Line 112: 
Line 113: 
Line 114: def get_password(options):
Line 115: ret = ''
> A better way would be:
Done
Line 116: if options.password_file:
Line 117: if options.verbose:
Line 118: write_output('>>> Reading password from file %s' %
Line 119:  options.password_file)


Line 116: if options.password_file:
Line 117: if options.verbose:
Line 118: write_output('>>> Reading password from file %s' %
Line 119:  options.password_file)
Line 120: with open(options.password_file, 'r') as fd:
> fd is a bad name file object, this is the common name for a file descriptor
Done
Line 121: ret = fd.read()
Line 122: return ret
Line 123: 
Line 124: def main():


Line 121: ret = fd.read()
Line 122: return ret
Line 123: 
Line 124: def main():

Change in vdsm[master]: v2v: add support for importing kvm based vms from libvirt

2016-05-02 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add support for importing kvm based vms from libvirt
..


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/56459/2/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 158: if uri.startswith(_XEN_SSH_PROTOCOL):
Line 159: command = XenCommand(uri, vminfo, job_id, irs)
Line 160: elif uri.startswith(_VMWARE_PROTOCOL):
Line 161: command = LibvirtCommand(uri, username, password, vminfo, 
job_id, irs)
Line 162: elif uri.startswith(_KVM_PROTOCOL):
> Fail here is ovir_image_common is None with UnsupportedError
Right,
Ignore my previous comment
Line 163: command = KVMCommand(uri, username, password, vminfo, job_id, 
irs)
Line 164: else:
Line 165: raise ClientError('Unknown protocol for Libvirt uri: %s', uri)
Line 166: job = ImportVm(job_id, command)


-- 
To view, visit https://gerrit.ovirt.org/56459
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0ddbab700f2e0c54d53ed02ec61477b92c9c7960
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: add support for importing kvm based vms from libvirt

2016-05-02 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add support for importing kvm based vms from libvirt
..


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/56459/2/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 46
Line 47
Line 48
Line 49
Line 50
> You can add soft dependency like this:
you mean that this will be in the kvm2ovirt script right?
and shouldn't we exit with an error?


-- 
To view, visit https://gerrit.ovirt.org/56459
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0ddbab700f2e0c54d53ed02ec61477b92c9c7960
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvm2ovirt: tool for copying images from libvirt

2016-05-01 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvm2ovirt: tool for copying images from libvirt
..


Patch Set 5:

(5 comments)

https://gerrit.ovirt.org/#/c/55797/5/configure.ac
File configure.ac:

Line 376: AC_OUTPUT([
Line 377:   Makefile
Line 378:   client/Makefile
Line 379:   contrib/Makefile
Line 380: helpers/Makefile
> missing tab
Done
Line 381:   init/Makefile
Line 382:   init/systemd/Makefile
Line 383:   lib/Makefile
Line 384:   lib/vdsm/Makefile


https://gerrit.ovirt.org/#/c/55797/5/helpers/kvm2ovirt
File helpers/kvm2ovirt:

Line 73: sys.stdout.flush()
Line 74: 
Line 75: 
Line 76: def volume_progress(op, done):
Line 77: while op.done < op.size:
> op.size may be None, causing the progress thread to crash (see vdms log for
Done
Line 78: progress = op.done * 100 // op.size
Line 79: write_progress(progress)
Line 80: if done.wait(1):
Line 81: break


Line 108: with progress(op):
Line 109: op.run()
Line 110: finally:
Line 111: try:
Line 112: # TODO: remove that after libvirt answer???
> Actually we need the try block so we don't hide the real error raise before
we need the first try but not the one around the finish
Line 113: stream.finish()
Line 114: except Exception as ex:
Line 115: write_error(str(ex))
Line 116: 


PS5, Line 129: options = parse_arguments()
 : 
 : con = libvirtconnection.open_connection(options.uri,
 : options.username,
 : get_password())
 : 
 : diskno = 1
 : disksitems = len(options.source)
 : bufsize = int(options.bufsize)
 : write_output('preparing for copy')
 : for item in itertools.izip(options.source, options.dest):
 : vol = con.storageVolLookupByPath(item[0])
 : download_volume(vol, item[1], diskno, disksitems, bufsize, 
options.verbose)
 : diskno = diskno + 1
 : write_output('Finishing off')
> please wrap this in a main() function, like I commented few versions ago.
Done


Line 140: vol = con.storageVolLookupByPath(item[0])
Line 141: download_volume(vol, item[1], diskno, disksitems, bufsize, 
options.verbose)
Line 142: diskno = diskno + 1
Line 143: write_output('Finishing off')
Line 144
> call the new main() function using this idiom
Done


-- 
To view, visit https://gerrit.ovirt.org/55797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: small test improvement

2016-05-01 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: small test improvement
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/56694
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I89c46efc9836fe0f0ef680084f1921ef3948055f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: Detect VM with snapshots

2016-05-01 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: Detect VM with snapshots
..


Patch Set 4:

we need to make sure that Libvirt API this is working on rhel 5.x which 
importing Libvirt Xen to vdsm

-- 
To view, visit https://gerrit.ovirt.org/56574
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9aa4de2faff92625cd0de8e3ae2a10a2d58aa823
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Golembiovsky 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Tomas Golembiovsky 
Gerrit-Reviewer: Vinzenz Feenstra 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvm2ovirt: tool for copying images from libvirt

2016-04-27 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvm2ovirt: tool for copying images from libvirt
..


Patch Set 5:

(1 comment)

https://gerrit.ovirt.org/#/c/55797/5/helpers/kvm2ovirt
File helpers/kvm2ovirt:

Line 73: sys.stdout.flush()
Line 74: 
Line 75: 
Line 76: def volume_progress(op, done):
Line 77: while op.done < op.size:
> op.size may be None, causing the progress thread to crash (see vdms log for
you mean min()
max() returns 99/100 immediately...
Line 78: progress = op.done * 100 // op.size
Line 79: write_progress(progress)
Line 80: if done.wait(1):
Line 81: break


-- 
To view, visit https://gerrit.ovirt.org/55797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: add support for importing kvm based vms from libvirt

2016-04-26 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: add support for importing kvm based vms from libvirt
..


Patch Set 1:

(4 comments)

https://gerrit.ovirt.org/#/c/56459/1/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 345
Line 346
Line 347
Line 348
Line 349
> Please remove this blank line.
Done


Line 157: if uri.startswith(_XEN_SSH_PROTOCOL):
Line 158: command = XenCommand(uri, vminfo, job_id, irs)
Line 159: elif uri.startswith(_VMWARE_PROTOCOL):
Line 160: command = LibvirtCommand(uri, username, password, vminfo, 
job_id, irs)
Line 161: else:
> Please add constant for _KVM_PROTOCOL and do not assume that this is the on
Done
Line 162: command = KVMCommand(uri, username, password, vminfo, job_id, 
irs)
Line 163: job = ImportVm(job_id, command)
Line 164: job.start()
Line 165: _add_job(job_id, job)


Line 158: command = XenCommand(uri, vminfo, job_id, irs)
Line 159: elif uri.startswith(_VMWARE_PROTOCOL):
Line 160: command = LibvirtCommand(uri, username, password, vminfo, 
job_id, irs)
Line 161: else:
Line 162: command = KVMCommand(uri, username, password, vminfo, job_id, 
irs)
> We can use this command only if we have the ovirt-image-common package inst
we need to put the ovirt_image_common for 4.0
Line 163: job = ImportVm(job_id, command)
Line 164: job.start()
Line 165: _add_job(job_id, job)
Line 166: return {'status': doneCode}


Line 572: 
Line 573: @contextmanager
Line 574: def execute(self):
Line 575: with self._volumes(), self._password_file():
Line 576: yield self._start_virt_v2v()
> _start_virt_v2v is not correct now, since it may run kvm2ovirt or virt-v2v.
Done
Line 577: 
Line 578: def _source_images(self):
Line 579: con = libvirtconnection.open_connection(uri=self._uri,
Line 580: 
username=self._username,


-- 
To view, visit https://gerrit.ovirt.org/56459
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0ddbab700f2e0c54d53ed02ec61477b92c9c7960
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvm2ovirt: tool for copying images from libvirt

2016-04-25 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvm2ovirt: tool for copying images from libvirt
..


Patch Set 3:

When canceling the script e.g. ctrl+c we are hang in infinite loop,
I think its related to the contectmanager, I did try that without the event and 
we still hang.

-- 
To view, visit https://gerrit.ovirt.org/55797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvm@ovirt: tool for streaming images from libvirt

2016-04-25 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvm@ovirt: tool for streaming images from libvirt
..


Patch Set 2:

(24 comments)

https://gerrit.ovirt.org/#/c/55797/2//COMMIT_MSG
Commit Message:

Line 3: AuthorDate: 2016-04-06 16:13:50 +0300
Line 4: Commit: Shahar Havivi 
Line 5: CommitDate: 2016-04-20 10:19:35 +0300
Line 6: 
Line 7: kvm@ovirt: tool for streaming images from libvirt
> kvm2ovirt
already fixed look at the title
Line 8: 
Line 9: v2v is needs to a streaming/download tool for importing kvm based
Line 10: images from Libvirt to vdsm.
Line 11: for other such as xen and vmware virt-v2v provide the solution.


Line 6: 
Line 7: kvm@ovirt: tool for streaming images from libvirt
Line 8: 
Line 9: v2v is needs to a streaming/download tool for importing kvm based
Line 10: images from Libvirt to vdsm.
> This sentence needs rewrite.
Done
Line 11: for other such as xen and vmware virt-v2v provide the solution.
Line 12: this tool mimic virt-v2v output in order to use it smoothly in v2v.py
Line 13: module.
Line 14: 


https://gerrit.ovirt.org/#/c/55797/2/configure.ac
File configure.ac:

Line 377:   Makefile
Line 378:   client/Makefile
Line 379:   contrib/Makefile
Line 380:   debian/Makefile
Line 381: helpers/Makefile
> missing tab
Done
Line 382:   init/Makefile
Line 383:   init/systemd/Makefile
Line 384:   lib/Makefile
Line 385:   lib/vdsm/Makefile


https://gerrit.ovirt.org/#/c/55797/2/helpers/Makefile.am
File helpers/Makefile.am:

PS2, Line 1: 2008
> wrong copyright year
Done


Line 12:kvm2ovirt \
Line 13:$(NULL)
Line 14: 
Line 15: all-local: \
Line 16:$(nodist_vdsm_SCRIPTS) \
> probably unneeded, yes
Done


https://gerrit.ovirt.org/#/c/55797/2/helpers/kvm2ovirt
File helpers/kvm2ovirt:

Line 19: #
Line 20: 
Line 21: import sys
Line 22: import time
Line 23: 
> Unneeded blank line
Done
Line 24: import argparse
Line 25: import itertools
Line 26: 
Line 27: from vdsm import libvirtconnection


Line 21: import sys
Line 22: import time
Line 23: 
Line 24: import argparse
Line 25: import itertools
> Please sort the imports
Done
Line 26: 
Line 27: from vdsm import libvirtconnection
Line 28: from vdsm import concurrent
Line 29: from vdsm import utils


Line 25: import itertools
Line 26: 
Line 27: from vdsm import libvirtconnection
Line 28: from vdsm import concurrent
Line 29: from vdsm import utils
> Sort
Done
Line 30: 
Line 31: # TODO: change when directio lib is ready
Line 32: from ovirt_image_daemon import directio
Line 33: 


Line 28: from vdsm import concurrent
Line 29: from vdsm import utils
Line 30: 
Line 31: # TODO: change when directio lib is ready
Line 32: from ovirt_image_daemon import directio
> This is now in ovirt_image_common
Done
Line 33: 
Line 34: 
Line 35: start = utils.monotonic_time()
Line 36: 


Line 36: 
Line 37: 
Line 38: # TODO: write tests first
Line 39: # mock libvirtstream that gets ['aa', 'b'] and return each string
Line 40: # in the recv
> Not needed now, directio handles this.
Done
Line 41: class StreamAdapter():
Line 42: def __init__(self, stream):
Line 43: self.read = stream.recv
Line 44: 


Line 37: 
Line 38: # TODO: write tests first
Line 39: # mock libvirtstream that gets ['aa', 'b'] and return each string
Line 40: # in the recv
Line 41: class StreamAdapter():
> Always inherit from object
Done
Line 42: def __init__(self, stream):
Line 43: self.read = stream.recv
Line 44: 
Line 45: 


Line 55: parser.add_argument('--source', dest='source', nargs='+', 
required=True,
Line 56: help='Source remote volumes path')
Line 57: parser.add_argument('--dest', dest='dest', nargs='+', 
required=True,
Line 58: help='Destination local volumes path')
Line 59: parser.add_argument('--packet-size', dest='pksize', 
default=1048576,
> packet-size is not a good name, use --buffer-size and bufffer_size or if yo
Done
Line 60: help='Size of packets in bytes')
Line 61: parser.add_argument('--verbose', action='store_true',
Line 62: help='verbose output')
Line 63: return parser.parse_args(sys.argv)


Line 56: help='Source remote volumes path')
Line 57: parser.add_argument('--dest', dest='dest', nargs='+', 
required=True,
Line 58: help='Destination local volumes path')
Line 59: parser.add_argument('--packet-size', dest='pksize', 
default=1048576,
Line 60: help='Size of packets in bytes')
> Show the default in the help message (default 1048676)
Done
Line 61: parser.add_argument('--verbose', action='store_true',
Line 62: help='verbose output')
Line 63: return parser.parse_args(sys.argv)
Line 64: 


Line 73: sys.stdout.flush()
Line 74: 
Line 75: 
Line 76: def init_progress():
Line 77:

Change in vdsm[master]: v2v: add support for importing kvm based vms from libvirt

2016-04-21 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: add support for importing kvm based vms from libvirt
..

v2v: add support for importing kvm based vms from libvirt

Change-Id: I0ddbab700f2e0c54d53ed02ec61477b92c9c7960
Signed-off-by: Shahar Havivi 
---
M lib/vdsm/constants.py.in
M lib/vdsm/v2v.py
2 files changed, 69 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/56459/1

diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 7f3962d..29a208d 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -152,4 +152,5 @@
 
 EXT_CURL_IMG_WRAP = '@LIBEXECDIR@/curl-img-wrap'
 EXT_FC_SCAN = '@LIBEXECDIR@/fc-scan'
+EXT_KVM_2_OVIRT = '@LIBEXECDIR@/kvm2ovirt'
 EXT_SYSTEMD_RUN = '@SYSTEMD_RUN_PATH@'
diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index f96bda6..0336102 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -41,7 +41,7 @@
 import libvirt
 
 from vdsm.commands import execCmd
-from vdsm.constants import P_VDSM_RUN
+from vdsm.constants import P_VDSM_RUN, EXT_KVM_2_OVIRT
 from vdsm.define import errCode, doneCode
 from vdsm import libvirtconnection, response, concurrent
 from vdsm.infra import zombiereaper
@@ -56,6 +56,7 @@
 _SSH_AGENT = CommandPath('ssh-agent', '/usr/bin/ssh-agent')
 _SSH_ADD = CommandPath('ssh-add', '/usr/bin/ssh-add')
 _XEN_SSH_PROTOCOL = 'xen+ssh'
+_VMWARE_PROTOCOL = 'vpx'
 _SSH_AUTH_RE = '(SSH_AUTH_SOCK)=([^;]+).*;\nSSH_AGENT_PID=(\d+)'
 _OVF_RESOURCE_CPU = 3
 _OVF_RESOURCE_MEMORY = 4
@@ -155,8 +156,10 @@
 def convert_external_vm(uri, username, password, vminfo, job_id, irs):
 if uri.startswith(_XEN_SSH_PROTOCOL):
 command = XenCommand(uri, vminfo, job_id, irs)
-else:
+elif uri.startswith(_VMWARE_PROTOCOL):
 command = LibvirtCommand(uri, username, password, vminfo, job_id, irs)
+else:
+command = KVMCommand(uri, username, password, vminfo, job_id, irs)
 job = ImportVm(job_id, command)
 job.start()
 _add_job(job_id, job)
@@ -347,6 +350,8 @@
 self._irs = irs
 self._prepared_volumes = []
 
+self._passwd_file = os.path.join(_V2V_DIR, "%s.tmp" % vmid)
+
 def execute(self):
 raise NotImplementedError("Subclass must implement this")
 
@@ -427,6 +432,22 @@
 env['VIRTIO_WIN'] = self._vminfo['virtio_iso_path']
 return env
 
+@contextmanager
+def _password_file(self):
+fd = os.open(self._passwd_file, os.O_WRONLY | os.O_CREAT, 0o600)
+try:
+os.write(fd, self._password.value)
+finally:
+os.close(fd)
+try:
+yield
+finally:
+try:
+os.remove(self._passwd_file)
+except Exception:
+logging.exception("Job %r error removing passwd file: %s",
+  self._vmid, self._passwd_file)
+
 
 class LibvirtCommand(V2VCommand):
 def __init__(self, uri, username, password, vminfo, vmid, irs):
@@ -434,8 +455,6 @@
 self._uri = uri
 self._username = username
 self._password = password
-
-self._passwd_file = os.path.join(_V2V_DIR, "%s.tmp" % vmid)
 
 def _command(self):
 cmd = [_VIRT_V2V.cmd,
@@ -461,22 +480,6 @@
 def execute(self):
 with self._volumes(), self._password_file():
 yield self._start_virt_v2v()
-
-@contextmanager
-def _password_file(self):
-fd = os.open(self._passwd_file, os.O_WRONLY | os.O_CREAT, 0o600)
-try:
-os.write(fd, self._password.value)
-finally:
-os.close(fd)
-try:
-yield
-finally:
-try:
-os.remove(self._passwd_file)
-except Exception:
-logging.exception("Job %r error removing passwd file: %s",
-  self._vmid, self._passwd_file)
 
 
 class OvaCommand(V2VCommand):
@@ -551,6 +554,51 @@
 return env
 
 
+class KVMCommand(V2VCommand):
+def __init__(self, uri, username, password, vminfo, vmid, irs):
+super(KVMCommand, self).__init__(vminfo, vmid, irs)
+self._uri = uri
+self._username = username
+self._password = password
+
+def _command(self):
+cmd = [EXT_KVM_2_OVIRT,
+   '--uri', self._uri,
+   '--username', self._username,
+   '--password-file', self._passwd_file,
+   '--source', self._source_images(),
+   '--dest', self._dest_images()]
+return cmd
+
+@contextmanager
+def execute(self):
+with self._volumes(), self._password_file():
+yield self._start_virt_v2v()
+
+def _source_images(self):
+con = libvirtconnection.open_connection(uri=self._uri,
+username=self._username,
+ 

Change in vdsm[master]: spec: require test-only py3 packages

2016-04-19 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: spec: require test-only py3 packages
..


Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/56337
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib4d08a4136efe1289f6c9f907196b4e6f089f144
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvmstream: tool for streaming images from libvirt

2016-04-11 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvmstream: tool for streaming images from libvirt
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/55797/1/kvmstream.py
File kvmstream.py:

Line 82: write_output('(100/100%%)\r')
Line 83: 
Line 84: 
Line 85: options = parse_arguments()
Line 86: con = libvirt.open(options.uri)
> Some error handling?
this is temporary usage in libvirt,
I am planing to use vdsm.libvirtconnection...
Line 87: 
Line 88: diskno = 1
Line 89: disksitems = len(options.source)
Line 90: init_progres()


-- 
To view, visit https://gerrit.ovirt.org/55797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvmstream: tool for streaming images from libvirt

2016-04-11 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvmstream: tool for streaming images from libvirt
..


Patch Set 1:

(10 comments)

https://gerrit.ovirt.org/#/c/55797/1//COMMIT_MSG
Commit Message:

PS1, Line 9: v2v is needed to a streaming/download tool f
> "v2v needs"?
Done


https://gerrit.ovirt.org/#/c/55797/1/kvmstream.py
File kvmstream.py:

PS1, Line 22: from itertools import izip
> nit: better to avoid from ... imports and just import modules unless the im
Done


PS1, Line 23: import libvirt
> please group the non-standard-library imports below all the standard-librar
Done


PS1, Line 27: elapsed_time = 0
> I'd try to avoid global state unless absolutely needed. Here I think we can
Done


Line 30: def parse_arguments():
Line 31: parser = argparse.ArgumentParser()
Line 32: parser.add_argument('args')
Line 33: parser.add_argument('-u', dest='uri',
Line 34: help='Libvirt URI')
> This should be required argument
Done
Line 35: parser.add_argument('-s', dest='source', nargs='+',
Line 36: help='Source remote volumes path')
Line 37: parser.add_argument('-d', dest='dest', nargs='+',
Line 38: help='Destination local volumes path')


Line 32: parser.add_argument('args')
Line 33: parser.add_argument('-u', dest='uri',
Line 34: help='Libvirt URI')
Line 35: parser.add_argument('-s', dest='source', nargs='+',
Line 36: help='Source remote volumes path')
> This should be required argument
Done
Line 37: parser.add_argument('-d', dest='dest', nargs='+',
Line 38: help='Destination local volumes path')
Line 39: return parser.parse_args(sys.argv)
Line 40: 


Line 34: help='Libvirt URI')
Line 35: parser.add_argument('-s', dest='source', nargs='+',
Line 36: help='Source remote volumes path')
Line 37: parser.add_argument('-d', dest='dest', nargs='+',
Line 38: help='Destination local volumes path')
> This should be required argument
Done
Line 39: return parser.parse_args(sys.argv)
Line 40: 
Line 41: 
Line 42: def write_output(msg):


Line 46: 
Line 47: def init_progres():
Line 48: global elapsed_time
Line 49: write_output('[   %d.0] Opening the source -i libvirt\n' % 
elapsed_time)
Line 50: elapsed_time = elapsed_time + 1
> This is left over from fake progress code
No, I increase it intentionally.
Line 51: write_output('[   %d.0] Creating an overlay to protect\n' % 
elapsed_time)
Line 52: elapsed_time = elapsed_time + 1
Line 53: 
Line 54: 


Line 69: vol.download(stream, 0, 0, 0)
Line 70: write_output('(0/100%%)\r')
Line 71: counter = 0
Line 72: while pos < size:
Line 73: buf = s.recv(1024)
> We use 1M in ovirt-imageio and vdsm when copying images. We should have a d
Done
Line 74: f.write(buf)
Line 75: f.flush()
Line 76: if not pos % jump:
Line 77: counter = counter + 1


Line 82: write_output('(100/100%%)\r')
Line 83: 
Line 84: 
Line 85: options = parse_arguments()
Line 86: con = libvirt.open(options.uri)
> Some error handling?
Done
Line 87: 
Line 88: diskno = 1
Line 89: disksitems = len(options.source)
Line 90: init_progres()


-- 
To view, visit https://gerrit.ovirt.org/55797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvmstream: tool for streaming images from libvirt

2016-04-07 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: kvmstream: tool for streaming images from libvirt
..


Patch Set 1:

(4 comments)

https://gerrit.ovirt.org/#/c/55797/1/kvmstream.py
File kvmstream.py:

PS1, Line 47: init_progres
> typo: progress
Done


Line 57: write_output('[ %d.0] Creating output metadata\n' % elapsed_time)
Line 58: write_output('[ %d.0] Finishing off\n' % elapsed_time)
Line 59: 
Line 60: 
Line 61: def download_volume(stream, vol, dest, diskno, disks):
> You should use the directio module from ovirt-imageio - I can move it to th
Please do move it to common,
for the progress I will check if that will be sufficient.
Line 62: global elapsed_time
Line 63: write_output('[  %d.0] Copying disk %d/%d to %s\n' %
Line 64:  (elapsed_time, diskno, disks, dest))
Line 65: size = vol.info()[2]


PS1, Line 68: f = open(dest, 'w')
> please use context managers:
Done


Line 69: vol.download(stream, 0, 0, 0)
Line 70: write_output('(0/100%%)\r')
Line 71: counter = 0
Line 72: while pos < size:
Line 73: buf = s.recv(1024)
> The 1024 is probably a low value - I'd increase it (but in any case, I thin
I am not sure,
what size do you suggest?
Line 74: f.write(buf)
Line 75: f.flush()
Line 76: if not pos % jump:
Line 77: counter = counter + 1


-- 
To view, visit https://gerrit.ovirt.org/55797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: kvmstream: tool for streaming images from libvirt

2016-04-07 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: kvmstream: tool for streaming images from libvirt
..

kvmstream: tool for streaming images from libvirt

v2v is needed to a streaming/download tool for importing kvm based
images from Libvirt to vdsm.
for other such as xen and vmware virt-v2v provide the solution.
this tool mimic virt-v2v output in order to use it smoothly in v2v.py
module.

Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Signed-off-by: Shahar Havivi 
---
A kvmstream.py
1 file changed, 96 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/97/55797/1

diff --git a/kvmstream.py b/kvmstream.py
new file mode 100755
index 000..4c793b8
--- /dev/null
+++ b/kvmstream.py
@@ -0,0 +1,96 @@
+#!/usr/bin/env python
+# Copyright 2016 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 argparse
+from itertools import izip
+import libvirt
+import sys
+
+
+elapsed_time = 0
+
+
+def parse_arguments():
+parser = argparse.ArgumentParser()
+parser.add_argument('args')
+parser.add_argument('-u', dest='uri',
+help='Libvirt URI')
+parser.add_argument('-s', dest='source', nargs='+',
+help='Source remote volumes path')
+parser.add_argument('-d', dest='dest', nargs='+',
+help='Destination local volumes path')
+return parser.parse_args(sys.argv)
+
+
+def write_output(msg):
+sys.stdout.write(msg)
+sys.stdout.flush()
+
+
+def init_progres():
+global elapsed_time
+write_output('[   %d.0] Opening the source -i libvirt\n' % elapsed_time)
+elapsed_time = elapsed_time + 1
+write_output('[   %d.0] Creating an overlay to protect\n' % elapsed_time)
+elapsed_time = elapsed_time + 1
+
+
+def finish_progress():
+global elapsed_time
+write_output('[ %d.0] Creating output metadata\n' % elapsed_time)
+write_output('[ %d.0] Finishing off\n' % elapsed_time)
+
+
+def download_volume(stream, vol, dest, diskno, disks):
+global elapsed_time
+write_output('[  %d.0] Copying disk %d/%d to %s\n' %
+ (elapsed_time, diskno, disks, dest))
+size = vol.info()[2]
+pos = 0
+jump = size / 1024 / 99
+f = open(dest, 'w')
+vol.download(stream, 0, 0, 0)
+write_output('(0/100%%)\r')
+counter = 0
+while pos < size:
+buf = s.recv(1024)
+f.write(buf)
+f.flush()
+if not pos % jump:
+counter = counter + 1
+elapsed_time = elapsed_time + 1
+write_output('(%s/100%%)\r' % str(counter))
+pos = pos + 1024
+f.close()
+write_output('(100/100%%)\r')
+
+
+options = parse_arguments()
+con = libvirt.open(options.uri)
+
+diskno = 1
+disksitems = len(options.source)
+init_progres()
+for item in izip(options.source, options.dest):
+vol = con.storageVolLookupByPath(item[0])
+s = con.newStream()
+download_volume(s, vol, item[1], diskno, disksitems)
+diskno = diskno + 1
+finish_progress()


-- 
To view, visit https://gerrit.ovirt.org/55797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d95c3bf4b2605e71f899171259d4721204eb8e2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.6]: Handle closed stream when virt-v2v fails

2016-04-03 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: Handle closed stream when virt-v2v fails
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/55607
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia166c1aa03a8d62168034cd581be80ef5a3dc69e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.6]: Handle closed stream when virt-v2v fails

2016-04-03 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: Handle closed stream when virt-v2v fails
..

Handle closed stream when virt-v2v fails

When file object is closed by the other side, read return empty string,
previously we assumed an exception is raised.

Change-Id: Ia166c1aa03a8d62168034cd581be80ef5a3dc69e
Bug-Url: https://bugzilla.redhat.com/1298134
Signed-off-by: Shahar Havivi 
---
M vdsm/v2v.py
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/55607/1

diff --git a/vdsm/v2v.py b/vdsm/v2v.py
index 29eaa56..f54b9e2 100644
--- a/vdsm/v2v.py
+++ b/vdsm/v2v.py
@@ -623,6 +623,8 @@
 chunk = ''
 while True:
 c = stream.read(1)
+if not c:
+raise OutputParserError('copy-disk stream closed unexpectedly')
 chunk += c
 if c == '\r':
 yield chunk


-- 
To view, visit https://gerrit.ovirt.org/55607
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia166c1aa03a8d62168034cd581be80ef5a3dc69e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: fix handling virt-v2v fail on stream close

2016-03-30 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: fix handling virt-v2v fail on stream close
..


Patch Set 2: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/55477
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia166c1aa03a8d62168034cd581be80ef5a3dc69e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: fix handling virt-v2v fail on stream close

2016-03-30 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: fix handling virt-v2v fail on stream close
..


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/55477/1/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 714: chunk = ''
Line 715: while True:
Line 716: c = stream.read(1)
Line 717: if not c:
Line 718: raise V2VProcessError('copy-disk stream closed 
unexpectedly')
> Maybe use OuputParserError? seem more consistent with other errors raised i
+1
Line 719: chunk += c
Line 720: if c == '\r':
Line 721: yield chunk
Line 722: chunk = ''


-- 
To view, visit https://gerrit.ovirt.org/55477
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia166c1aa03a8d62168034cd581be80ef5a3dc69e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: fix handling virt-v2v fail on stream close

2016-03-30 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: fix handling virt-v2v fail on stream close
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/55477
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia166c1aa03a8d62168034cd581be80ef5a3dc69e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: fix handling virt-v2v fail on stream close

2016-03-30 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: v2v: fix handling virt-v2v fail on stream close
..

v2v: fix handling virt-v2v fail on stream close

when proc.stdout.read() is close it doesn't raise an error but returns
''.

Change-Id: Ia166c1aa03a8d62168034cd581be80ef5a3dc69e
Url: https://bugzilla.redhat.com/1298134
Signed-off-by: Shahar Havivi 
---
M lib/vdsm/v2v.py
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/55477/1

diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py
index de0244b..bf2c436 100644
--- a/lib/vdsm/v2v.py
+++ b/lib/vdsm/v2v.py
@@ -714,6 +714,8 @@
 chunk = ''
 while True:
 c = stream.read(1)
+if not c:
+raise V2VProcessError('copy-disk stream closed unexpectedly')
 chunk += c
 if c == '\r':
 yield chunk


-- 
To view, visit https://gerrit.ovirt.org/55477
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia166c1aa03a8d62168034cd581be80ef5a3dc69e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: spec: bump libguestfs-tools-c requirement

2016-03-24 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: spec: bump libguestfs-tools-c requirement
..


Patch Set 4: Code-Review+1

-- 
To view, visit https://gerrit.ovirt.org/54797
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibc245f04473ea5e2d40e622cc4622a8b4cbb2f84
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: v2v: use new jobs infrastructure

2016-03-10 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: v2v: use new jobs infrastructure
..


Patch Set 3:

(2 comments)

https://gerrit.ovirt.org/#/c/52858/3/lib/vdsm/v2v.py
File lib/vdsm/v2v.py:

Line 80
Line 81
Line 82
Line 83
Line 84
> This does not comply with the schema of getJobs - there are no such statuse
I will remove the status class and will work with the default jobs 
infrastructure


Line 82
Line 83
Line 84
Line 85
Line 86
> This is now "failed", so you will have to change the engine side to look fo
?
its the removed entries ie we don't use it


-- 
To view, visit https://gerrit.ovirt.org/52858
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iac71559e02502580de9c2e537733ec7286682050
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Adam Litke 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: Remove sparsify from vdsm

2016-03-07 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: Remove sparsify from vdsm
..


Patch Set 1:

> (1 comment)
 > 
 > Can we just drop a method from schema? Seems too easy to be true...

Engine doesn't use it,
It was Nir idea to remove the old sparsify

-- 
To view, visit https://gerrit.ovirt.org/54426
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2d2b86035b6cc6ec74a403c3379d0b384fb6f23e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: virt-sparsify: add inplace virt-sparsify support

2016-03-07 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: virt-sparsify: add inplace virt-sparsify support
..


Patch Set 1: Code-Review-1

No need for review

-- 
To view, visit https://gerrit.ovirt.org/54427
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie0a1269d71816a8ab25c4a00bfb483620cfefde8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: Remove sparsify from vdsm

2016-03-07 Thread shavivi
Shahar Havivi has posted comments on this change.

Change subject: Remove sparsify from vdsm
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/54426
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2d2b86035b6cc6ec74a403c3379d0b384fb6f23e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Nir Soffer 
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: virt-sparsify: add in-place sparsify support

2016-03-07 Thread shavivi
Shahar Havivi has abandoned this change.

Change subject: virt-sparsify: add in-place sparsify support
..


Abandoned

-- 
To view, visit https://gerrit.ovirt.org/53900
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Icef4021567df5da1cd5b74a94c2d76fefcde3aba
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi 
Gerrit-Reviewer: gerrit-hooks 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: virt-sparsify: add inplace virt-sparsify support

2016-03-07 Thread shavivi
Shahar Havivi has uploaded a new change for review.

Change subject: virt-sparsify: add inplace virt-sparsify support
..

virt-sparsify: add inplace virt-sparsify support

Change-Id: Ie0a1269d71816a8ab25c4a00bfb483620cfefde8
Signed-off-by: Shahar Havivi 
---
M lib/api/vdsmapi-schema.json
M lib/vdsm/Makefile.am
M lib/vdsm/rpc/Bridge.py
A lib/vdsm/virtsparsify.py
M tests/Makefile.am
A tests/sparsifyTests.py
M vdsm.spec.in
M vdsm/API.py
8 files changed, 154 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/54427/1

diff --git a/lib/api/vdsmapi-schema.json b/lib/api/vdsmapi-schema.json
index a9f43ef..d09cf32 100644
--- a/lib/api/vdsmapi-schema.json
+++ b/lib/api/vdsmapi-schema.json
@@ -8276,7 +8276,6 @@
  'data': {'vmID': 'UUID', 'drive': 'DriveSpecVolume', 'baseVolUUID': 'UUID',
   'topVolUUID': 'UUID', '*bandwidth': 'int', '*jobUUID': 'UUID'}}
 
-
 ## Category: @Volume ##
 ##
 # @Volume:
@@ -8713,6 +8712,25 @@
   'legality': 'VolumeLegality'}}
 
 ##
+# @Volume.sparsifyInplace:
+#
+# Perform an in-place sparse (e.g. not creating a new image) on given volume
+#
+# @volumeID:The UUID of the Volume
+#
+# @storagepoolID:   The UUID of the image that contains the volume
+#
+# @storagedomainID: The Storage Pool UUID associated with the Volume
+#
+# @imageID: The Storage Domain UUID associated with the Volume
+#
+# Since: 4.18.0
+##
+{'command': {'class': 'Volume', 'name': 'sparsifyInplace'},
+ 'data': {'volumeID': 'UUID', 'storagepoolID': 'UUID',
+  'storagedomainID': 'UUID', 'imageID': 'UUID'}}
+
+##
 # @VmMemoryDeviceType:
 #
 # An enumeration of VM memory device types.
@@ -8908,7 +8926,7 @@
 #
 # This namespace is for SDM (storage domain manager) functions.
 #
-# Since: 4.18
+# Since: 4.19
 ##
 {'class': 'SDM'}
 
diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am
index fb63dd3..69eb968 100644
--- a/lib/vdsm/Makefile.am
+++ b/lib/vdsm/Makefile.am
@@ -63,6 +63,7 @@
utils.py \
v2v.py \
vdscli.py \
+   virtsparsify.py \
xmlrpc.py \
$(NULL)
 
diff --git a/lib/vdsm/rpc/Bridge.py b/lib/vdsm/rpc/Bridge.py
index ffd42f4..9f7b39b 100644
--- a/lib/vdsm/rpc/Bridge.py
+++ b/lib/vdsm/rpc/Bridge.py
@@ -502,6 +502,7 @@
 'Volume_getPath': {'ret': 'path'},
 'Volume_getSize': {'ret': Volume_getsize_Ret},
 'Volume_extendSize': {'ret': 'uuid'},
+'Volume_sparsifyInplace': {},
 'Host_getAllTasks': {'ret': 'tasks'},
 'Host_getJobs': {'ret': 'jobs'},
 }
diff --git a/lib/vdsm/virtsparsify.py b/lib/vdsm/virtsparsify.py
new file mode 100644
index 000..99452a5
--- /dev/null
+++ b/lib/vdsm/virtsparsify.py
@@ -0,0 +1,100 @@
+#
+# Copyright 2016 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
+#
+
+from __future__ import absolute_import
+from contextlib import contextmanager
+import logging
+import signal
+from uuid import uuid4
+
+from . import commands
+from . import concurrent
+from . import jobs
+from . import utils
+from . import response
+
+# Fedora, EL6
+_VIRTSPARSIFY = utils.CommandPath("virt-sparsify",
+  "/usr/bin/virt-sparsify",)
+
+
+def inplace(sdUUID, spUUID, imgUUID, volUUID, irs):
+"""
+Sparsify the volume in place
+(instead of copying from an input disk to an output disk)
+"""
+job = InplaceJob(volUUID, imgUUID, sdUUID, spUUID, irs)
+job.start()
+jobs.add(job)
+
+
+def delete_inplace_job(job_id):
+return jobs.delete(job_id)
+
+
+def abort_inplace_job(job_id):
+return jobs.abort(job_id)
+
+
+@contextmanager
+def volume(volUUID, imgUUID, sdUUID, spUUID, irs):
+res = irs.prepareImage(sdUUID, spUUID, imgUUID, volUUID)
+if response.is_error(res):
+raise Exception('Cannot find volume path for %r' % volUUID)
+try:
+yield res['path']
+finally:
+try:
+irs.teardownImage(sdUUID, spUUID, imgUUID)
+except Exception:
+logging.exception('Error tearing down image: %r', imgUUID)
+raise
+
+
+class InplaceJob(jobs.Job):
+def __init__(self, 

  1   2   3   4   5   6   7   8   9   >