Re: [Xen-devel] [PATCH v9 03/25] libxc/migration: Specification update for DIRTY_PFN_LIST records
On 27/01/16 10:00, Ian Campbell wrote: > On Wed, 2016-01-27 at 15:12 +0800, Wen Congyang wrote: >> On 01/27/2016 04:44 AM, Konrad Rzeszutek Wilk wrote: + 0x000F: DIRTY_PFN_LIST + >>> Perhaps make it part of the optional and prefix it with CHECKPOINT? >> IIUC, optional record can be ignored, but this record cannot be ignored. >> >> To Andrew Cooper: >> Should I mark this record as optional record? > My understanding was that this indicated things for which support was > mandatory (whereas unknown optional ones may be ignored), not that they > must be present in every stream. > > IOW placing this in the mandatory flags is correct, since the restorer > cannot simply ignore a checkpoint flag. Both correct on all points. This should be a mandatory record. ~Andrew ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v9 03/25] libxc/migration: Specification update for DIRTY_PFN_LIST records
On Wed, 2016-01-27 at 15:12 +0800, Wen Congyang wrote: > On 01/27/2016 04:44 AM, Konrad Rzeszutek Wilk wrote: > > > + 0x000F: DIRTY_PFN_LIST > > > + > > > > Perhaps make it part of the optional and prefix it with CHECKPOINT? > > IIUC, optional record can be ignored, but this record cannot be ignored. > > To Andrew Cooper: > Should I mark this record as optional record? My understanding was that this indicated things for which support was mandatory (whereas unknown optional ones may be ignored), not that they must be present in every stream. IOW placing this in the mandatory flags is correct, since the restorer cannot simply ignore a checkpoint flag. Ian. ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v9 03/25] libxc/migration: Specification update for DIRTY_PFN_LIST records
On 01/27/2016 04:44 AM, Konrad Rzeszutek Wilk wrote: >> + 0x000F: DIRTY_PFN_LIST >> + > > Perhaps make it part of the optional and prefix it with CHECKPOINT? IIUC, optional record can be ignored, but this record cannot be ignored. To Andrew Cooper: Should I mark this record as optional record? Thanks Wen Congyang > >> + 0x0010 - 0x7FFF: Reserved for future _mandatory_ >> records. >> >> 0x8000 - 0x: Reserved for future _optional_ > > > . > ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v9 03/25] libxc/migration: Specification update for DIRTY_PFN_LIST records
On 01/27/2016 04:44 AM, Konrad Rzeszutek Wilk wrote: >> + 0x000F: DIRTY_PFN_LIST >> + > > Perhaps make it part of the optional and prefix it with CHECKPOINT? Will be fixed in the next version. Thanks Wen Congyang > >> + 0x0010 - 0x7FFF: Reserved for future _mandatory_ >> records. >> >> 0x8000 - 0x: Reserved for future _optional_ > > > . > ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v9 03/25] libxc/migration: Specification update for DIRTY_PFN_LIST records
> + 0x000F: DIRTY_PFN_LIST > + Perhaps make it part of the optional and prefix it with CHECKPOINT? > + 0x0010 - 0x7FFF: Reserved for future _mandatory_ > records. > > 0x8000 - 0x: Reserved for future _optional_ ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [PATCH v9 03/25] libxc/migration: Specification update for DIRTY_PFN_LIST records
Used by secondary to send it's dirty bitmap to primary under COLO. Signed-off-by: Yang HongyangSigned-off-by: Wen Congyang --- docs/specs/libxc-migration-stream.pandoc | 24 +++- tools/libxc/xc_sr_common.c | 1 + tools/libxc/xc_sr_stream_format.h| 1 + tools/python/xen/migration/libxc.py | 8 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-migration-stream.pandoc index 8cd678f..ae1f1d0 100644 --- a/docs/specs/libxc-migration-stream.pandoc +++ b/docs/specs/libxc-migration-stream.pandoc @@ -227,7 +227,9 @@ type 0x: END 0x000E: CHECKPOINT - 0x000F - 0x7FFF: Reserved for future _mandatory_ + 0x000F: DIRTY_PFN_LIST + + 0x0010 - 0x7FFF: Reserved for future _mandatory_ records. 0x8000 - 0x: Reserved for future _optional_ @@ -599,6 +601,26 @@ CHECKPOINT record or an END record. \clearpage +DIRTY_PFN_LIST + + +A dirty pfn list record is used to convey information about dirty memory +in the VM. It is an unordered list of PFNs. Currently only applicable in +the backchannel of a checkpointed stream. + + 0 1 2 3 4 5 6 7 octet ++-+ +| pfn[0] | ++-+ +... ++-+ +| pfn[C-1]| ++-+ + +The count of pfns is: record->length/sizeof(uint64_t). + +\clearpage + Layout == diff --git a/tools/libxc/xc_sr_common.c b/tools/libxc/xc_sr_common.c index 945cfa6..8150140 100644 --- a/tools/libxc/xc_sr_common.c +++ b/tools/libxc/xc_sr_common.c @@ -35,6 +35,7 @@ static const char *mandatory_rec_types[] = [REC_TYPE_X86_PV_VCPU_MSRS] = "x86 PV vcpu msrs", [REC_TYPE_VERIFY] = "Verify", [REC_TYPE_CHECKPOINT] = "Checkpoint", +[REC_TYPE_DIRTY_PFN_LIST] = "Dirty pfn list", }; const char *rec_type_to_str(uint32_t type) diff --git a/tools/libxc/xc_sr_stream_format.h b/tools/libxc/xc_sr_stream_format.h index 6d0f8fd..8b8533f 100644 --- a/tools/libxc/xc_sr_stream_format.h +++ b/tools/libxc/xc_sr_stream_format.h @@ -75,6 +75,7 @@ struct xc_sr_rhdr #define REC_TYPE_X86_PV_VCPU_MSRS 0x000cU #define REC_TYPE_VERIFY 0x000dU #define REC_TYPE_CHECKPOINT 0x000eU +#define REC_TYPE_DIRTY_PFN_LIST 0x000fU #define REC_TYPE_OPTIONAL 0x8000U diff --git a/tools/python/xen/migration/libxc.py b/tools/python/xen/migration/libxc.py index b0255ac..47da5e3 100644 --- a/tools/python/xen/migration/libxc.py +++ b/tools/python/xen/migration/libxc.py @@ -60,6 +60,7 @@ REC_TYPE_toolstack= 0x000b REC_TYPE_x86_pv_vcpu_msrs = 0x000c REC_TYPE_verify = 0x000d REC_TYPE_checkpoint = 0x000e +REC_TYPE_dirty_pfn_list = 0x000f rec_type_to_str = { REC_TYPE_end : "End", @@ -77,6 +78,7 @@ rec_type_to_str = { REC_TYPE_x86_pv_vcpu_msrs : "x86 PV vcpu msrs", REC_TYPE_verify : "Verify", REC_TYPE_checkpoint : "Checkpoint", +REC_TYPE_dirty_pfn_list : "Dirty pfn list" } # page_data @@ -403,6 +405,10 @@ class VerifyLibxc(VerifyBase): if len(content) != 0: raise RecordError("Checkpoint record with non-zero length") +def verify_record_dirty_pfn_list(self, content): +""" dirty pfn list """ +raise RecordError("Found dirty pfn list record in stream") + record_verifiers = { REC_TYPE_end: @@ -443,4 +449,6 @@ record_verifiers = { VerifyLibxc.verify_record_verify, REC_TYPE_checkpoint: VerifyLibxc.verify_record_checkpoint, +REC_TYPE_dirty_pfn_list: +VerifyLibxc.verify_record_dirty_pfn_list, } -- 2.5.0 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel