[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 2/6] Introduce "save_devices"
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [PATCH v6 2/6] Introduce "save_devices" |
Date: |
Fri, 16 Mar 2012 11:41:42 +0000 |
User-agent: |
Alpine 2.00 (DEB 1167 2008-08-23) |
On Thu, 15 Mar 2012, Luiz Capitulino wrote:
> On Thu, 15 Mar 2012 15:16:15 -0500
> Anthony Liguori <address@hidden> 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<address@hidden>
> > > CC: Anthony Liguori<address@hidden>
> > > CC: Luiz Capitulino<address@hidden>
> > > ---
> > > 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 <address@hidden>
>
> 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.
- [Qemu-devel] [PATCH v6 0/6] save/restore on Xen, Stefano Stabellini, 2012/03/15
- [Qemu-devel] [PATCH v6 6/6] xen: do not allocate RAM during INMIGRATE runstate, Stefano Stabellini, 2012/03/15
- [Qemu-devel] [PATCH v6 4/6] xen: record physmap changes to xenstore, Stefano Stabellini, 2012/03/15
- [Qemu-devel] [PATCH v6 3/6] Set runstate to INMIGRATE earlier, Stefano Stabellini, 2012/03/15
- [Qemu-devel] [PATCH v6 5/6] xen mapcache: check if memory region has moved., Stefano Stabellini, 2012/03/15
- [Qemu-devel] [PATCH v6 1/6] cirrus_vga: do not reset videoram, Stefano Stabellini, 2012/03/15
- [Qemu-devel] [PATCH v6 2/6] Introduce "save_devices", Stefano Stabellini, 2012/03/15
- Re: [Qemu-devel] [PATCH v6 2/6] Introduce "save_devices", Stefano Stabellini, 2012/03/16