From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOACi-0004JE-Go for qemu-devel@nongnu.org; Fri, 05 Apr 2013 13:13:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOACf-00030y-Pa for qemu-devel@nongnu.org; Fri, 05 Apr 2013 13:13:32 -0400 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:33521 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOACf-0002zt-J6 for qemu-devel@nongnu.org; Fri, 05 Apr 2013 13:13:29 -0400 From: Peter Maydell Date: Fri, 5 Apr 2013 18:13:09 +0100 Message-Id: <1365181999-15387-5-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1365181999-15387-1-git-send-email-peter.maydell@linaro.org> References: <1365181999-15387-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 04/14] vmstate.h: introduce VMSTATE_BUFFER_POINTER_UNSAFE macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , Blue Swirl Cc: qemu-devel@nongnu.org, Paul Brook From: Igor Mitsyanko Macro could be used to migrate a dynamically allocated buffer of known size. Signed-off-by: Igor Mitsyanko Reviewed-by: Peter Maydell Message-id: 1362923278-4080-2-git-send-email-i.mitsyanko@gmail.com Signed-off-by: Peter Maydell --- include/migration/vmstate.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 65918a9..8184123 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -436,6 +436,15 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = offsetof(_state, _field), \ } +#define VMSTATE_BUFFER_POINTER_UNSAFE(_field, _state, _version, _size) { \ + .name = (stringify(_field)), \ + .version_id = (_version), \ + .size = (_size), \ + .info = &vmstate_info_buffer, \ + .flags = VMS_BUFFER|VMS_POINTER, \ + .offset = offsetof(_state, _field), \ +} + #define VMSTATE_UNUSED_BUFFER(_test, _version, _size) { \ .name = "unused", \ .field_exists = (_test), \ -- 1.7.9.5