qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 0/4] savevm: save vmsate with fixed size


From: Wenchao Xia
Subject: [Qemu-devel] [RFC PATCH 0/4] savevm: save vmsate with fixed size
Date: Thu, 28 Feb 2013 16:09:41 +0800

  This patch added a new way to savevm: save vmstate as plane contents
instead of stream.

This version have following limitation:
  1 in patch 3 only dirty page got written, clean page is not touched, so
it will have trouble when savevm to an old internal snapshot, which
will be fixed later if this approach seems OK.
  2 in patch 3 it saves contents according to address regardless about
zero pages, so the size of savevm grows. In my test 128MB guest took
about 21M internal snapshot before, and always took 137MB in this way.

  Although it have above issue, but I'd like to sent the RFC first
to see if this is a good way. Next steps will be make savevm lively,
save vmstate to image files.

  About issue 2, it will be OK if we save vmstate to external image files,
such as a qcow2 file, which may handle the duplicated zeros(I guess so).
in internal snapshot case, the qcow2 internal snapshot need to enhanced
to allow store zeros with little space. Patch 3 use a simple plane lay
out for each ram page, so the zeros may be sparse. Another way to implement
I can think is use a hash table for each page, and check for the table
each time when trying to write one page, in which way space is saved but
performance drops.

Simple tips about the implemention:
  Before iteration, funtion iterate_calculate() calculate the space needed and
label the base address for each device need in savevm.


iteration begin
========== offset 0
device 0
========== offset 1
device 1
=========
 .
 .
 .
============offset N
iteration end

 Now device0=ram, then the callback of ram device make sure it
write the contents inside offset0-offset1. After interation done,
it jump to offset N and continue the complete code.

  Please review and give your opinion kindly:)

Wenchao Xia (4):
  qemu-file: add function qemu_fseek()
  savevm: save vmstate with seekable file
  ram: add support for seekable file save
  savevm: use seekeble file to savevm

 arch_init.c                   |  242 +++++++++++++++++++++++++++++++++++++++++
 include/migration/qemu-file.h |    1 +
 include/migration/vmstate.h   |   10 ++
 savevm.c                      |  111 ++++++++++++++++++-
 4 files changed, 360 insertions(+), 4 deletions(-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]