Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
faaf1293
authored
Jul 16, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding docstring comments
parent
8b6b18e3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
vmdriver.py
+10
-0
No files found.
vmdriver.py
View file @
faaf1293
...
...
@@ -21,6 +21,9 @@ class VMDriver:
return
new_function
def
connect
(
self
,
connection_string
=
'qemu:///system'
):
'''Connect to the libvirt daemon specified in the
connection_string or the local root.
'''
if
self
.
connection
is
None
:
self
.
connection
=
libvirt
.
open
(
connection_string
)
else
:
...
...
@@ -28,15 +31,22 @@ class VMDriver:
@req_connection
def
disconnect
(
self
,
connection_string
=
'qemu:///system'
):
'''Disconnect from the active libvirt daemon connection.
'''
self
.
connection
.
close
()
self
.
connection
=
None
@req_connection
def
vm_define
(
self
,
vm
):
'''Define permanent virtual machine from xml
'''
self
.
connection
.
defineXML
(
vm
.
dump_xml
())
logging
.
info
(
"Virtual machine
%
s is defined from xml"
,
vm
.
name
)
@req_connection
def
vm_create
(
self
,
vm
):
'''Create and start non-permanent virtual machine from xml
'''
self
.
connection
.
createXML
(
vm
.
dump_xml
())
logging
.
info
(
"Virtual machine
%
s is created from xml"
,
vm
.
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment