Received: from eggs.gnu.org ([2001:4830:134:3::10]:41614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQzEf-00013u-P9 for qemu-devel@nongnu.org; Thu, 26 Feb 2015 09:16:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQzEY-0002a8-JB for qemu-devel@nongnu.org; Thu, 26 Feb 2015 09:16:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQzEY-0002Yz-CQ for qemu-devel@nongnu.org; Thu, 26 Feb 2015 09:16:10 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1QEG9lh024952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 26 Feb 2015 09:16:09 -0500 From: "Dr. David Alan Gilbert (git)" Date: Thu, 26 Feb 2015 14:16:06 +0000 Message-Id: <1424960166-15317-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH] Avoid crashing on multiple -incoming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, armbru@redhat.com, quintela@redhat.com From: "Dr. David Alan Gilbert" Passing multiple -incoming options used to crash qemu (due to an invalid state transition incoming->incoming). Instead we now take the last -incoming option, e.g.: qemu-system-x86_64 -nographic -incoming tcp::4444 -incoming defer ends up doing the defer. Signed-off-by: Dr. David Alan Gilbert --- vl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index e1ffd0a..aefc66d 100644 --- a/vl.c +++ b/vl.c @@ -3610,8 +3610,10 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_incoming: + if (!incoming) { + runstate_set(RUN_STATE_INMIGRATE); + } incoming = optarg; - runstate_set(RUN_STATE_INMIGRATE); break; case QEMU_OPTION_nodefaults: has_defaults = 0; -- 2.1.0