From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwalK-0001jx-RC for qemu-devel@nongnu.org; Mon, 16 Jun 2014 13:32:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwalF-0001Jh-S9 for qemu-devel@nongnu.org; Mon, 16 Jun 2014 13:32:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwalF-0001JS-Jg for qemu-devel@nongnu.org; Mon, 16 Jun 2014 13:32:01 -0400 Message-ID: <539F2A0A.40401@redhat.com> Date: Mon, 16 Jun 2014 11:31:54 -0600 From: Eric Blake MIME-Version: 1.0 References: <1402888539-14961-1-git-send-email-quintela@redhat.com> <1402888539-14961-7-git-send-email-quintela@redhat.com> In-Reply-To: <1402888539-14961-7-git-send-email-quintela@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3hso05ELhNxWxDp0raulHk6Pp3hTfDJmc" Subject: Re: [Qemu-devel] [PATCH 6/6] migration: catch unknown flags in ram_load List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org Cc: Peter Lieven This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3hso05ELhNxWxDp0raulHk6Pp3hTfDJmc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/15/2014 09:15 PM, Juan Quintela wrote: > From: Peter Lieven >=20 > 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. This patch is a strict improvement, so I'm glad it went in. However, I still feel that we aren't doing a good job of silently ignoring unexpected combinations of flag bits, and had suggestions in the original thread on further followups that are worth having before the 2.1 release. > - > - if (flags & RAM_SAVE_FLAG_COMPRESS) { > + } else if (flags & RAM_SAVE_FLAG_COMPRESS) { > void *host; Among other things, switching from a chain of if-else to a switch might make it easier to document explicit supported combinations of flags and reject other values from an invalid stream. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3hso05ELhNxWxDp0raulHk6Pp3hTfDJmc 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/ iQEcBAEBCAAGBQJTnyoKAAoJEKeha0olJ0NqI1YH/RChYAeunx5yPLtO/fVcl7Bd WF8myBSudmul3XSiFbdPhpyx0Xmz367ribsaEnv8OXtX7lrV4sBumnMgudWedq32 +ekMBtMVMmQ1x8xbk7H00DRiaOB486IdWgMrPbmXx6AI/4oBUhQzcYDf8A7a23gt DReHPomx8G0ppH47uEM6ywRqHsF7FEJBRFYsh6lcGzYjk3z+nCu/Mj40rZiwwrra gZWPEIs5+/9OnZpWwloN3F/j6vD0i6/e8+MOWGfQD7RPniyZMxnpuWXzLJG7bc6w E0d2tIAXxyQOecqRNkheRGvBLcyrtMaKMSuCStA2P/YCfmy4WrElFjMIHyAgeGk= =Y4Tw -----END PGP SIGNATURE----- --3hso05ELhNxWxDp0raulHk6Pp3hTfDJmc--