From patchwork Wed Apr 23 16:37:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 341928 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9385814011B for ; Thu, 24 Apr 2014 02:43:24 +1000 (EST) Received: from localhost ([::1]:33834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wd0GY-00009v-8A for incoming@patchwork.ozlabs.org; Wed, 23 Apr 2014 12:43:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wd0Bt-0003Mg-1i for qemu-devel@nongnu.org; Wed, 23 Apr 2014 12:38:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wd0Bm-0008HR-RM for qemu-devel@nongnu.org; Wed, 23 Apr 2014 12:38:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wd0Bm-0008HG-KR for qemu-devel@nongnu.org; Wed, 23 Apr 2014 12:38:26 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3NGcN6g020489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Apr 2014 12:38:24 -0400 Received: from dgilbert-t530.home.treblig.org (vpn1-7-213.ams2.redhat.com [10.36.7.213]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3NGboL4024273; Wed, 23 Apr 2014 12:38:22 -0400 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Wed, 23 Apr 2014 17:37:47 +0100 Message-Id: <1398271069-22057-15-git-send-email-dgilbert@redhat.com> In-Reply-To: <1398271069-22057-1-git-send-email-dgilbert@redhat.com> References: <1398271069-22057-1-git-send-email-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 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 Subject: [Qemu-devel] [RFC PATCH v2 14/16] ASN.1 schema for new migration format X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- docs/specs/migration.schema | 133 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 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..e72c575 --- /dev/null +++ b/docs/specs/migration.schema @@ -0,0 +1,133 @@ +-- 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)) + +-- Types for specific devices -- + +-------------------------------- + +-- Types for RAM + +-- TODO: 4096 is actually page size whatever that is +FullPage ::= [ APPLICATION 9040 ] SEQUENCE { + addr INTEGER, -- Address of page + data OCTET STRING (SIZE (4096)) +} + +XBZRLEPage ::= [ APPLICATION 11330 ] SEQUENCE { + addr INTEGER, -- Address of page + data OCTET STRING -- Compressed using xbzrle's own encoding +} + +RAMBlockID ::= SEQUENCE { + name QemuString, + len INTEGER +} + +-- RAM Block list sent in setup +RAMBlockList ::= [ APPLICATION 8018 ] SEQUENCE { + totalram INTEGER, -- Total length of RAM space in bytes + blocks SEQUENCE OF RAMBlockID +} + +-- An entry in a 'RAMSecBlock' - encapsulates all the different ways to send +-- a page +RAMPage ::= CHOICE { + compr [ APPLICATION 0 ] INTEGER, -- Address of a zero'd page + fullpage FullPage, -- A full uncompressed page + xbzrle XBZRLEPage, + hook [ APPLICATION 9295 ] NULL -- A flag gets set on the next page +} + +-- An entry in a RAM iterative section - a (probably incomplete) set of pages +-- for a particular (named) RAMBlock +RAMSecBlock ::= SEQUENCE { + name QemuString, -- RAMBlock these pages are for + pagelist SEQUENCE OF RAMPage +} + +-- Contents of a 'Section' for RAM + +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 { + vmstateentries SEQUENCE OF VMStateEntries +} + +-- Restrict to unsigned? +SectionID ::= INTEGER + +-- BER EoC is all 0's, so some corruptions just look like an end of stream +-- this dummy mark at the end of sections helps to spot these +SecEndMark ::= [ APPLICATION 10693 ] NULL + +SecFull ::= [ APPLICATION 2003 ] SEQUENCE { + name QemuString, + sectionid SectionID, + instanceid INTEGER, + versionid INTEGER, + + contents CHOICE { + ramblid RAMBlockList, + -- TODO other iterator initial stuff -- + vmstate VMState, + oldblob OCTET STRING + }, + + SecEndMark +} + +SecMin ::= [ APPLICATION 211 ] SEQUENCE { + sectionid SectionID, + + contents CHOICE { + ramsec [ APPLICATION 9810 ] SEQUENCE OF RAMSecBlock + -- TODO other iterator general/end stuff -- + }, + + SecEndMark +} + +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