diff --git a/libqmpbackup/version.py b/libqmpbackup/version.py index d603e48..da6426d 100644 --- a/libqmpbackup/version.py +++ b/libqmpbackup/version.py @@ -11,4 +11,4 @@ the LICENSE file in the top-level directory. """ -VERSION = "0.44-noevent" +VERSION = "0.45-noevent" diff --git a/qmpbackup b/qmpbackup index 1020f71..3c43871 100755 --- a/qmpbackup +++ b/qmpbackup @@ -44,11 +44,13 @@ async def cancel_jobs(qmp, log): if limit >= retry: log.warning("Unable to stop all jobs within %s seconds.", retry) return + + jobs = await qmp.execute("query-block-jobs") + if len(jobs) == 0: + log.info("All jobs stopped") + return + for job in jobs: - jobs = await qmp.execute("query-block-jobs") - if len(jobs) == 0: - log.info("All jobs stopped") - return if job["type"] != "backup" or not job["device"].startswith("qmpbackup"): continue try: