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
Commit
51b12acb
authored
Jul 22, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring vm to domain fixing vm_delete
parent
7f7756b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
vmdriver.py
+19
-12
No files found.
vmdriver.py
View file @
51b12acb
...
...
@@ -56,6 +56,13 @@ class VMDriver:
logging
.
info
(
"Virtual machine
%
s is created from xml"
,
vm
.
name
)
@req_connection
def
vm_delete
(
self
,
vm
):
'''Destroy the running called 'name' virtual machine.
'''
domain
=
self
.
lookupByName
(
vm
.
name
)
domain
.
destroy
()
@req_connection
def
list_domains
(
self
):
return
self
.
connection
.
listDefinedDomains
()
...
...
@@ -73,9 +80,9 @@ class VMDriver:
'''Undefine an already defined virtual machine.
If it's running it becomes transient (lsot on reboot)
'''
vm
=
self
.
lookupByName
(
name
)
domain
=
self
.
lookupByName
(
name
)
try
:
vm
.
undefine
()
domain
.
undefine
()
except
:
logging
.
error
(
'Can not get VM with name
%
s'
,
name
)
...
...
@@ -83,31 +90,31 @@ class VMDriver:
def
vm_start
(
self
,
name
):
'''Start an already defined virtual machine.
'''
vm
=
self
.
lookupByName
(
name
)
vm
.
create
()
domain
=
self
.
lookupByName
(
name
)
domain
.
create
()
@req_connection
def
vm_save
(
self
,
name
,
path
):
'''Stop virtual machine and save its memory to path.
'''
vm
=
self
.
lookupByName
(
name
)
vm
.
save
(
path
)
domain
=
self
.
lookupByName
(
name
)
domain
.
save
(
path
)
def
vm_resume
(
self
,
name
):
'''Resume stopped virtual machines.
'''
vm
=
self
.
lookupByName
(
name
)
vm
.
resume
()
domain
=
self
.
lookupByName
(
name
)
domain
.
resume
()
def
vm_reset
(
self
,
name
):
'''Reset (power reset) virtual machine.
'''
vm
=
self
.
lookupByName
(
name
)
vm
.
reset
()
domain
=
self
.
lookupByName
(
name
)
domain
.
reset
()
def
vm_reboot
(
self
,
name
):
'''Reboot (with guest acpi support) virtual machine.
'''
vm
=
self
.
lookupByName
(
name
)
vm
.
reboot
()
domain
=
self
.
lookupByName
(
name
)
domain
.
reboot
()
#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