[pve-devel] [PATCH stable-5 qemu] fix async_savevm write

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Mar 15 06:50:47 CET 2019


On 3/14/19 3:29 PM, Dominik Csapak wrote:
> we ignored the return value of the write operation, which meant that
> we missed all errors that could pop up
>

looks OK to me, @Wolfgang as original author of the patch changed here,
could you also take a look at this?

 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  .../patches/pve/0031-savevm-async-fixups-for-AIO-WAIT.patch  | 12 ++++++++----
>  debian/patches/pve/0036-More-2.12-fixups.patch               |  6 +++---
>  2 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/debian/patches/pve/0031-savevm-async-fixups-for-AIO-WAIT.patch b/debian/patches/pve/0031-savevm-async-fixups-for-AIO-WAIT.patch
> index e9e881a..39c2c44 100644
> --- a/debian/patches/pve/0031-savevm-async-fixups-for-AIO-WAIT.patch
> +++ b/debian/patches/pve/0031-savevm-async-fixups-for-AIO-WAIT.patch
> @@ -5,8 +5,8 @@ Subject: [PATCH] savevm-async fixups for AIO-WAIT
>  
>  Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
>  ---
> - savevm-async.c | 34 +++++++++++++++-------------------
> - 1 file changed, 15 insertions(+), 19 deletions(-)
> + savevm-async.c | 37 +++++++++++++++++++------------------
> + 1 file changed, 19 insertions(+), 18 deletions(-)
>  
>  diff --git a/savevm-async.c b/savevm-async.c
>  index 313f6551c9..03d1184077 100644
> @@ -44,7 +44,7 @@ index 313f6551c9..03d1184077 100644
>       BlkRwCo rwco;
>   
>       assert(pos == snap_state.bs_pos);
> -@@ -169,19 +168,22 @@ static ssize_t block_state_writev_buffer(void *opaque, struct iovec *iov,
> +@@ -169,19 +168,27 @@ static ssize_t block_state_writev_buffer(void *opaque, struct iovec *iov,
>   
>       qemu_iovec_init_external(&qiov, iov, iovcnt);
>   
> @@ -60,6 +60,10 @@ index 313f6551c9..03d1184077 100644
>  +        Coroutine *co = qemu_coroutine_create(&block_state_write_entry, &rwco);
>  +        bdrv_coroutine_enter(blk_bs(snap_state.target), co);
>  +        BDRV_POLL_WHILE(blk_bs(snap_state.target), rwco.ret == NOT_DONE);
> ++    }
> ++
> ++    if (rwco.ret < 0) {
> ++        return rwco.ret;
>       }
>  -    aio_context_release(aio_context);
>  -
> @@ -75,7 +79,7 @@ index 313f6551c9..03d1184077 100644
>   static void process_savevm_cleanup(void *opaque)
>   {
>       int ret;
> -@@ -276,12 +278,6 @@ static void *process_savevm_thread(void *opaque)
> +@@ -276,12 +283,6 @@ static void *process_savevm_thread(void *opaque)
>       return NULL;
>   }
>   
> diff --git a/debian/patches/pve/0036-More-2.12-fixups.patch b/debian/patches/pve/0036-More-2.12-fixups.patch
> index 8deab21..571b021 100644
> --- a/debian/patches/pve/0036-More-2.12-fixups.patch
> +++ b/debian/patches/pve/0036-More-2.12-fixups.patch
> @@ -31,7 +31,7 @@ index 03d1184077..0fb4309b2e 100644
>   #include "qemu/cutils.h"
>   
>   /* #define DEBUG_SAVEVM_STATE */
> -@@ -225,10 +228,10 @@ static void *process_savevm_thread(void *opaque)
> +@@ -230,10 +233,10 @@ static void *process_savevm_thread(void *opaque)
>       }
>   
>       while (snap_state.state == SAVE_STATE_ACTIVE) {
> @@ -45,7 +45,7 @@ index 03d1184077..0fb4309b2e 100644
>   
>           maxlen = blk_getlength(snap_state.target) - 30*1024*1024;
>   
> -@@ -314,7 +317,7 @@ void qmp_savevm_start(bool has_statefile, const char *statefile, Error **errp)
> +@@ -319,7 +322,7 @@ void qmp_savevm_start(bool has_statefile, const char *statefile, Error **errp)
>       /* Open the image */
>       QDict *options = NULL;
>       options = qdict_new();
> @@ -54,7 +54,7 @@ index 03d1184077..0fb4309b2e 100644
>       snap_state.target = blk_new_open(statefile, NULL, options, bdrv_oflags, &local_err);
>       if (!snap_state.target) {
>           error_set(errp, ERROR_CLASS_GENERIC_ERROR, "failed to open '%s'", statefile);
> -@@ -368,18 +371,20 @@ void qmp_savevm_end(Error **errp)
> +@@ -373,18 +376,20 @@ void qmp_savevm_end(Error **errp)
>       snap_state.state = SAVE_STATE_DONE;
>   }
>   
> 





More information about the pve-devel mailing list