summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2024-10-29 11:01:18 +0200
committerMaxim Devaev <[email protected]>2024-10-29 11:01:18 +0200
commit546ac24b93bcc80a691b17d8bddb88002c399558 (patch)
treec988ec7f81f7fdc5171d11a3e6bd9ca3d8bfc18f
parent2195acf2ff8fdd9857db8a8b317b5fb98f4bacb7 (diff)
msd reset now leads to inotify restart
-rw-r--r--kvmd/plugins/msd/otg/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py
index 93eacbc7..b0a2d2ac 100644
--- a/kvmd/plugins/msd/otg/__init__.py
+++ b/kvmd/plugins/msd/otg/__init__.py
@@ -141,6 +141,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
self.__notifier = aiotools.AioNotifier()
self.__state = _State(self.__notifier)
+ self.__reset = False
logger = get_logger(0)
logger.info("Using OTG gadget %r as MSD", gadget)
@@ -219,6 +220,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
async def reset(self) -> None:
async with self.__state.busy(check_online=False):
try:
+ self.__reset = True
self.__drive.set_image_path("")
self.__drive.set_cdrom_flag(False)
self.__drive.set_rw_flag(False)
@@ -450,7 +452,8 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
await self.__reload_state()
while self.__state.vd: # Если живы после предыдущей проверки
- need_restart = False
+ need_restart = self.__reset
+ self.__reset = False
need_reload_state = False
for event in (await inotify.get_series(timeout=1)):
need_reload_state = True