Skip to content

Commit

Permalink
Remove unused methods from blktap2.TapCtl
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Syms <mark.syms@citrix.com>
  • Loading branch information
MarkSymsCtx committed Jun 1, 2020
1 parent f434164 commit d527dbc
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions drivers/blktap2.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,55 +193,6 @@ def _mkcmd(cls, args):

return __next_mkcmd(args)

@classmethod
def failwith(cls, status, prev=False):
"""
Fail next invocation with @status. If @prev is true, execute
the original command
"""

__prev_mkcmd = cls.__next_mkcmd

@classmethod
def __mkcmd(cls, args):
if prev:
cmd = __prev_mkcmd(args)
cmd = "'%s' && exit %d" % ("' '".join(cmd), status)
else:
cmd = "exit %d" % status

return [ '/bin/sh', '-c', cmd ]

cls.__next_mkcmd = __mkcmd

__strace_n = 0

@classmethod
def strace(cls):
"""
Run next invocation through strace.
Output goes to /tmp/tap-ctl.<sm-pid>.<n>; <n> counts invocations.
"""

__prev_mkcmd = cls.__next_mkcmd

@classmethod
def __next_mkcmd(cls, args):

# pylint: disable = E1101

cmd = __prev_mkcmd(args)

tracefile = "/tmp/%s.%d.%d" % (os.path.basename(cls.PATH),
os.getpid(),
cls.__strace_n)
cls.__strace_n += 1

return \
[ '/usr/bin/strace', '-o', tracefile, '--'] + cmd

cls.__next_mkcmd = __next_mkcmd

@classmethod
def _call(cls, args, quiet = False, input = None):
"""
Expand Down

0 comments on commit d527dbc

Please sign in to comment.