From patchwork Mon Nov 12 12:23:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 198385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 04AE62C0082 for ; Mon, 12 Nov 2012 23:23:59 +1100 (EST) Received: from localhost ([::1]:47813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXt3T-0003Hg-9n for incoming@patchwork.ozlabs.org; Mon, 12 Nov 2012 07:23:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXt3H-0003HK-Fs for qemu-devel@nongnu.org; Mon, 12 Nov 2012 07:23:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXt3E-00038g-Cm for qemu-devel@nongnu.org; Mon, 12 Nov 2012 07:23:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXt3E-00038T-54 for qemu-devel@nongnu.org; Mon, 12 Nov 2012 07:23:40 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qACCNdjw007902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Nov 2012 07:23:39 -0500 Received: from dhcp-5-188.str.redhat.com (vpn1-5-133.ams2.redhat.com [10.36.5.133]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qACCNbNn024473; Mon, 12 Nov 2012 07:23:37 -0500 From: Kevin Wolf To: pbonzini@redhat.com Date: Mon, 12 Nov 2012 13:23:35 +0100 Message-Id: <1352723015-13007-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] qemu-nbd: Initialise main loop earlier X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since the latest AIO changes qemu-nbd would segfault because bdrv_init() requires qemu_aio_context to be initialised. Signed-off-by: Kevin Wolf --- qemu-nbd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 15bcd08..80f08d8 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -539,6 +539,7 @@ int main(int argc, char **argv) snprintf(sockpath, 128, SOCKET_PATH, basename(device)); } + qemu_init_main_loop(); bdrv_init(); atexit(bdrv_close_all); @@ -584,7 +585,6 @@ int main(int argc, char **argv) memset(&client_thread, 0, sizeof(client_thread)); } - qemu_init_main_loop(); qemu_set_fd_handler2(fd, nbd_can_accept, nbd_accept, NULL, (void *)(uintptr_t)fd);