Re: [PATCH 07/20] snapshot: qemu: Add async job type for snapshots

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

 



On 10/23/2012 09:12 AM, Peter Krempa wrote:
> The new external system checkpoints will require an async job while the
> snapshot is taken. This patch adds QEMU_ASYNC_JOB_SNAPSHOT to track this
> job type.
> ---
>  src/qemu/qemu_domain.c  |  3 +++
>  src/qemu/qemu_domain.h  |  1 +
>  src/qemu/qemu_process.c | 19 +++++++++++++++++++
>  3 files changed, 23 insertions(+)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 4e6a5e9..3642bc1 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -65,6 +65,7 @@ VIR_ENUM_IMPL(qemuDomainAsyncJob, QEMU_ASYNC_JOB_LAST,
>                "migration in",
>                "save",
>                "dump",
> +              "snapshot",
>  );
> 
> 
> @@ -81,6 +82,7 @@ qemuDomainAsyncJobPhaseToString(enum qemuDomainAsyncJob job,
>      case QEMU_ASYNC_JOB_DUMP:
>      case QEMU_ASYNC_JOB_NONE:
>      case QEMU_ASYNC_JOB_LAST:
> +    case QEMU_ASYNC_JOB_SNAPSHOT:
>          ; /* fall through */

I'd rather see the case labels with _NONE and _LAST at the bottom; float
this up to be next to _DUMP.

>      }
> 
> @@ -103,6 +105,7 @@ qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job,
>      case QEMU_ASYNC_JOB_DUMP:
>      case QEMU_ASYNC_JOB_NONE:
>      case QEMU_ASYNC_JOB_LAST:
> +    case QEMU_ASYNC_JOB_SNAPSHOT:

Ditto.

Otherwise, looks reasonable.  I'll have to see later on if there are any
race cases.  Remember, if the _LIVE flag is not used, we pause up front;
but when the _LIVE flag IS used, qemu will pause itself when the
migration completes; and since this is all about state recovery when
libvirtd restarts, it is feasible that the migration completed instead
of being canceled, and that the reason we see the guest paused is
because qemu left it that way rather than us explicitly pausing it.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]