Skip to content

Commit

Permalink
Fix: Properties were initialized with a global object
Browse files Browse the repository at this point in the history
  • Loading branch information
hoh committed Apr 9, 2024
1 parent 7e11125 commit ceecc10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/aleph/vm/hypervisors/qemu/qemuvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class QemuVM:
mem_size_mb: int
interface_name: str
qemu_process = None
log_queues: list[asyncio.Queue]

def __repr__(self) -> str:
if self.qemu_process:
Expand All @@ -37,6 +38,7 @@ def __init__(self, config: QemuVMConfiguration):
self.vcpu_count = config.vcpu_count
self.mem_size_mb = config.mem_size_mb
self.interface_name = config.interface_name
self.log_queues = []

def prepare_start(self):
pass
Expand Down Expand Up @@ -94,8 +96,6 @@ async def start(
logger.debug(f"started qemu vm {self}, {proc}")
return proc

log_queues: list[asyncio.Queue] = []

# TODO : convert when merging with log fixing branch
async def _process_stderr(self):
while not self.qemu_process:
Expand Down
3 changes: 2 additions & 1 deletion src/aleph/vm/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class VmPool:

counter: int # Used to provide distinct ids to network interfaces
executions: dict[ItemHash, VmExecution]
message_cache: dict[str, ExecutableMessage] = {}
message_cache: dict[str, ExecutableMessage]
network: Optional[Network]
snapshot_manager: Optional[SnapshotManager] = None
systemd_manager: SystemDManager
Expand All @@ -48,6 +48,7 @@ class VmPool:
def __init__(self, loop: asyncio.AbstractEventLoop):
self.counter = settings.START_ID_INDEX
self.executions = {}
self.message_cache = {}

asyncio.set_event_loop(loop)
self.creation_lock = asyncio.Lock()
Expand Down

0 comments on commit ceecc10

Please sign in to comment.