From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7E9H-0001XI-FV for qemu-devel@nongnu.org; Wed, 16 Nov 2016 23:18:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7E9E-0002RY-B2 for qemu-devel@nongnu.org; Wed, 16 Nov 2016 23:18:07 -0500 Received: from ozlabs.org ([103.22.144.67]:44155) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c7E9D-0002OX-HO for qemu-devel@nongnu.org; Wed, 16 Nov 2016 23:18:04 -0500 Date: Thu, 17 Nov 2016 14:45:11 +1100 From: David Gibson Message-ID: <20161117034511.GG18808@umbus.fritz.box> References: <1478265017-5700-1-git-send-email-thuth@redhat.com> <87wpg5di5o.fsf@emacs.mitica> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="df+09Je9rNq3P+GE" Content-Disposition: inline In-Reply-To: <87wpg5di5o.fsf@emacs.mitica> 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: Juan Quintela Cc: Thomas Huth , Amit Shah , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" --df+09Je9rNq3P+GE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 14, 2016 at 07:34:59PM +0100, Juan Quintela wrote: > 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 >=20 > Reviewed-by: Juan Quintela >=20 > Applied. >=20 > I don't know how we broked this so much. Note that block save iterate has the same bug... --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --df+09Je9rNq3P+GE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYLSfHAAoJEGw4ysog2bOSCUwP/AiTfC6AmJ/OYeTfrYfE17IA J2o2LPtoxixL2haSJEAfXIyyQs7ynOHwOMttSzvbDrMm7f06NNjxe+TsFJkz8rzK 79leVcp6ls0Tq0JJ24+7l05+fgh8e4MO0D1fDvHfKng9ffY1GPHC/mgUJ6d2DU5Q ffMspwr90ISGdle+/dvnIQVqUuQgsDpxdrenHJJyVAGh2n1vORfoiI83d3F92gbJ kZFq8Pml0zvwHzNNmL/jgTvleUDNNWAXIdXeT05sF2e6yXuTVoy5gj3F2rvx/fTM amkDjA2Fxmbc6V8thBvK6yWo3iZ4YH7pBgI3mSDDWv5wJnqzHeN8djoioNUQU7y0 7mrDz9w+QqtJl2GAQxOhmPV9yeLJ4d1H6lSI6AJfQtlx8hSS5Ijf+1yg94HyYZ5a hXbY39zGHo7RYRXhsjP3wscmrk8yaRKYPA+XQ/lNag5UnaK4mHKjlQELFx/VgiQA yP9LKCImEJL2ArgtRab5kOLF4bT/qz8WS7ubp/O+Kf5fOCsNq24EZIglu+UzLGgB BRU+VlgAikHINYK4/X+DQUipHsl2zLgO8WF6lPVvZyAPQkqyjNEADzXPG6lEJwVL ti5587ofQmYeQ+1VzwD4t2iUpBzte+Q9iW4B4DSkS7Fk0x8iJauoIqElEizbobhO JZkhGaZQb8NootoCbAgm =kY+B -----END PGP SIGNATURE----- --df+09Je9rNq3P+GE--