[Kimchi-devel] [PATCH] Set default storage pool to autostart and make persistent

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Wed Apr 30 07:58:54 UTC 2014


on 2014/04/30 14:25, Sheldon wrote:
> This patch looks good.
> Just a minor inline comment below
> 
> On 04/30/2014 12:56 AM, Christy Perez wrote:
>> The default storage pool wasn't set to autostart, and wasn't
>> persistent. If a user wants to continue to use any VMs they
>> have created in kimchi (maybe only for troubleshooting) but
>> kimchi isn't active, the default pool may not be active.
>>
>> Signed-off-by: Christy Perez <christy at linux.vnet.ibm.com>
>> ---
>>   src/kimchi/model/model.py | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/kimchi/model/model.py b/src/kimchi/model/model.py
>> index a7d843e..a766ca5 100644
>> --- a/src/kimchi/model/model.py
>> +++ b/src/kimchi/model/model.py
>> @@ -71,7 +71,8 @@ class Model(BaseModel):
>>               pool = conn.storagePoolLookupByName("default")
>>           except libvirt.libvirtError:
>>               try:
>> -                pool = conn.storagePoolCreateXML(xml, 0)
>> +                pool = conn.storagePoolDefineXML(xml, 0)
>> +                pool.setAutostart(1)
> what does "1" mean?

libvirt Python binding is not documented well. I always have to refer to
the C API documentation to find out how to use the respective Python
function.

By referring to
http://libvirt.org/html/libvirt-libvirt.html#virDomainSetAutostart
"1" means enabled.

>>               except libvirt.libvirtError, e:
>>                   cherrypy.log.error("Fatal: Cannot create default
>> pool because "
>>                                      "of %s, exit kimchid" % e.message,
> 
> 


-- 
Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou at linux.vnet.ibm.com
Telephone: 86-10-82454397




More information about the Kimchi-devel mailing list