doc/create_image

This commit is contained in:
Marc Beninca 2024-09-17 23:17:36 +02:00
parent 2c6bec253c
commit 0d77038392
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -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)),
) )