git.annexia.org
/
libguestfs-talks.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add way to scale whole document.
[libguestfs-talks.git]
/
2012-fosdem
/
600.d
/
prepopulate.py
diff --git
a/2012-fosdem/600.d/prepopulate.py
b/2012-fosdem/600.d/prepopulate.py
index
9e528e8
..
510beab
100755
(executable)
--- a/
2012-fosdem/600.d/prepopulate.py
+++ b/
2012-fosdem/600.d/prepopulate.py
@@
-6,12
+6,10
@@
import guestfs
input = "libguestfs-1.16.2.tar.gz"
output = "disk.img"
input = "libguestfs-1.16.2.tar.gz"
output = "disk.img"
-g = guestfs.GuestFS ()
-
-f = open (output, "w")
-f.truncate (512 * 1024 * 1024)
-f.close ()
+os.system ("qemu-img create -f raw %s 512M >/dev/null 2>&1" %
+ output)
+g = guestfs.GuestFS ()
g.add_drive_opts (output, format = "raw", readonly = 0)
g.launch ()
g.add_drive_opts (output, format = "raw", readonly = 0)
g.launch ()