1. 17 3月, 2015 1 次提交
  2. 10 3月, 2015 1 次提交
  3. 16 1月, 2015 1 次提交
    • Y
      QEMUSizedBuffer: only free qsb that qemu_bufopen allocated · f018d8cd
      Yang Hongyang 提交于
      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: NYang 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: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      f018d8cd
  4. 16 12月, 2014 3 次提交
  5. 14 10月, 2014 6 次提交
  6. 06 5月, 2014 1 次提交
  7. 27 3月, 2014 1 次提交
  8. 09 3月, 2014 1 次提交
  9. 25 2月, 2014 1 次提交
    • J
      qemu_file: use fwrite() correctly · aded6539
      Juan Quintela 提交于
      fwrite() returns the number of items written.  But when there is one
      error, it can return a short write.
      
      In the particular bug that I was tracking, I did a migration to a
      read-only filesystem.  And it was able to finish the migration
      correctly.  fwrite() never returned a negative error code, nor zero,
      always 4096. (migration writes chunks of about 14000 bytes).  And it
      was able to "complete" the migration with success (yes, reading the
      file was a bit more difficult).
      
      To add insult to injury, if your amount of memory was big enough (12GB
      on my case), it overwrote some important structure, and from them,
      malloc failed.  This check makes the problem go away.
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      aded6539
  10. 13 1月, 2014 1 次提交