[Kimchi-devel] [PATCH] Add PPC console configuration to guest XML

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Thu Nov 6 13:20:25 UTC 2014


On 10/30/2014 04:20 PM, Aline Manera wrote:
>
> On 10/30/2014 02:44 PM, Rodrigo Trujillo wrote:
>> When creating a VM from template, add PPC console configuration to xml.
>>
>> Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
>> ---
>>   src/kimchi/vmtemplate.py | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
>> index cfc46f6..d18fc59 100644
>> --- a/src/kimchi/vmtemplate.py
>> +++ b/src/kimchi/vmtemplate.py
>> @@ -409,6 +409,16 @@ drive=drive-%(bus)s0-1-0,id=%(bus)s0-1-0'/>
>>             </devices>
>>           </domain>
>>           """ % params
>> +
>
>> +        # Adding PPC console configuration
>> +        if params['arch'] in ['ppc', 'ppc64']:
>> +            ppc_console = """<memballoon model='virtio' />
>> +            <console type='pty'>
>> +              <target type='serial' port='1'/>
>> +              <address type='spapr-vio' reg='0x30001000'/>
>> +            </console>"""
>> +            xml = xml.replace("<memballoon model='virtio' />", 
>> ppc_console)
>> +
>
> When params['arch'] will be set? Just this code does not change the 
> Template for a PPC host.
Hi Aline,
this piece of code runs when to_vm_xml from VMTemplate is called while 
creating a new VM.
params{} comes from VMTemplate.info (self.info), which in turns is 
populated from "args"
which has the template information retrieved from the sqlite database. 
The arch info is stored
there for each template, when you create a new template.

>
>>           return xml
>>
>>       def validate(self):
>
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>




More information about the Kimchi-devel mailing list