[PATCH] libxl: initialize shutdown inhibit callback

Marek Marczykowski-Górecki posted 1 patch 4 years, 10 months ago
Test syntax-check failed
Failed in applying to current master (apply log)
src/libxl/libxl_driver.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
[PATCH] libxl: initialize shutdown inhibit callback
Posted by Marek Marczykowski-Górecki 4 years, 10 months ago
The libxl driver already tries to call shutdown inhibit callback in the
right places, but only if it's set. That last part was missing,
resulting in premature shutdown when running libvirtd
--timeout=...

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 src/libxl/libxl_driver.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index bece313ec5..d45e42c100 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -648,8 +648,8 @@ libxlAddDom0(libxlDriverPrivatePtr driver)
 
 static int
 libxlStateInitialize(bool privileged,
-                     virStateInhibitCallback callback G_GNUC_UNUSED,
-                     void *opaque G_GNUC_UNUSED)
+                     virStateInhibitCallback callback,
+                     void *opaque)
 {
     libxlDriverConfigPtr cfg;
     char *driverConf = NULL;
@@ -670,6 +670,9 @@ libxlStateInitialize(bool privileged,
         return VIR_DRV_STATE_INIT_ERROR;
     }
 
+    libxl_driver->inhibitCallback = callback;
+    libxl_driver->inhibitOpaque = opaque;
+
     /* Allocate bitmap for vnc port reservation */
     if (!(libxl_driver->reservedGraphicsPorts =
           virPortAllocatorRangeNew(_("VNC"),
-- 
2.21.0


Re: [PATCH] libxl: initialize shutdown inhibit callback
Posted by Jim Fehlig 4 years, 10 months ago
On 1/17/20 7:37 PM, Marek Marczykowski-Górecki wrote:
> The libxl driver already tries to call shutdown inhibit callback in the
> right places, but only if it's set. That last part was missing,
> resulting in premature shutdown when running libvirtd
> --timeout=...

Wow, that's been overlooked for quite some time.

> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Reviewed-by: Jim Fehlig <jfehlig@suse.com>

and pushed now.

Regards,
Jim

> ---
>   src/libxl/libxl_driver.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index bece313ec5..d45e42c100 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -648,8 +648,8 @@ libxlAddDom0(libxlDriverPrivatePtr driver)
>   
>   static int
>   libxlStateInitialize(bool privileged,
> -                     virStateInhibitCallback callback G_GNUC_UNUSED,
> -                     void *opaque G_GNUC_UNUSED)
> +                     virStateInhibitCallback callback,
> +                     void *opaque)
>   {
>       libxlDriverConfigPtr cfg;
>       char *driverConf = NULL;
> @@ -670,6 +670,9 @@ libxlStateInitialize(bool privileged,
>           return VIR_DRV_STATE_INIT_ERROR;
>       }
>   
> +    libxl_driver->inhibitCallback = callback;
> +    libxl_driver->inhibitOpaque = opaque;
> +
>       /* Allocate bitmap for vnc port reservation */
>       if (!(libxl_driver->reservedGraphicsPorts =
>             virPortAllocatorRangeNew(_("VNC"),
>