Received: from eggs.gnu.org ([2001:4830:134:3::10]:43785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfBxg-00037Q-Ih for qemu-devel@nongnu.org; Wed, 31 Aug 2016 16:18:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfBxb-0004ha-H4 for qemu-devel@nongnu.org; Wed, 31 Aug 2016 16:18:16 -0400 From: Eduardo Habkost Date: Wed, 31 Aug 2016 17:17:10 -0300 Message-Id: <1472674630-18886-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH] vl: Delay initialization of memory backends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Paolo Bonzini Cc: mprivozn@redhat.com, Bandan Das , qemu-stable@nongnu.org, "Daniel P. Berrange" Initialization of memory backends may take a while when prealloc=yes is used, depending on their size. Initializing memory backends before chardevs may delay the creation of monitor sockets, and trigger timeouts on management software that waits until the monitor socket is created by QEMU. See, for example, the bug report at: https://bugzilla.redhat.com/show_bug.cgi?id=1371211 This patch fixes the problem by adding "memory-backend-*" classes to the delayed-initialization list. I believe a more appropriate fix would be creating objects and chardevs in the same ordering specified on the command-line, but this patch should fix the bug until we figure out a better way. Signed-off-by: Eduardo Habkost --- vl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vl.c b/vl.c index b3c80d5..7764032 100644 --- a/vl.c +++ b/vl.c @@ -2810,6 +2810,15 @@ static bool object_create_initial(const char *type) return false; } + /* Initialization of memory backends may delay chardev + * initialization for too long, and trigger timeouts on + * software that waits for a monitor socket to be created + * (e.g. libvirt). + */ + if (g_str_has_prefix(type, "memory-backend-")) { + return false; + } + return true; } -- 2.7.4