Ability to turn hpet on/off from driver prefs + fix for reboot_timeout

Change-Id: I7e49a346eb31f04220ca40557e172064cbbaf90b
This commit is contained in:
Igor Shishkin 2014-08-18 19:34:08 +04:00
parent 738c22057b
commit 27e84f6aa7
No known key found for this signature in database
GPG Key ID: 6B7414201DCED2E4
3 changed files with 9 additions and 1 deletions

View File

@ -31,14 +31,16 @@ class DevopsDriver(object):
def __init__(self,
connection_string="qemu:///system",
storage_pool_name="default",
stp=True):
stp=True, hpet=True):
libvirt.virInitialize()
self.conn = libvirt.open(connection_string)
self.xml_builder = LibvirtXMLBuilder(self)
self.stp = stp
self.hpet = hpet
self.capabilities = None
self.allocated_networks = None
self.storage_pool_name = storage_pool_name
self.reboot_timeout = None
if settings.VNC_PASSWORD:
self.vnc_password = settings.VNC_PASSWORD

View File

@ -159,6 +159,11 @@ class LibvirtXMLBuilder(object):
node_xml.vcpu(str(node.vcpu))
node_xml.memory(str(node.memory * 1024), unit='KiB')
node_xml.clock(offset='utc')
node_xml.clock.timer(
name='hpet',
present='yes' if self.driver.hpet else 'no')
with node_xml.os:
node_xml.type(node.os_type, arch=node.architecture)
for boot_dev in json.loads(node.boot):

View File

@ -19,6 +19,7 @@ DRIVER_PARAMETERS = {
'connection_string': environ.get('CONNECTION_STRING', 'qemu:///system'),
'storage_pool_name': environ.get('STORAGE_POOL_NAME', 'default'),
'stp': True,
'hpet': False,
}
INSTALLED_APPS = ['south', 'devops']