qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 13/17] COLO ctl: implement colo save


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [RFC PATCH 13/17] COLO ctl: implement colo save
Date: Fri, 1 Aug 2014 16:07:56 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

* Yang Hongyang (address@hidden) wrote:
> implement colo save

My postcopy 'QEMU_VM_CMD_PACKAGED' does something similar to
parts of this with the QEMUSizedBuffer, we might be able to share some more:
https://lists.nongnu.org/archive/html/qemu-devel/2014-07/msg00886.html

> +    /* we send the total size of the vmstate first */
> +    ret = colo_ctl_put(s->file, colo_buffer.used);
> +    if (ret) {
> +        goto out;
> +    }
> +
> +    qemu_put_buffer_async(s->file, colo_buffer.data, colo_buffer.used);
> +    ret = qemu_file_get_error(s->file);
> +    if (ret < 0) {
> +        goto out;
> +    }
> +    qemu_fflush(s->file);

Is there a reason to use _async here?  I thought the only gain is
if you were going to do other writes in the shadow of the async, with the fflush
immediately after I'm not sure it helps.

Dave

>  
>      ret = colo_ctl_get(control, COLO_CHECKPOINT_RECEIVED);
>      if (ret) {
>          goto out;
>      }
>  
> -    /* TODO: Flush network etc. */
> +    /* Flush network etc. */
> +    colo_compare_flush();
>  
>      ret = colo_ctl_get(control, COLO_CHECKPOINT_LOADED);
>      if (ret) {
>          goto out;
>      }
>  
> -    /* TODO: resume master */
> +    colo_compare_resume();
> +    ret = 0;
>  
>  out:
> +    /* resume master */
> +    qemu_mutex_lock_iothread();
> +    vm_start();
> +    qemu_mutex_unlock_iothread();
> +
>      return ret;
>  }
>  
> -- 
> 1.9.1
> 
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]