On 07/31/2012 04:23 PM, Wayne Sun wrote:
* add imageformat as optional param in define
* modify define xml for image format support
Signed-off-by: Wayne Sun <gsun(a)redhat.com>
---
repos/domain/define.py | 1 +
repos/domain/xmls/kvm_guest_define.xml | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/repos/domain/define.py b/repos/domain/define.py
index 0a06dfd..a70ddad 100644
--- a/repos/domain/define.py
+++ b/repos/domain/define.py
@@ -16,6 +16,7 @@ from utils import utils
required_params = ('guestname', 'diskpath',)
optional_params = {'memory': 1048576,
'vcpu': 1,
+ 'imageformat' : 'raw',
'hddriver' : 'virtio',
'nicdriver': 'virtio',
'macaddr': '52:54:00:97:e4:28',
diff --git a/repos/domain/xmls/kvm_guest_define.xml
b/repos/domain/xmls/kvm_guest_define.xml
index 4599b2e..6da0ad4 100644
--- a/repos/domain/xmls/kvm_guest_define.xml
+++ b/repos/domain/xmls/kvm_guest_define.xml
@@ -19,7 +19,7 @@
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name='qemu' type='qcow2'/>
+ <driver name='qemu' type='IMAGEFORMAT'/>
<source file='DISKPATH'/>
<target dev='vda' bus='HDDRIVER'/>
</disk>
The create.py needs the same change, I will do it with this patch
together.
ACK
Guannan