X-Git-Url: http://git.ipfire.org/?p=nitsi.git;a=blobdiff_plain;f=machine.py;h=9fbdf3fb67d05ecd22328235ec3009a22047b00a;hp=035c010a608a3b4a6e2cdb0bb2082b42eba566b0;hb=8b744f18c280e53d4cb2562d7a3893c4cc4ef240;hpb=a6a7fe20f44a9708b9272a673538062f4a3728e0 diff --git a/machine.py b/machine.py index 035c010..9fbdf3f 100644 --- a/machine.py +++ b/machine.py @@ -6,16 +6,14 @@ from disk import disk from serial_connection import serial_connection -from test import libvirt_con - import os import libvirt class machine(): - def __init__(self, vm_xml_file, snapshot_xml_file, image, root_uid, username, password): + def __init__(self, libvirt_con, vm_xml_file, snapshot_xml_file, image, root_uid, username, password): self.log = log(4) - self.con = libvirt_con("qemu:///system") + self.con = libvirt_con try: with open(vm_xml_file) as fobj: self.vm_xml = fobj.read() @@ -40,7 +38,7 @@ class machine(): self.password = password def define(self): - self.dom = self.con.con.defineXML(self.vm_xml) + self.dom = self.con.defineXML(self.vm_xml) if self.dom == None: self.log.error("Could not define VM") raise BaseException