From 546ac24b93bcc80a691b17d8bddb88002c399558 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Tue, 29 Oct 2024 11:01:18 +0200 Subject: msd reset now leads to inotify restart --- kvmd/plugins/msd/otg/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'kvmd/plugins') 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 -- cgit v1.2.3