alpy.run¶
This module contains high-level functions for connecting QEMU process with a network skeleton.
- alpy.run.qemu_with_skeleton(*, qemu_args, skeleton, timeout)[source]¶
Context manager for QEMU and network skeleton.
On entering context the manager creates tap interfaces and starts QEMU. QEMU connects to tap interfaces. Then network nodes are created and the interfaces are moved to the node namespaces. On exiting the context QEMU process is stopped and network skeleton is destroyed.
- Parameters:
QEMU command line arguments. The arguments must include arguments returned by
alpy.qemu.get_qmp_args()
and byalpy.qemu.get_network_interfaces_args()
.Note
Tap interfaces names in QEMU args must match network skeleton tap interfaces names.
skeleton (
alpy.node.Skeleton
) – network skeletontimeout (int) – number of seconds to wait for QEMU to stop after issuing the quit QMP command
- Returns:
QMP handle
- Return type:
QEMUMonitorProtocol