summaryrefslogtreecommitdiffstats
path: root/tests/test-vmstate.c
Commit message (Collapse)AuthorAgeFilesLines
* migration: Append JSON description of migration streamAlexander Graf2015-02-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | One of the annoyances of the current migration format is the fact that it's not self-describing. In fact, it's not properly describing at all. Some code randomly scattered throughout QEMU elaborates roughly how to read and write a stream of bytes. We discussed an idea during KVM Forum 2013 to add a JSON description of the migration protocol itself to the migration stream. This patch adds a section after the VM_END migration end marker that contains description data on what the device sections of the stream are composed of. This approach is backwards compatible with any QEMU version reading the stream, because QEMU just stops reading after the VM_END marker and ignores any data following it. With an additional external program this allows us to decipher the contents of any migration stream and hopefully make migration bugs easier to track down. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* Tests: QEMUSizedBuffer/QEMUBufferYang Hongyang2015-01-161-12/+8
| | | | | | | | | | | | | Modify some of tests/test-vmstate.c due to qemu_bufopen() change. If you create a QEMUSizedBuffer yourself, you have to explicitly free it. Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: Juan Quintela <quintela@redhat.com> Cc: Amit Shah <amit.shah@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* Tests: QEMUSizedBuffer/QEMUBufferDr. David Alan Gilbert2014-10-141-36/+38
| | | | | | | | | | | | | Modify some of tests/test-vmstate.c to use the in memory file based on QEMUSizedBuffer to provide basic testing of QEMUSizedBuffer and the associated memory backed QEMUFile type. Only some of the tests are changed so that the fd backed QEMUFile is still tested. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* tests: Add missing 'static' attributes (fix warnings from smatch)Stefan Weil2014-07-181-2/+2
| | | | | | | | Smatch also complains about 0 used for pointers, so replace those by NULL in test-visitor-serialization.c, too. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* vmstate: Refactor & increase tests for primitive typesJuan Quintela2014-06-231-61/+212
| | | | | | | | This commit refactor the simple tests to test all integer types. We move to hex because it is easier to read values of different types. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
* vmstate: Refactor opening of filesJuan Quintela2014-06-161-19/+19
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com>
* savevm: Remove all the unneeded version_minimum_id_old (rest)Juan Quintela2014-05-141-6/+3
| | | | | | | | | | | | | | | | | | | | After previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong: .fields = (VMStateField []) { and .fields = (VMStateField []) { Change all the combinations to: .fields = (VMStateField[]){ The biggest problem (appart from aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* tests: Some unit tests for vmstate.cEduardo Habkost2014-01-131-0/+357
* Basic load/save tests * Tests for loading older versions * Tests for .field_exists() handling Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
OpenPOWER on IntegriCloud