[et-mgmt-tools] [PATCH] convert vmware machines to virt-image xml format

Joey Boggs jboggs at redhat.com
Fri Jun 27 18:09:47 UTC 2008


Updated version based on comments. 

Cole, check the record validation section to see if that's fine. I just 
integrated it with the 2 checks that were already in place rather than 
creating another function.


Cole Robinson wrote:
> Joey Boggs wrote:
>   
>> I integrated the common cli options and all the other modifications, but 
>> wasn't sure the best way to approach the para/full virt check removal 
>> from the comments
>>
>> "If you use the above --paravirt/--hvm option change, you won't need
>> this check." Both before and after code snips below.
>>
>> I changed the if/else to evaluate the options for True on either 
>> para/full, if there's something else you'd want to see please let me know
>>
>>
>> -------------------------------------------------------------------------------
>>     parser.add_option("-v", "--hvm", action="store_true", dest="fullvirt",
>>                       help=("This guest should be a fully virtualized 
>> guest"))
>>     parser.add_option("-p", "--paravirt", action="store_true", 
>> dest="paravirt",
>>                       help=("This guest should be a paravirtualized guest"))
>>
>>
>>
>>
>>     if options.paravirt is True:
>>         virt_boot_template = """<boot type="xen">
>>           <guest>
>>             <arch>%(vm_arch)s</arch>
>>             <features>
>>               <pae/>
>>             </features>
>>           </guest>
>>           <os>
>>             <loader>pygrub</loader>
>>           </os>
>>          %(vm_pv_disks)s
>>          </boot>"""
>>     elif options.fullvirt is True:
>>
>>         virt_boot_template = """<boot type="hvm">
>>           <guest>
>>             <arch>%(vm_arch)s</arch>
>>           </guest>
>>           <os>
>>             <loader dev="hd"/>
>>           </os>
>>           %(vm_fv_disks)s
>>         </boot>"""
>>     else:
>>         print "Invalid virtualization type specified"
>>         sys.exit(1)
>>     
>
> Sorry, I wasn't very clear. The unnecessary check I was talking about
> was the last sanity check, the "Invalid virtualization type". Since this
> is basically a boolean option (hvm or not), i'd do something like
>
> if options.paravirt:
>   hvm = False
> else:
>   hvm = True
>
> In main() and pass hvm explictly to the above function.
>
> - Cole
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: virt-unpack.patch
Type: text/x-patch
Size: 8692 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/et-mgmt-tools/attachments/20080627/5900cc72/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: virt-unpack-pod.patch
Type: text/x-patch
Size: 2694 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/et-mgmt-tools/attachments/20080627/5900cc72/attachment-0001.bin>


More information about the et-mgmt-tools mailing list