From patchwork Tue Apr 16 21:50:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 237115 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 983902C00FB for ; Wed, 17 Apr 2013 07:51:12 +1000 (EST) Received: from localhost ([::1]:52622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USDmQ-0004dV-Ud for incoming@patchwork.ozlabs.org; Tue, 16 Apr 2013 17:51:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USDm5-0004dL-AD for qemu-devel@nongnu.org; Tue, 16 Apr 2013 17:50:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USDm3-0008B2-RZ for qemu-devel@nongnu.org; Tue, 16 Apr 2013 17:50:49 -0400 Received: from qmta01.emeryville.ca.mail.comcast.net ([2001:558:fe2d:43:76:96:30:16]:34721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USDm3-0008Ap-GE for qemu-devel@nongnu.org; Tue, 16 Apr 2013 17:50:47 -0400 Received: from omta23.emeryville.ca.mail.comcast.net ([76.96.30.90]) by qmta01.emeryville.ca.mail.comcast.net with comcast id QcEN1l0071wfjNsA1lqmui; Tue, 16 Apr 2013 21:50:46 +0000 Received: from red.redhat.com ([24.10.251.25]) by omta23.emeryville.ca.mail.comcast.net with comcast id Qlqh1l00k0ZdyUg8jlqkNL; Tue, 16 Apr 2013 21:50:45 +0000 From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 16 Apr 2013 15:50:41 -0600 Message-Id: <1366149041-626-1-git-send-email-eblake@redhat.com> X-Mailer: git-send-email 1.8.1.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366149046; bh=LqP6IFLgXbjpCvfY8TD/21voitWoh0IGhy8y9KXWSFE=; h=Received:Received:From:To:Subject:Date:Message-Id; b=l4YjlfLkKIugnmCGvDUMrsuLI6mn/f6MeEafnTQS7JvZi1fYrZQ/NTCl26stzA26/ 06h4QYo8d3eNEXyRRN/Z1OAmY0lwObXvxg0wI1tMVopYKPrqnW0XlTGyrQkqUX4FNh XZ+bV6uEUH4yd/um4EvDDxjN6WDYeOWRsFJAsEb0rrQSlVrCNOtw4Dzx6PpKMEQlpr fe1N61F1uACTV0LG2F2nHbhVQNC3K6F0+x+CUJb9DYzqk+xIy3IKEcO+VhbqJaF+NW hSCciqRYdRk6ej/RPIZ+jJy96pSyKnbMfLTbpmn4SRfnoExSgw44CrvcZeadq08BNQ 19pUBO9Dr+JIA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:558:fe2d:43:76:96:30:16 Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, phrdina@redhat.com, quintela@redhat.com Subject: [Qemu-devel] [PATCH] migration: reflect incoming failure to shell 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 Management apps like libvirt don't know to pay attention to stderr unless there is a non-zero exit status. * migration.c (process_incoming_migration_co): Exit with non-zero status on failure. Signed-off-by: Eric Blake Reviewed-by: Anthony Liguori --- Noticed while reviewing: https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg03293.html and it seems blatant enough to fix now, rather than waiting for Pavel's series to stabilize. Side note: libvirt explicitly forbids all use of exit({0,1}), and instead encourages exit(EXIT_{SUCCESS,FAILURE}), precisely because it makes it harder to slip in unintentional successful exits. migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration.c b/migration.c index 3b4b467..3eb0fad 100644 --- a/migration.c +++ b/migration.c @@ -99,7 +99,7 @@ static void process_incoming_migration_co(void *opaque) qemu_fclose(f); if (ret < 0) { fprintf(stderr, "load of migration failed\n"); - exit(0); + exit(EXIT_FAILURE); } qemu_announce_self(); DPRINTF("successfully loaded vm state\n");