[PATCH] qemu: fix reconnect of unix socket is wrong

Zhenguo Yao posted 1 patch 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20230216024837.79665-1-yaozhenguo1@gmail.com
src/qemu/qemu_monitor_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] qemu: fix reconnect of unix socket is wrong
Posted by Zhenguo Yao 1 year, 2 months ago
'reconnect' parameter doesn't pass to qemu properly when
hotplug vhost-user device to vm. Fix this by making
'reconnect' to get correct value.

Signed-off-by: Zhenguo Yao <yaozhenguo1@gmail.com>
---
 src/qemu/qemu_monitor_json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index d05ca2932f..ba6276ec8e 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6450,7 +6450,7 @@ qemuMonitorJSONAttachCharDevGetProps(const char *chrID,
                     return NULL;
 
                 if (chr->data.nix.reconnect.enabled == VIR_TRISTATE_BOOL_YES)
-                    reconnect = chr->data.tcp.reconnect.timeout;
+                    reconnect = chr->data.nix.reconnect.timeout;
                 else if (chr->data.nix.reconnect.enabled == VIR_TRISTATE_BOOL_NO)
                     reconnect = 0;
             }
-- 
2.32.0
Re: [PATCH] qemu: fix reconnect of unix socket is wrong
Posted by Jonathon Jongsma 1 year, 2 months ago
On 2/15/23 8:48 PM, Zhenguo Yao wrote:
> 'reconnect' parameter doesn't pass to qemu properly when
> hotplug vhost-user device to vm. Fix this by making
> 'reconnect' to get correct value.
> 
> Signed-off-by: Zhenguo Yao <yaozhenguo1@gmail.com>
> ---
>   src/qemu/qemu_monitor_json.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index d05ca2932f..ba6276ec8e 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -6450,7 +6450,7 @@ qemuMonitorJSONAttachCharDevGetProps(const char *chrID,
>                       return NULL;
>   
>                   if (chr->data.nix.reconnect.enabled == VIR_TRISTATE_BOOL_YES)
> -                    reconnect = chr->data.tcp.reconnect.timeout;
> +                    reconnect = chr->data.nix.reconnect.timeout;
>                   else if (chr->data.nix.reconnect.enabled == VIR_TRISTATE_BOOL_NO)
>                       reconnect = 0;
>               }


Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>