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

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

 



* Yang Hongyang (yanghy@xxxxxxxxxxxxxx) 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 / dgilbert@xxxxxxxxxx / Manchester, UK
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux