Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
cobbler.10419
koan-use-kvm-acceleration-if-available.dif
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File koan-use-kvm-acceleration-if-available.dif of Package cobbler.10419
Index: cobbler-2.6.6/koan/qcreate.py =================================================================== --- cobbler-2.6.6.orig/koan/qcreate.py +++ cobbler-2.6.6/koan/qcreate.py @@ -25,8 +25,26 @@ requires python-virtinst-0.200 (or virt- import utils import virtinstall +from xml.dom.minidom import parseString def start_install(*args, **kwargs): + if 'arch' in kwargs.keys(): + kwargs['arch'] = None # use host arch for kvm acceleration + + # Use kvm acceleration if available + try: + import libvirt + except: + raise koan.InfoException("package libvirt is required for installing virtual guests") + conn = libvirt.openReadOnly(None) + # See http://libvirt.org/formatcaps.html + capabilities = parseString(conn.getCapabilities()) + for domain in capabilities.getElementsByTagName("domain"): + attributes = dict(domain.attributes.items()) + if 'type' in attributes.keys() and attributes['type'] == 'kvm': + kwargs['virt_type'] = 'kvm' + break + virtinstall.create_image_file(*args, **kwargs) cmd = virtinstall.build_commandline("qemu:///system", *args, **kwargs) utils.subprocess_call(cmd)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor