mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
inspection: filter libguestfs VMs earlier
No need to do any job for them, so skip processing them altogether when a new one is added.
This commit is contained in:
parent
d2ca54fce4
commit
67ed3e86df
@ -20,7 +20,6 @@
|
||||
from Queue import Queue
|
||||
from threading import Thread
|
||||
import logging
|
||||
import re
|
||||
|
||||
from guestfs import GuestFS # pylint: disable=import-error
|
||||
|
||||
@ -64,6 +63,11 @@ class vmmInspection(vmmGObject):
|
||||
|
||||
# Called by the main thread whenever a VM is added to vmlist.
|
||||
def vm_added(self, conn, connkey):
|
||||
if connkey.startswith("guestfs-"):
|
||||
logging.debug("ignore libvirt/guestfs temporary VM %s",
|
||||
connkey)
|
||||
return
|
||||
|
||||
obj = ("vm_added", conn.get_uri(), connkey)
|
||||
self._q.put(obj)
|
||||
|
||||
@ -154,11 +158,6 @@ class vmmInspection(vmmGObject):
|
||||
logging.exception("%s: exception while processing", prettyvm)
|
||||
|
||||
def _inspect_vm(self, conn, vm):
|
||||
if re.search(r"^guestfs-", vm.get_name()):
|
||||
logging.debug("ignore libvirt/guestfs temporary VM %s",
|
||||
vm.get_name())
|
||||
return None
|
||||
|
||||
g = GuestFS(close_on_exit=False)
|
||||
prettyvm = conn.get_uri() + ":" + vm.get_name()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user