From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6M61-0005jX-7E for qemu-devel@nongnu.org; Mon, 14 Nov 2016 13:35:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6M5y-0000w3-2X for qemu-devel@nongnu.org; Mon, 14 Nov 2016 13:35:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45128) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6M5x-0000vz-TS for qemu-devel@nongnu.org; Mon, 14 Nov 2016 13:35:06 -0500 From: Juan Quintela In-Reply-To: <1478265017-5700-1-git-send-email-thuth@redhat.com> (Thomas Huth's message of "Fri, 4 Nov 2016 14:10:17 +0100") References: <1478265017-5700-1-git-send-email-thuth@redhat.com> Reply-To: quintela@redhat.com Date: Mon, 14 Nov 2016 19:34:59 +0100 Message-ID: <87wpg5di5o.fsf@emacs.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH for-2.8] migration: Fix return code of ram_save_iterate() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: Amit Shah , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , David Gibson Thomas Huth wrote: > qemu_savevm_state_iterate() expects the iterators to return 1 > when they are done, and 0 if there is still something left to do. > However, ram_save_iterate() does not obey this rule and returns > the number of saved pages instead. This causes a fatal hang with > ppc64 guests when you run QEMU like this (also works with TCG): > > qemu-img create -f qcow2 /tmp/test.qcow2 1M > qemu-system-ppc64 -nographic -nodefaults -m 256 \ > -hda /tmp/test.qcow2 -serial mon:stdio > > ... then switch to the monitor by pressing CTRL-a c and try to > save a snapshot with "savevm test1" for example. > > After the first iteration, ram_save_iterate() always returns 0 here, > so that qemu_savevm_state_iterate() hangs in an endless loop and you > can only "kill -9" the QEMU process. > Fix it by using proper return values in ram_save_iterate(). > > Signed-off-by: Thomas Huth Reviewed-by: Juan Quintela Applied. I don't know how we broked this so much. Thanks, Juan.