Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f95aa746
authored
Mar 08, 2023
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotcpu-add' into 'master'
add cache size See merge request
!5
parents
be7dc743
abd9852e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
vm.py
+8
-2
No files found.
vm.py
View file @
f95aa746
...
...
@@ -225,6 +225,7 @@ class VMDisk:
driver_type
=
None
driver_cache
=
None
target_device
=
None
cache_size
=
None
def
__init__
(
self
,
name
,
...
...
@@ -235,7 +236,8 @@ class VMDisk:
driver_type
=
"qcow2"
,
driver_cache
=
"none"
,
target_device
=
"vda"
,
target_bus
=
"virtio"
):
target_bus
=
"virtio"
,
cache_size
=
1024
):
self
.
name
=
name
self
.
source
=
source
self
.
disk_type
=
disk_type
...
...
@@ -245,6 +247,7 @@ class VMDisk:
self
.
driver_cache
=
driver_cache
self
.
target_device
=
target_device
self
.
target_bus
=
target_bus
self
.
cache_size
=
cache_size
@classmethod
def
deserialize
(
cls
,
desc
):
...
...
@@ -259,11 +262,14 @@ class VMDisk:
ET
.
SubElement
(
xml_top
,
'target'
,
attrib
=
{
'dev'
:
self
.
target_device
,
'bus'
:
self
.
target_bus
})
ET
.
SubElement
(
xml_top
,
'driver'
,
driver
=
ET
.
SubElement
(
xml_top
,
'driver'
,
attrib
=
{
'name'
:
self
.
driver_name
,
'type'
:
self
.
driver_type
,
'cache'
:
self
.
driver_cache
})
metadata_cache
=
ET
.
SubElement
(
driver
,
'metadata_cache'
)
ET
.
SubElement
(
metadata_cache
,
'max_size'
,
attrib
=
{
'unit'
:
'bytes'
})
.
text
=
str
(
self
.
cache_size
)
return
xml_top
def
dump_xml
(
self
):
...
...
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