[pve-devel] [PATCH] vmstate snapshot : implement cancelled state V2

Cesar Peschiera brain at click.com.py
Fri Nov 21 19:51:44 CET 2014


Hi

Excuse me please, i want to do only a comment and a question:

If the PVE host is hangs, while a snapshot or a cancel of snapshot is in 
progress, and in the middle of the process the PVE server hangs, when this 
server is started again, will have the system a mechanism of auto recovery 
to initial state? (ie as if this process did not performed)

----- Original Message ----- 
From: "Alexandre Derumier" <aderumier at odiso.com>
To: <pve-devel at pve.proxmox.com>
Sent: Friday, November 21, 2014 6:26 AM
Subject: [pve-devel] [PATCH] vmstate snapshot : implement cancelled state V2


> currently, if we cancel a active savevm job with savevm-end,
> we don't close the vmstate file.
>
> This implement a new state CANCELLED, which is setup if savevm-end is 
> called
> when savevm is ACTIVE
>
> then, in the coroutine, if state CANCELLED is detected,
> we call save_snapshot_completed() to properly close the file
> then qmp_savevm_end to finish the job
>
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
> debian/patches/internal-snapshot-async.patch |   15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/debian/patches/internal-snapshot-async.patch 
> b/debian/patches/internal-snapshot-async.patch
> index 395c54c..52044f0 100644
> --- a/debian/patches/internal-snapshot-async.patch
> +++ b/debian/patches/internal-snapshot-async.patch
> @@ -370,7 +370,7 @@ Index: new/savevm-async.c
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ new/savevm-async.c 2014-11-20 09:17:48.000000000 +0100
> -@@ -0,0 +1,484 @@
> +@@ -0,0 +1,497 @@
> +#include "qemu-common.h"
> +#include "qapi/qmp/qerror.h"
> +#include "sysemu/sysemu.h"
> @@ -399,6 +399,7 @@ Index: new/savevm-async.c
> +    SAVE_STATE_ERROR,
> +    SAVE_STATE_ACTIVE,
> +    SAVE_STATE_COMPLETED,
> ++    SAVE_STATE_CANCELLED
> +};
> +
> +
> @@ -588,6 +589,13 @@ Index: new/savevm-async.c
> +            }
> +        }
> +    }
> ++
> ++    if(snap_state.state == SAVE_STATE_CANCELLED) {
> ++        save_snapshot_completed();
> ++        Error *errp = NULL;
> ++        qmp_savevm_end(&errp);
> ++    }
> ++
> +}
> +
> +static const QEMUFileOps block_file_ops = {
> @@ -673,6 +681,11 @@ Index: new/savevm-async.c
> +        return;
> +    }
> +
> ++    if (snap_state.state == SAVE_STATE_ACTIVE) {
> ++        snap_state.state = SAVE_STATE_CANCELLED;
> ++        return;
> ++    }
> ++
> +    if (snap_state.saved_vm_running) {
> +        vm_start();
> +    }
> -- 
> 1.7.10.4
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list