Re: [PATCH 2/2] ch: preserve last error before stop fix

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

 



On Thu, Mar 06, 2025 at 11:27:08 +0100, Kirill Shchetiniuk wrote:
> Add last meaningful error preservation to virCHProcessStop.
> 
> Signed-off-by: Kirill Shchetiniuk <kshcheti@xxxxxxxxxx>
> ---
>  src/ch/ch_process.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c
> index 9a85f7869e..38d466eaeb 100644
> --- a/src/ch/ch_process.c
> +++ b/src/ch/ch_process.c
> @@ -995,11 +995,15 @@ virCHProcessStop(virCHDriver *driver,
>      virCHDomainObjPrivate *priv = vm->privateData;
>      virCHDriverConfig *cfg = virCHDriverGetConfig(driver);
>      virDomainDef *def = vm->def;
> +    virErrorPtr orig_err = NULL;
>      size_t i;
>  
>      VIR_DEBUG("Stopping VM name=%s pid=%d reason=%d",
>                vm->def->name, (int)vm->pid, (int)reason);
>  
> +    /* Preserve origin error */

It's quite self-evident from the function called ;)

> +    virErrorPreserveLast(&orig_err);
> +
>      if (priv->monitor) {
>          g_clear_pointer(&priv->monitor, virCHMonitorClose);
>      }
> @@ -1032,6 +1036,8 @@ virCHProcessStop(virCHDriver *driver,
>  
>      virHostdevReAttachDomainDevices(driver->hostdevMgr, CH_DRIVER_NAME, def,
>                                      hostdev_flags);
> +
> +    virErrorRestore(&orig_err);
>      return 0;
>  }

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>



[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]

  Powered by Linux