diff options
author | Juan Quintela <quintela@redhat.com> | 2009-12-02 12:36:43 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-03 10:04:54 -0600 |
commit | 33599e2a6164b1c7a5b634be1c2e54b8f0fb91bd (patch) | |
tree | ba615fe8d01a46ac2522c045f9cc7eb77954090b /savevm.c | |
parent | bfb811ade56e62da44404f55e224f4f5d07a902c (diff) |
vmstate: Add support for multiplying size for a constant
When the size that we want to transmit is in another field, but in an
unit different that bytes
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r-- | savevm.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1147,6 +1147,9 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, if (field->flags & VMS_VBUFFER) { size = *(int32_t *)(opaque+field->size_offset); + if (field->flags & VMS_MULTIPLY) { + size *= field->size; + } } if (field->flags & VMS_ARRAY) { n_elems = field->num; @@ -1200,6 +1203,9 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, if (field->flags & VMS_VBUFFER) { size = *(int32_t *)(opaque+field->size_offset); + if (field->flags & VMS_MULTIPLY) { + size *= field->size; + } } if (field->flags & VMS_ARRAY) { n_elems = field->num; |