From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEgbe-0003W6-45 for qemu-devel@nongnu.org; Sun, 10 Mar 2013 09:48:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEgbb-0001TM-9v for qemu-devel@nongnu.org; Sun, 10 Mar 2013 09:48:06 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:36519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEgbb-0001T9-2g for qemu-devel@nongnu.org; Sun, 10 Mar 2013 09:48:03 -0400 Received: by mail-lb0-f174.google.com with SMTP id l12so2481370lbo.19 for ; Sun, 10 Mar 2013 06:48:01 -0700 (PDT) From: Igor Mitsyanko Date: Sun, 10 Mar 2013 17:47:55 +0400 Message-Id: <1362923278-4080-1-git-send-email-i.mitsyanko@gmail.com> Subject: [Qemu-devel] [PATCH 0/3] Fix VMSTATE_BUFFER_UNSAFE macro usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, i.mitsyanko@gmail.com, andrew@openedhand.com, michael@walle.cc, paul@codesourcery.com, anthony@codemonkey.ws hw/sd.c and hw/onenand.c were wrongly using VMSTATE_BUFFER_UNSAFE for dynamically allocated buffer migration, this was causing memory corruption. Use VMSTATE_BUFFER_POINTER_UNSAFE (wich has an additional VMS_POINTER flag set) instead. Not sure what to do with vmstate version for his devices, should I bump it? Migration was never working for them anyway. Only tested hw/sd.c, by saving/loading a snapshot of VM while it was playing videofile from SD card. Igor Mitsyanko (3): vmstate.h: introduce VMSTATE_BUFFER_POINTER_UNSAFE macro hw/sd.c: fix migration of dynamically allocated buffer "buf" hw/onenand.c: fix migration of dynamically allocated buffer "otp" hw/onenand.c | 3 ++- hw/sd.c | 2 +- include/migration/vmstate.h | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) -- 1.7.5.4