From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuLas-0007ow-Mc for qemu-devel@nongnu.org; Tue, 10 Jun 2014 08:56:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuLaj-0006BB-6E for qemu-devel@nongnu.org; Tue, 10 Jun 2014 08:56:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuLai-0006Ak-T5 for qemu-devel@nongnu.org; Tue, 10 Jun 2014 08:55:53 -0400 Message-ID: <53970052.4040402@redhat.com> Date: Tue, 10 Jun 2014 06:55:46 -0600 From: Eric Blake MIME-Version: 1.0 References: <1402392556-21844-1-git-send-email-pl@kamp.de> In-Reply-To: <1402392556-21844-1-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s3vS0CpJESkQw7dj2kmItL2pkfxH79QKA" Subject: Re: [Qemu-devel] [PATCHv4] migration: catch unknown flags in ram_load List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, pbonzini@redhat.com, dgilbert@redhat.com, quintela@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --s3vS0CpJESkQw7dj2kmItL2pkfxH79QKA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/10/2014 03:29 AM, Peter Lieven wrote: > if a saved vm has unknown flags in the memory data qemu > currently simply ignores this flag and continues which > yields in an unpredictable result. >=20 > This patch catches all unknown flags and aborts the > loading of the vm. Additionally error reports are thrown > if the migration aborts abnormally. >=20 > Signed-off-by: Peter Lieven > --- > + while (!ret) { > addr =3D qemu_get_be64(f); > =20 > flags =3D addr & ~TARGET_PAGE_MASK; > - > - if (flags & RAM_SAVE_FLAG_COMPRESS) { > + } else if (flags & RAM_SAVE_FLAG_COMPRESS) { > void *host; > } else if (flags & RAM_SAVE_FLAG_XBZRLE) { > } else if (flags & RAM_SAVE_FLAG_HOOK) { > ram_control_load_hook(f, flags); > + } else if (flags & RAM_SAVE_FLAG_EOS) { Umm, is the migration format specifically documented as having at most one flag per operation, or is it valid to send two flags at once? That is, can I send RAM_SAVE_FLAG_XBZRLE | RAM_SAVE_FLAG_HOOK on a single packet? Should we be flagging streams that send unexpected flag combinations as invalid, even when each flag is in isolation okay, rather than the current behavior of silently prioritizing one flag and ignoring the other? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --s3vS0CpJESkQw7dj2kmItL2pkfxH79QKA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTlwBSAAoJEKeha0olJ0Nq+mcH/1IdREYMmOde21UQzId2jLmh EZA/lAO3oY6V32mqi+iAMIk7AZDJ3G4Z9rUyPZmtYJnT0f3A6X2EdIuLxZSDcJDt Fq4fidAVG1QOlhd/M3JBa4kZnm3i2Ou0E+jvI5M6qtu091pD2c1bWpVQVRQjP/Bg Zql/u7QFkLmG6+d/pP80LwYV58PaLvQcWFYak0cGNV5At4Z8r0zdwiKAh7DmnKwH KECY4kjD927gQOod4aTOsJr/UiD9yJEY1YAjEOjbxuKQVlQrP8Q0KjIFKnpQGSMM lMYU4y3PSdzgX4NTP0PI2GUrzcCVh5/qACMDCmS0h2Te+fKey/zaVzq9RZHf57s= =ebMp -----END PGP SIGNATURE----- --s3vS0CpJESkQw7dj2kmItL2pkfxH79QKA--