mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
vmstate: Create optional sections
To make sections optional, we need to do it at the beggining of the code. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
@@ -276,6 +276,17 @@ static void vmsd_desc_field_end(const VMStateDescription *vmsd, QJSON *vmdesc,
|
||||
json_end_object(vmdesc);
|
||||
}
|
||||
|
||||
|
||||
bool vmstate_save_needed(const VMStateDescription *vmsd, void *opaque)
|
||||
{
|
||||
if (vmsd->needed && !vmsd->needed(opaque)) {
|
||||
/* optional section not needed */
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
|
||||
void *opaque, QJSON *vmdesc)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user