From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSXnZ-0002Ps-Mr for qemu-devel@nongnu.org; Tue, 25 Mar 2014 16:18:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSXnT-0008KL-OM for qemu-devel@nongnu.org; Tue, 25 Mar 2014 16:18:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSXnT-0008KB-H1 for qemu-devel@nongnu.org; Tue, 25 Mar 2014 16:18:07 -0400 From: "Dr. David Alan Gilbert (git)" Date: Tue, 25 Mar 2014 20:17:26 +0000 Message-Id: <1395778647-30925-16-git-send-email-dgilbert@redhat.com> In-Reply-To: <1395778647-30925-1-git-send-email-dgilbert@redhat.com> References: <1395778647-30925-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [RFC PATCH 15/16] ASN.1 schema for new migration format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanb@linux.vnet.ibm.com, quintela@redhat.com, mdroth@linux.vnet.ibm.com, agraf@suse.de, mst@redhat.com, aliguori@amazon.com, afaerber@suse.de From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- docs/specs/migration.schema | 113 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 docs/specs/migration.schema diff --git a/docs/specs/migration.schema b/docs/specs/migration.schema new file mode 100644 index 0000000..d433127 --- /dev/null +++ b/docs/specs/migration.schema @@ -0,0 +1,113 @@ +-- Copyright 2014 Red Hat, Inc. and/or its affiliates +-- +-- Authors: +-- Dave Gilbert +-- +-- This work is licensed under the terms of the GNU LGPL, version 2 or later. +-- See the COPYING.LIB file in the top-level directory. + +Qemu {} +DEFINITIONS IMPLICIT TAGS ::= +BEGIN + +-- Some basic types used in multiple places -- +QemuString ::= UTF8String (SIZE (1..255)) + +-- TODO: 4096 is actually page size whatever that is +FullPage ::= OCTET STRING (SIZE (4096)) + +-- Types for specific devices -- + +VMState-CPU-Common ::= [ APPLICATION 20000 ] SEQUENCE { + halted INTEGER, + interrupt-request INTEGER +} + +-------------------------------- + +RAMBlockID ::= SEQUENCE { + name QemuString, + len INTEGER +} + +RAMSecEntry ::= [ APPLICATION 8914 ] SEQUENCE { + addr INTEGER, -- Address or offset or size + flags INTEGER, -- maybe more explicit type? + name QemuString OPTIONAL, + + body CHOICE { + bl SEQUENCE OF RAMBlockID, + compr INTEGER (0..255), -- Page filled with this value + page FullPage + -- TODO xbzrle -- + } +} + +RAMSecList ::= [ APPLICATION 9810 ] SEQUENCE OF RAMSecEntry + +SubSection ::= [ APPLICATION 10707 ] SEQUENCE { + name QemuString, + versionid INTEGER, + + contents SEQUENCE OF VMStateEntries +} + +SubSecList ::= [ APPLICATION 10700 ] SEQUENCE OF SubSection + +VMStateEntries ::= CHOICE { + -- Hmm need to think more -- + array SEQUENCE OF VMStateEntries, + bool BOOLEAN, + int INTEGER, + oldblob OCTET STRING, + subsecl SubSecList +} + +VMState ::= CHOICE { + SEQUENCE OF VMStateEntries, + + VMState-CPU-Common +} + +-- Restrict to unsigned? +SectionID ::= INTEGER + +SecFull ::= [ APPLICATION 2003 ] SEQUENCE { + name QemuString, + sectionid SectionID, + instanceid INTEGER, + versionid INTEGER, + + contents CHOICE { + ramsec RAMSecList, + -- TODO other iterator initial stuff -- + vmstate VMState, + oldblob OCTET STRING + } +} + +SecMin ::= [ APPLICATION 211 ] SEQUENCE { + sectionid SectionID, + + contents CHOICE { + ramsec RAMSecList + -- TODO other iterator general/end stuff -- + } +} + +Sections ::= CHOICE { + full SecFull, + min SecMin +} + +-- The whole file -- +-- Application tag used to get first 32bits of file +-- to come out as 7f cd c5 51 - the 51 is Q +-- the c5 and cd being E,M but with the top bit set +-- which BER requires +QemuFile ::= [ APPLICATION 1270481 ] SEQUENCE { + version INTEGER (3), + top SEQUENCE OF Sections +} + +END -- 1.8.5.3