Amador Pahim has uploaded a new change for review.

Change subject: vdsm-hooks: fix malformed libvirt xml
......................................................................

vdsm-hooks: fix malformed libvirt xml

Missing snapshot="no" attribute is leding Storage Live Migration
to fail.
This patch adds snapshot="no" attribute to vdsm-hooks adding
disks/directlun.

Change-Id: Id6422c45450ffc65e4fe84ab7d66a30a285dd42a
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1036111
Signed-off-by: Amador Pahim <apa...@redhat.com>
---
M vdsm_hooks/directlun/before_vm_start.py
M vdsm_hooks/scratchpad/before_vm_start.py
M vdsm_hooks/vmdisk/before_vm_start.py
3 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/21913/1

diff --git a/vdsm_hooks/directlun/before_vm_start.py 
b/vdsm_hooks/directlun/before_vm_start.py
index bde62a2..4de5875 100755
--- a/vdsm_hooks/directlun/before_vm_start.py
+++ b/vdsm_hooks/directlun/before_vm_start.py
@@ -25,7 +25,7 @@
 
 def createDiskElement(domxml, devpath, lunid, options):
     '''
-    <disk device="disk" type="block">
+    <disk device="disk" type="block" snapshot="no">
         <source dev="/dev/mapper/lunid"/>
         <target bus="virtio" dev="vda"/>
         <driver cache="none" error_policy="stop" name="qemu" type="raw"/>
@@ -35,6 +35,7 @@
     disk = domxml.createElement('disk')
     disk.setAttribute('device', 'disk')
     disk.setAttribute('type', 'block')
+    disk.setAttribute('snapshot', 'no')
 
     source = domxml.createElement('source')
     source.setAttribute('dev', devpath)
diff --git a/vdsm_hooks/scratchpad/before_vm_start.py 
b/vdsm_hooks/scratchpad/before_vm_start.py
index 2f2fe3f..2e5ddc6 100755
--- a/vdsm_hooks/scratchpad/before_vm_start.py
+++ b/vdsm_hooks/scratchpad/before_vm_start.py
@@ -53,7 +53,7 @@
 def add_disk(domxml, path):
     '''
     Create libvirt xml node
-    <disk device="disk" type="file">
+    <disk device="disk" type="file" snapshot="no">
         <source file="[path to image]"/>
         <driver cache="writeback" error_policy="stop" type="raw"/>
     </disk>
@@ -62,6 +62,7 @@
     disk = domxml.createElement('disk')
     disk.setAttribute('device', 'disk')
     disk.setAttribute('type', 'file')
+    disk.setAttribute('snapshot', 'no')
 
     source = domxml.createElement('source')
     source.setAttribute('file', path)
diff --git a/vdsm_hooks/vmdisk/before_vm_start.py 
b/vdsm_hooks/vmdisk/before_vm_start.py
index 0d3ee0a..c08c645 100755
--- a/vdsm_hooks/vmdisk/before_vm_start.py
+++ b/vdsm_hooks/vmdisk/before_vm_start.py
@@ -27,7 +27,7 @@
 
 def createDiskElement(domxml, devpath, drivertype):
     '''
-    <disk device="disk" type="file">
+    <disk device="disk" type="file" snapshot="no">
         <source file="/net/myhost/myimage.img"/>
         <target bus="virtio" dev="vda"/>
         <driver cache="none" error_policy="stop" name="qemu" type="qcow2"/>
@@ -37,6 +37,7 @@
     disk = domxml.createElement('disk')
     disk.setAttribute('device', 'disk')
     disk.setAttribute('type', 'file')
+    disk.setAttribute('snapshot', 'no')
 
     source = domxml.createElement('source')
     source.setAttribute('file', devpath)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6422c45450ffc65e4fe84ab7d66a30a285dd42a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amador Pahim <apa...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to