summary refs log tree commit diff stats
path: root/migration/qemu-file.c
diff options
context:
space:
mode:
authorYang Hongyang <yanghy@cn.fujitsu.com>2014-12-19 11:38:05 +0800
committerAmit Shah <amit.shah@redhat.com>2015-01-16 13:06:17 +0530
commitf018d8cd2123f495300935d5019931abbee4e5d9 (patch)
tree6884c7b70c7121bc48349ceebba7126c7e73aaf7 /migration/qemu-file.c
parent1b826f277814dd9496fe3cc71cbe6ab7b203cadf (diff)
downloadfocaccia-qemu-f018d8cd2123f495300935d5019931abbee4e5d9.tar.gz
focaccia-qemu-f018d8cd2123f495300935d5019931abbee4e5d9.zip
QEMUSizedBuffer: only free qsb that qemu_bufopen allocated
Only free qsb that qemu_bufopen allocated, and also allow
qemu_bufopen accept qsb as input for write operation. It
will make the API more logical:
1.If you create the QEMUSizedBuffer yourself, you need to
  free it by using qsb_free() but not depends on other API
  like qemu_fclose.
2.allow qemu_bufopen() accept QEMUSizedBuffer as input for
  write operation, otherwise, it will be a little strange
  for this API won't accept the second parameter.

This brings API change, since there are only 3
users of this API currently, this change only impact the
first one which will be fixed in patch 2 of this patchset,
so I think it is safe to do this change.

1     70  tests/test-vmstate.c <<open_mem_file_read>>
            return qemu_bufopen("r", qsb);
2    404  tests/test-vmstate.c <<test_save_noskip>>
            QEMUFile *fsave = qemu_bufopen("w", NULL);
3    424  tests/test-vmstate.c <<test_save_skip>>
            QEMUFile *fsave = qemu_bufopen("w", NULL);

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>
Diffstat (limited to 'migration/qemu-file.c')
0 files changed, 0 insertions, 0 deletions