summaryrefslogtreecommitdiff
path: root/include/migration/vmstate.h
AgeCommit message (Collapse)AuthorFilesLines
2014-03-14scsi: Fix migration of scsi sense dataFam Zheng1-0/+3
c5f52875 changed the size of sense array in vmstate_scsi_device by mistake. This patch restores the old size, and add a subsection for the remaining part of the buffer size. So that migration is not broken. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-08vmstate: Add uint32 2D-array supportChristoffer Dall1-0/+6
Add support for saving VMState of 2D arrays of uint32 values. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-04vmstate: Make VMSTATE_STRUCT_POINTER take type, not ptr-to-typePeter Maydell1-4/+4
The VMSTATE_STRUCT_POINTER macros are a bit odd in that they must be passed an argument "FooType *" rather than just taking the FooType. They're only used in one place, so it's easy to tidy this up. This also lets us use the macro to replace the hand-rolled VMSTATE_PTIMER. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-12-17vmstate: Add support for an array of ptimer_state *Peter Maydell1-0/+10
Add support for defining a vmstate field which is an array of pointers to structures, and use this to define a VMSTATE_PTIMER_ARRAY() which allows an array of ptimer_state* to be used by devices. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1387159292-10436-2-git-send-email-lig.fnst@cn.fujitsu.com
2013-09-24migration: add version supporting macros for struct pointerAlexey Kardashevskiy1-2/+15
This adds version supporting macros VMSTATE_STRUCT_POINTER_TEST_V and VMSTATE_STRUCT_POINTER_V in addition to the already existing VMSTATE_STRUCT_POINTER and VMSTATE_STRUCT_POINTER_TEST macros. Cc: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-06-27linux-user: Fix compilation failurePeter Maydell1-0/+2
Fix compilation failures for linux-user targets following recent migration related commits bd2fa51fcd and 43487c67. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1372362818-4740-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-05vmstate: Add support for two dimensional arraysPeter Maydell1-0/+27
Add support for migrating two dimensional arrays, by defining a set of new macros VMSTATE_*_2DARRAY paralleling the existing VMSTATE_*_ARRAY macros. 2D arrays are handled the same for actual state serialization; the only difference is that the type check has to change for a 2D array. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Igor Mitsyanko <i.mitsyanko@gmail.com> Message-id: 1363975375-3166-2-git-send-email-peter.maydell@linaro.org
2013-04-05vmstate.h: introduce VMSTATE_BUFFER_POINTER_UNSAFE macroIgor Mitsyanko1-0/+9
Macro could be used to migrate a dynamically allocated buffer of known size. Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1362923278-4080-2-git-send-email-i.mitsyanko@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-03-26savevm: Fix bugs in the VMSTATE_VBUFFER_MULTIPLY definitionDavid Gibson1-2/+2
The VMSTATE_BUFFER_MULTIPLY macro is misnamed - it actually specifies a variably sized buffer with VMS_VBUFFER, so should be named VMSTATE_VBUFFER_MULTIPLY. This patch fixes this (the macro had no current users under either name). In addition, unlike the other VMSTATE_VBUFFER variants, this macro did not specify VMS_POINTER. This patch fixes this bug as well. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-26savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32David Gibson1-0/+10
Currently the savevm code contains a VMSTATE_STRUCT_VARRAY_POINTER_INT32 helper (a variably sized array with the number of elements in an int32_t), but not VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (... with the number of elements in a uint32_t). This patch (trivially) fixes the deficiency. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-26savevm: Add VMSTATE_FLOAT64 helpersDavid Gibson1-0/+15
The current savevm code includes VMSTATE helpers for a number of commonly used data types, but not for the float64 type used by the internal floating point emulation code. This patch fixes the deficiency. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-26savevm: Add VMSTATE_UINTTL_EQUAL helperDavid Gibson1-2/+5
This adds an _EQUAL VMSTATE helper for target_ulongs, defined in terms of VMSTATE_UINT32_EQUAL or VMSTATE_UINT64_EQUAL as appropriate. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-26savevm: Add VMSTATE_UINT64_EQUAL helpersDavid Gibson1-0/+7
The savevm code already includes a number of *_EQUAL helpers which act as sanity checks verifying that the configuration of the saved state matches that of the machine we're loading into to work. Variants already exist for 8 bit 16 bit and 32 bit integers, but not 64 bit integers. This patch fills that hole, adding a UINT64 version. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-12stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLYAndreas Färber1-0/+4
Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-03-12vmstate: Make vmstate_register() static inlineAndreas Färber1-2/+10
This avoids adding a duplicate stub for CONFIG_USER_ONLY. Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-03-11migration: run setup callbacks out of big lockPaolo Bonzini1-1/+1
Only the migration_bitmap_sync() call needs the iothread lock. Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-11migration: run pending/iterate callbacks out of big lockPaolo Bonzini1-0/+11
This makes it possible to do blocking writes directly to the socket, with no buffer in the middle. For RAM, only the migration_bitmap_sync() call needs the iothread lock. For block migration, it is needed by the block layer (including bdrv_drain_all and dirty bitmap access), but because some code is shared between iterate and complete, all of mig_save_device_dirty is run with the lock taken. In the savevm case, the iterate callback runs within the big lock. This is annoying because it complicates the rules. Luckily we do not need to do anything about it: the RAM iterate callback does not need the iothread lock, and block migration never runs during savevm. Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-11migration: reorder SaveVMHandlers membersPaolo Bonzini1-3/+5
This groups together the callbacks that later will have similar locking rules. Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-01hw: move fifo.[ch] to libqemuutilPaolo Bonzini1-0/+2
fifo.c is generic code that can be easily unit tested. So it belongs in libqemuutil. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-20savevm: New save live migration method: pendingJuan Quintela1-0/+1
Code just now does (simplified for clarity) if (qemu_savevm_state_iterate(s->file) == 1) { vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); qemu_savevm_state_complete(s->file); } Problem here is that qemu_savevm_state_iterate() returns 1 when it knows that remaining memory to sent takes less than max downtime. But this means that we could end spending 2x max_downtime, one downtime in qemu_savevm_iterate, and the other in qemu_savevm_state_complete. Changed code to: pending_size = qemu_savevm_state_pending(s->file, max_size); DPRINTF("pending size %lu max %lu\n", pending_size, max_size); if (pending_size >= max_size) { ret = qemu_savevm_state_iterate(s->file); } else { vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); qemu_savevm_state_complete(s->file); } So what we do is: at current network speed, we calculate the maximum number of bytes we can sent: max_size. Then we ask every save_live section how much they have pending. If they are less than max_size, we move to complete phase, otherwise we do an iterate one. This makes things much simpler, because now individual sections don't have to caluclate the bandwidth (it was implossible to do right from there). Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19migration: move include files to include/migration/Paolo Bonzini1-0/+639
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>