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

Re: [Xen-devel] [Qemu-devel] [PATCH v6 2/6] Introduce "save_devices"



On Thu, 15 Mar 2012, Luiz Capitulino wrote:
> On Thu, 15 Mar 2012 15:16:15 -0500
> Anthony Liguori <anthony@xxxxxxxxxxxxx> wrote:
> 
> > On 03/15/2012 01:19 PM, Stefano Stabellini wrote:
> > > - add an "is_ram" flag to SaveStateEntry;
> > >
> > > - register_savevm_live sets is_ram for live_savevm devices;
> > >
> > > - introduce a "save_devices" QAPI command that can be used to save
> > > the state of all devices, but not the RAM or the block devices of the
> > > VM.
> > >
> > > Changes in v6:
> > >
> > > - remove the is_ram parameter from register_savevm_live and sets is_ram
> > > if the device is a live_savevm device;
> > >
> > > - introduce save_devices as a QAPI command, write a better description
> > > for it;
> > >
> > > - fix CODING_STYLE;
> > >
> > > - introduce a new doc to explain the save format used by save_devices.
> > >
> > > Signed-off-by: Stefano Stabellini<stefano.stabellini@xxxxxxxxxxxxx>
> > > CC: Anthony Liguori<anthony@xxxxxxxxxxxxx>
> > > CC: Luiz Capitulino<lcapitulino@xxxxxxxxxx>
> > > ---
> > >   docs/save_devices.txt |   33 ++++++++++++++++++++++
> > >   qapi-schema.json      |   18 ++++++++++++
> > >   qmp-commands.hx       |   25 +++++++++++++++++
> > >   savevm.c              |   71 
> > > +++++++++++++++++++++++++++++++++++++++++++++++++
> > >   4 files changed, 147 insertions(+), 0 deletions(-)
> > >   create mode 100644 docs/save_devices.txt
> > >
> > > diff --git a/docs/save_devices.txt b/docs/save_devices.txt
> > > new file mode 100644
> > > index 0000000..79915d2
> > > --- /dev/null
> > > +++ b/docs/save_devices.txt
> > > @@ -0,0 +1,33 @@
> > > += Save Devices =
> > > +
> > > +QEMU has code to load/save the state of the guest that it is running.
> > > +These are two complementary operations.  Saving the state just does
> > > +that, saves the state for each device that the guest is running.
> > > +
> > > +These operations are normally used with migration (see migration.txt),
> > > +however it is also possible to save the state of all devices to file,
> > > +without saving the RAM or the block devices of the VM.
> > > +
> > > +This operation is called "save_devices" (see QMP/qmp-commands.txt).
> > > +
> > > +
> > > +The binary format used in the file is the following:
> > > +
> > > +
> > > +-------------------------------------------
> > > +
> > > +32 bit big endian: QEMU_VM_FILE_MAGIC
> > > +32 bit big endian: QEMU_VM_FILE_VERSION
> > > +
> > > +for_each_device
> > > +{
> > > +    8 bit:              QEMU_VM_SECTION_FULL
> > > +    32 bit big endian:  section_id
> > > +    8 bit:              idstr (ID string) length
> > > +    string:             idstr (ID string)
> > > +    32 bit big endian:  instance_id
> > > +    32 bit big endian:  version_id
> > > +    buffer:             device specific data
> > > +}
> > > +
> > > +8 bit: QEMU_VM_EOF
> > > diff --git a/qapi-schema.json b/qapi-schema.json
> > > index d0b6792..7f938ff 100644
> > > --- a/qapi-schema.json
> > > +++ b/qapi-schema.json
> > > @@ -1593,3 +1593,21 @@
> > >   { 'command': 'qom-list-types',
> > >     'data': { '*implements': 'str', '*abstract': 'bool' },
> > >     'returns': [ 'ObjectTypeInfo' ] }
> > > +
> > > +##
> > > +# @save_devices:
> > > +#
> > > +# Save the state of all devices to file. The RAM and the block devices
> > > +# of the VM are not saved by this command.
> > > +#
> > > +# @filename: the file to save the state of the devices to as binary
> > > +# data. See save_devices.txt for a description of the binary format.
> > > +#
> > > +# Returns: Nothing on success
> > > +#          If @filename cannot be opened, OpenFileFailed
> > > +#          If an I/O error occurs while writing the file, IOError
> > > +#
> > > +# Since: 1.0
> > 
> > Since: 1.1.
> > 
> > Otherwise Reviewed-by: Anthony Liguori <aliguori@xxxxxxxxxx>
> 
> Looks fine to me FWIW, my only nitpick is that we use an hyphen instead of the
> underline in qmp command names, but I'd call this save-devices-state.

OK, I'll rename and resend.


> Don't you want this in HMP too, btw?

It is basically useless because the data saved by save_devices needs to
be packet together with other data before any tools can actually use it.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.