[Spice-devel] libspice and save/restore/migration
Gerd Hoffmann
kraxel at redhat.com
Mon May 3 01:37:05 PDT 2010
Hi,
I want change the way save/restore works for the qxl device.
0.4 works this way:
savevm
qxl: call worker->save()
worker: call interface->set_save_data(data, size)
qxl: save data block.
loadvm
qxl: load data block.
qxl: call worker->load()
worker: call interface->get_save_data()
The data block passed back via set_save_data actually contains the local
cursor.
Current spice devel tree still contrains these bits. They don't work
any more. One of the reasons is the new surface code, which requires to
save additional state (namely all the surfaces). According to izik it
was broken before too, dunno why (memslots maybe?).
Plan for unstable:
(1) Keep surface metadata in device memory, i.e. delay the release of
QXL_SURFACE_CMD_CREATE command until the surface is destroyed.
(2) Keep the most recent QXL_CURSOR_SET command in device memory, i.e.
delay the release until the next one comes in.
(3) qemu/qxl keeps track of the active surfaces and the cursor (the
later is required anyway for local rendering). Because of (1)+(2)
it just needs to maintain pointers to the commands creating them.
savevm: qxl saves surface+cursor state (no help from libspice needed).
loadvm: qxl feeds libspice with the commands needed to restore state.
This could be done using either the usual get_command() interface
callbacks or with a new worker->loadvm_commands(cmdlist, count) call.
worker->{save,load} and interface->{get,set}_save_data() calls are not
needed any more.
Comments?
cheers,
Gerd
More information about the Spice-devel
mailing list