Skip to content

Commit

Permalink
tests: fix already registered event impl
Browse files Browse the repository at this point in the history
(cherry picked from commit 40156c3)
  • Loading branch information
fepitre authored and marmarek committed Apr 18, 2020
1 parent 45be017 commit 3913c9e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions qubes/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@

if in_dom0:
import libvirtaio
libvirt_event_impl = libvirtaio.virEventRegisterAsyncIOImpl()
else:
libvirt_event_impl = None

libvirt_event_impl = None

try:
in_git = subprocess.check_output(
Expand Down Expand Up @@ -396,6 +395,10 @@ def __init__(self, *args, **kwargs):

self.loop = None

global libvirt_event_impl

if in_dom0 and not libvirt_event_impl:
libvirt_event_impl = libvirtaio.virEventRegisterAsyncIOImpl()

def __str__(self):
return '{}/{}/{}'.format(
Expand Down

0 comments on commit 3913c9e

Please sign in to comment.