From patchwork Wed Dec 9 21:10:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Farmer X-Patchwork-Id: 40762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DEFE4B6F07 for ; Thu, 10 Dec 2009 08:10:59 +1100 (EST) Received: from localhost ([127.0.0.1]:55292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIToF-0005YG-Ue for incoming@patchwork.ozlabs.org; Wed, 09 Dec 2009 16:10:55 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NITnm-0005XN-Lp for qemu-devel@nongnu.org; Wed, 09 Dec 2009 16:10:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NITni-0005WP-1q for qemu-devel@nongnu.org; Wed, 09 Dec 2009 16:10:26 -0500 Received: from [199.232.76.173] (port=36972 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NITnh-0005WM-Vn for qemu-devel@nongnu.org; Wed, 09 Dec 2009 16:10:22 -0500 Received: from mail.hq.newdream.net ([66.33.206.127]:46634) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NITnh-0007Ly-5n for qemu-devel@nongnu.org; Wed, 09 Dec 2009 16:10:21 -0500 Received: from [10.3.69.59] (dsl081-243-128.sfo1.dsl.speakeasy.net [64.81.243.128]) by mail.hq.newdream.net (Postfix) with ESMTP id 348DF26100 for ; Wed, 9 Dec 2009 13:10:19 -0800 (PST) From: Andrew Farmer Date: Wed, 9 Dec 2009 13:10:18 -0800 Message-Id: <8994198D-0AA5-45C0-8A46-375BCA34E201@hq.newdream.net> To: qemu-devel@nongnu.org Mime-Version: 1.0 (Apple Message framework v1077) X-Mailer: Apple Mail (2.1077) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [Qemu-devel] RFC: exit on incoming exec migrate failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Right now, if an incoming migrate through exec fails, the qemu process will end up chewing CPU indefinitely - it looks like it closes the migration FD but doesn't remove its IO handler properly. An easy way to reproduce this is to try launching with -incoming exec:/bin/false. This is obviously useless, but illustrates the issue handily. One solution might be to retry the command on migrate failure, but that won't really help in all circumstances (for instance, if the migration command is broken!), so it seems equally appropriate to just die if an incoming exec migration fails. The patch is trivial, and follows - does this look sensible? (I'm new to qemu development, but trying to pick it up.) diff --git a/migration-exec.c b/migration-exec.c index c830669..0292c19 100644 --- a/migration-exec.c +++ b/migration-exec.c @@ -114,7 +114,7 @@ static void exec_accept_incoming_migration(void *opaque) ret = qemu_loadvm_state(f); if (ret < 0) { fprintf(stderr, "load of migration failed\n"); - goto err; + exit(0); } qemu_announce_self(); dprintf("successfully loaded vm state\n"); @@ -123,7 +123,6 @@ static void exec_accept_incoming_migration(void *opaque) if (autostart) vm_start(); -err: qemu_fclose(f); }