diff options
Diffstat (limited to 'kvmd/plugins/msd/relay/drive.py')
-rw-r--r-- | kvmd/plugins/msd/relay/drive.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/kvmd/plugins/msd/relay/drive.py b/kvmd/plugins/msd/relay/drive.py index e9b9f681..a85b3fa2 100644 --- a/kvmd/plugins/msd/relay/drive.py +++ b/kvmd/plugins/msd/relay/drive.py @@ -29,11 +29,11 @@ import dataclasses from typing import IO from typing import Optional -import aiofiles.base - from .... import aiotools from .... import aiofs +from .. import MsdImageWriter + # ===== _IMAGE_INFO_SIZE = 4096 @@ -121,11 +121,10 @@ class DeviceInfo: image=image_info, ) - async def write_image_info( - self, - device_file: aiofiles.base.AiofilesContextManager, - image_info: ImageInfo, - ) -> bool: + async def write_image_info(self, device_writer: MsdImageWriter, complete: bool) -> bool: + device_file = device_writer.get_file() + state = device_writer.get_state() + image_info = ImageInfo(state["name"], state["written"], complete) if self.size - image_info.size > _IMAGE_INFO_SIZE: await device_file.seek(self.size - _IMAGE_INFO_SIZE) # type: ignore |