Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
0333d3db
Commit
0333d3db
authored
10 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
qcow2size(): use qemu-image instead of file
file no longer returns image size on 14.04 fixes #373
parent
f2458d1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
util/vm/build.py
+6
-3
6 additions, 3 deletions
util/vm/build.py
with
6 additions
and
3 deletions
util/vm/build.py
+
6
−
3
View file @
0333d3db
...
@@ -728,9 +728,12 @@ def generateOVF( name, osname, osid, diskname, disksize, mem=1024, cpus=1,
...
@@ -728,9 +728,12 @@ def generateOVF( name, osname, osid, diskname, disksize, mem=1024, cpus=1,
def
qcow2size
(
qcow2
):
def
qcow2size
(
qcow2
):
"
Return virtual disk size (in bytes) of qcow2 image
"
"
Return virtual disk size (in bytes) of qcow2 image
"
output
=
check_output
(
[
'
file
'
,
qcow2
]
)
output
=
check_output
(
[
'
qemu-img
'
,
'
info
'
,
qcow2
]
)
assert
'
QCOW
'
in
output
try
:
bytes
=
int
(
re
.
findall
(
'
(\d+) bytes
'
,
output
)[
0
]
)
assert
'
format: qcow
'
in
output
bytes
=
int
(
re
.
findall
(
'
(\d+) bytes
'
,
output
)[
0
]
)
except
:
raise
Exception
(
'
Could not determine size of %s
'
%
qcow2
)
return
bytes
return
bytes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment