From da9671aa7f597d3dd2cd6d09bb06998b209c962a Mon Sep 17 00:00:00 2001 From: Qin Zhao Date: Mon, 11 May 2015 15:01:38 +0800 Subject: [PATCH] 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 --- nova/virt/disk/vfs/guestfs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/virt/disk/vfs/guestfs.py b/nova/virt/disk/vfs/guestfs.py index 71a40d7a9b03..37a9cfa88abd 100644 --- a/nova/virt/disk/vfs/guestfs.py +++ b/nova/virt/disk/vfs/guestfs.py @@ -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: