doc/create_image
This commit is contained in:
parent
2c6bec253c
commit
0d77038392
1 changed files with 9 additions and 3 deletions
|
@ -9,12 +9,18 @@ from rwx import ps
|
||||||
CHARSET = "UTF-8"
|
CHARSET = "UTF-8"
|
||||||
|
|
||||||
|
|
||||||
def create_image(file_path: str, size_bytes: int) -> None:
|
def create_image(file_path: Path, size_bytes: int) -> None:
|
||||||
"""Create a virtual device image file."""
|
"""Create a virtual device image file.
|
||||||
|
|
||||||
|
:param file_path: target image file
|
||||||
|
:type file_path: Path
|
||||||
|
:param size_bytes: virtual volume
|
||||||
|
:type size_bytes: int
|
||||||
|
"""
|
||||||
ps.run(
|
ps.run(
|
||||||
("qemu-img", "create"),
|
("qemu-img", "create"),
|
||||||
("-f", "qcow2"),
|
("-f", "qcow2"),
|
||||||
(file_path, str(size_bytes)),
|
(str(file_path), str(size_bytes)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue