Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
7e6bcfbb
authored
Jul 17, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding flags to createXML()
parent
4381a1ce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
vmdriver.py
+8
-2
No files found.
vmdriver.py
View file @
7e6bcfbb
#!/usr/bin/env python
#!/usr/bin/env python
import
libvirt
import
libvirt
import
vm
import
logging
import
logging
...
@@ -46,8 +45,14 @@ class VMDriver:
...
@@ -46,8 +45,14 @@ class VMDriver:
@req_connection
@req_connection
def
vm_create
(
self
,
vm
):
def
vm_create
(
self
,
vm
):
'''Create and start non-permanent virtual machine from xml
'''Create and start non-permanent virtual machine from xml
flags can be:
VIR_DOMAIN_NONE = 0
VIR_DOMAIN_START_PAUSED = 1
VIR_DOMAIN_START_AUTODESTROY = 2
VIR_DOMAIN_START_BYPASS_CACHE = 4
VIR_DOMAIN_START_FORCE_BOOT = 8
'''
'''
self
.
connection
.
createXML
(
vm
.
dump_xml
())
self
.
connection
.
createXML
(
vm
.
dump_xml
()
,
libvirt
.
VIR_DOMAIN_NONE
)
logging
.
info
(
"Virtual machine
%
s is created from xml"
,
vm
.
name
)
logging
.
info
(
"Virtual machine
%
s is created from xml"
,
vm
.
name
)
@req_connection
@req_connection
...
@@ -60,3 +65,4 @@ class VMDriver:
...
@@ -60,3 +65,4 @@ class VMDriver:
self
.
connection
.
lookupByName
(
name
)
self
.
connection
.
lookupByName
(
name
)
except
libvirt
.
libvirtError
as
e
:
except
libvirt
.
libvirtError
as
e
:
logging
.
error
(
e
.
get_error_message
())
logging
.
error
(
e
.
get_error_message
())
#virDomainResume
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