diff mbox series

[3/3] runqemu: remove error parameter from acquire_taplock

Message ID GV1PR07MB9120D5A48A0D1AAEB78F9409A8992@GV1PR07MB9120.eurprd07.prod.outlook.com
State New
Headers show
Series [1/3] runqemu: keep generating tap devices | expand

Commit Message

Konrad Weihmann Sept. 9, 2024, 8:32 a.m. UTC
the error handling should be done on the return code by
the calling function, so creating an error within the function
does not make that much sense.

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
---
 scripts/runqemu | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index 14eb939b3e..006e60410f 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -226,17 +226,14 @@  class BaseConfig(object):
         self.guest_agent = False
         self.guest_agent_sockpath = '/tmp/qga.sock'
 
-    def acquire_taplock(self, error=True):
+    def acquire_taplock(self):
         logger.debug("Acquiring lockfile %s..." % self.taplock)
         try:
             self.taplock_descriptor = open(self.taplock, 'w')
             fcntl.flock(self.taplock_descriptor, fcntl.LOCK_EX|fcntl.LOCK_NB)
         except Exception as e:
             msg = "Acquiring lockfile %s failed: %s" % (self.taplock, e)
-            if error:
-                logger.error(msg)
-            else:
-                logger.info(msg)
+            logger.info(msg)
             if self.taplock_descriptor:
                 self.taplock_descriptor.close()
                 self.taplock_descriptor = None
@@ -1179,7 +1176,7 @@  to your build configuration.
                 logger.info('Found %s.skip, skipping %s' % (lockfile, p))
                 continue
             self.taplock = lockfile + '.lock'
-            if self.acquire_taplock(error=False):
+            if self.acquire_taplock():
                 tap = p
                 logger.info("Using preconfigured tap device %s" % tap)
                 logger.info("If this is not intended, touch %s.skip to make runqemu skip %s." %(lockfile, tap))