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
9d54db9e
authored
Jul 17, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cpu topology (default 1 socket and vcpu cores)
moved raw_data to the first row (can overdefine topology now)
parent
9e8a6109
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
vm.py
+9
-3
No files found.
vm.py
View file @
9d54db9e
...
...
@@ -91,9 +91,18 @@ class VMInstance:
attrib
=
{
'type'
:
self
.
vm_type
})
# Building raw data into xml
if
self
.
raw_data
:
xml_top
.
append
(
ET
.
fromstring
(
self
.
raw_data
))
# Basic virtual machine paramaters
ET
.
SubElement
(
xml_top
,
'name'
)
.
text
=
self
.
name
ET
.
SubElement
(
xml_top
,
'vcpu'
)
.
text
=
str
(
self
.
vcpu
)
cpu
=
ET
.
SubElement
(
xml_top
,
'cpu'
)
ET
.
SubElement
(
cpu
,
'topology'
,
attrib
=
{
'sockets'
:
str
(
1
),
'cores'
:
str
(
self
.
vcpu
),
'threads'
:
str
(
1
)})
ET
.
SubElement
(
xml_top
,
'memory'
)
.
text
=
str
(
self
.
memory_max
)
ET
.
SubElement
(
xml_top
,
'currentMemory'
)
.
text
=
str
(
self
.
memory
)
# Cpu tune
...
...
@@ -143,9 +152,6 @@ class VMInstance:
features
=
ET
.
SubElement
(
xml_top
,
'features'
)
if
self
.
acpi
:
ET
.
SubElement
(
features
,
'acpi'
)
# Building raw data into xml
if
self
.
raw_data
:
xml_top
.
append
(
ET
.
fromstring
(
self
.
raw_data
))
# Security label
ET
.
SubElement
(
xml_top
,
'seclabel'
,
attrib
=
{
'type'
:
self
.
seclabel_type
,
...
...
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