Libvirt: Use tpool to invoke guestfs api

In inspect_capabilities() of nova/virt/disk/vfs/guestfs.py, guestfs api, which
is C-extension, will hang nova-compute process when it is invoked. This problem
will result in message queue timeout error and instance booting failure. Need
to use tpool to invoke guestfs api, in order to make nova-compute switch to
other green threads before guestfs api returns.

Change-Id: I24187ba01965fb886351b78eee605bc052a94e21
Closes-Bug: 1453666
This commit is contained in:
Qin Zhao 2015-05-11 15:01:38 +08:00
parent 5bd31c9583
commit da9671aa7f
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ class VFSGuestFS(vfs.VFS):
def inspect_capabilities(self):
"""Determines whether guestfs is well configured."""
try:
g = guestfs.GuestFS()
g = tpool.Proxy(guestfs.GuestFS())
g.add_drive("/dev/null") # sic
g.launch()
except Exception as e: