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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
abd9852e
authored
Mar 08, 2023
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cache size
parent
d2275786
Hide 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 @
abd9852e
...
@@ -225,6 +225,7 @@ class VMDisk:
...
@@ -225,6 +225,7 @@ class VMDisk:
driver_type
=
None
driver_type
=
None
driver_cache
=
None
driver_cache
=
None
target_device
=
None
target_device
=
None
cache_size
=
None
def
__init__
(
self
,
def
__init__
(
self
,
name
,
name
,
...
@@ -235,7 +236,8 @@ class VMDisk:
...
@@ -235,7 +236,8 @@ class VMDisk:
driver_type
=
"qcow2"
,
driver_type
=
"qcow2"
,
driver_cache
=
"none"
,
driver_cache
=
"none"
,
target_device
=
"vda"
,
target_device
=
"vda"
,
target_bus
=
"virtio"
):
target_bus
=
"virtio"
,
cache_size
=
1024
):
self
.
name
=
name
self
.
name
=
name
self
.
source
=
source
self
.
source
=
source
self
.
disk_type
=
disk_type
self
.
disk_type
=
disk_type
...
@@ -245,6 +247,7 @@ class VMDisk:
...
@@ -245,6 +247,7 @@ class VMDisk:
self
.
driver_cache
=
driver_cache
self
.
driver_cache
=
driver_cache
self
.
target_device
=
target_device
self
.
target_device
=
target_device
self
.
target_bus
=
target_bus
self
.
target_bus
=
target_bus
self
.
cache_size
=
cache_size
@classmethod
@classmethod
def
deserialize
(
cls
,
desc
):
def
deserialize
(
cls
,
desc
):
...
@@ -259,11 +262,14 @@ class VMDisk:
...
@@ -259,11 +262,14 @@ class VMDisk:
ET
.
SubElement
(
xml_top
,
'target'
,
ET
.
SubElement
(
xml_top
,
'target'
,
attrib
=
{
'dev'
:
self
.
target_device
,
attrib
=
{
'dev'
:
self
.
target_device
,
'bus'
:
self
.
target_bus
})
'bus'
:
self
.
target_bus
})
ET
.
SubElement
(
xml_top
,
'driver'
,
driver
=
ET
.
SubElement
(
xml_top
,
'driver'
,
attrib
=
{
attrib
=
{
'name'
:
self
.
driver_name
,
'name'
:
self
.
driver_name
,
'type'
:
self
.
driver_type
,
'type'
:
self
.
driver_type
,
'cache'
:
self
.
driver_cache
})
'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
return
xml_top
def
dump_xml
(
self
):
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