def __init__(self, hostname=None, user=None, passwd=None): VirtDriver.__init__(self, hostname, user, passwd) self._auth = [[libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_PASSPHRASE], self._request_cred, None] # conn = libvirt.open(name) need root username # conn = libvirt.openReadOnly(name) has not write promission # self._hypervisor_root_handler = libvirt.openAuth("{0}{1}{2}".format('qemu+tcp://', self.hostname, '/system'), self._auth, 0) self._hypervisor_root_handler = None log.debug("Try to connect to libvirt in host: %s", self.hostname) self._hypervisor_handler = self.get_handler()
def __init__(self, hostname=None, user="******", passwd=""): VirtDriver.__init__(self, hostname, user, passwd) self._hypervisor_handler = self.get_handler()