Re: [Qemu-devel] [PATCH 1/10] Refactor QEMUFile for live migration

2008-09-12 Thread Blue Swirl
On 9/9/08, Anthony Liguori [EMAIL PROTECTED] wrote:
 To support live migration, we override QEMUFile so that instead of writing to
  disk, the save/restore state happens over a network connection.

  This patch makes QEMUFile read/write operations function pointers so that we
  can override them for live migration.

  +typedef struct QEMUFileUnix
  +{
  +FILE *outfile;
  +} QEMUFileUnix;

I'd rather use name stdio/StdIO instead of Unix, this code is not Unix
dependent.
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] [PATCH 1/10] Refactor QEMUFile for live migration

2008-09-10 Thread Chris Lalancette
Anthony Liguori wrote:
snip
  void qemu_fflush(QEMUFile *f)
  {
 -if (!f-is_writable)
 +if (!f-put_buffer)
  return;
 +
  if (f-buf_index  0) {
 -if (f-is_file) {
 -fseek(f-outfile, f-buf_offset, SEEK_SET);
 -fwrite(f-buf, 1, f-buf_index, f-outfile);
 -} else {
 -bdrv_pwrite(f-bs, f-base_offset + f-buf_offset,
 -f-buf, f-buf_index);
 -}
 + f-put_buffer(f-opaque, f-buf, f-buf_offset, f-buf_index);

Nit...whitespace damage.

...

Overall, seems to be a good refactoring, and seems to keep the original
semantics of qemu_fopen_bdrv() and qemu_fopen().

Chris Lalancette
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html