[libvirt] [PATCH] qemu: do not set wait:false for client sockets

marcandre.lureau@redhat.com posted 1 patch 9 weeks ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190415165148.16760-1-marcandre.lureau@redhat.com
src/qemu/qemu_monitor_json.c | 14 ++++++++++----
tests/qemumonitorjsontest.c  |  2 --
2 files changed, 10 insertions(+), 6 deletions(-)

[libvirt] [PATCH] qemu: do not set wait:false for client sockets

Posted by marcandre.lureau@redhat.com 9 weeks ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Qemu commit 767abe7 ("chardev: forbid 'wait' option with client
sockets") effectively deprecates usage of "wait" with client sockets
starting with qemu 4.0, and earlier versions ignored the value.

Cc: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 src/qemu/qemu_monitor_json.c | 14 ++++++++++----
 tests/qemumonitorjsontest.c  |  2 --
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 71c452b25b..e7d063a5a8 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6922,8 +6922,11 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
 
         telnet = chr->data.tcp.protocol == VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
 
-        if (virJSONValueObjectAppendBoolean(data, "wait", false) < 0 ||
-            virJSONValueObjectAppendBoolean(data, "telnet", telnet) < 0 ||
+        if (chr->data.tcp.listen &&
+            virJSONValueObjectAppendBoolean(data, "wait", false) < 0)
+            goto cleanup;
+
+        if (virJSONValueObjectAppendBoolean(data, "telnet", telnet) < 0 ||
             virJSONValueObjectAppendBoolean(data, "server", chr->data.tcp.listen) < 0)
             goto cleanup;
         if (chr->data.tcp.tlscreds) {
@@ -6973,8 +6976,11 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
             goto cleanup;
         addr = NULL;
 
-        if (virJSONValueObjectAppendBoolean(data, "wait", false) < 0 ||
-            virJSONValueObjectAppendBoolean(data, "server", chr->data.nix.listen) < 0)
+        if (chr->data.nix.listen &&
+            virJSONValueObjectAppendBoolean(data, "wait", false) < 0)
+            goto cleanup;
+
+        if (virJSONValueObjectAppendBoolean(data, "server", chr->data.nix.listen) < 0)
             goto cleanup;
 
         if (qemuMonitorJSONBuildChrChardevReconnect(data, &chr->data.nix.reconnect) < 0)
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 055e201611..f5ad3f6a73 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -874,7 +874,6 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt)
                       "'data':{'addr':{'type':'inet',"
                                       "'data':{'host':'example.com',"
                                               "'port':'1234'}},"
-                              "'wait':false,"
                               "'telnet':false,"
                               "'server':false}}}");
 
@@ -920,7 +919,6 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt)
            "'backend':{'type':'socket',"
                       "'data':{'addr':{'type':'unix',"
                                       "'data':{'path':'/path/to/socket'}},"
-                              "'wait':false,"
                               "'server':false}}}");
 
     chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_SPICEVMC };
-- 
2.21.0.313.ge35b8cb8e2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] qemu: do not set wait:false for client sockets

Posted by Ján Tomko 9 weeks ago
On Mon, Apr 15, 2019 at 06:51:48PM +0200, marcandre.lureau@redhat.com wrote:
>From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
>Qemu commit 767abe7 ("chardev: forbid 'wait' option with client
>sockets") effectively deprecates usage of "wait" with client sockets
>starting with qemu 4.0, and earlier versions ignored the value.
>
>Cc: Daniel P. Berrangé <berrange@redhat.com>
>Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>---
> src/qemu/qemu_monitor_json.c | 14 ++++++++++----
> tests/qemumonitorjsontest.c  |  2 --
> 2 files changed, 10 insertions(+), 6 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] qemu: do not set wait:false for client sockets

Posted by Ján Tomko 9 weeks ago
On Tue, Apr 16, 2019 at 12:49:05AM +0200, Ján Tomko wrote:
>On Mon, Apr 15, 2019 at 06:51:48PM +0200, marcandre.lureau@redhat.com wrote:
>>From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>>Qemu commit 767abe7 ("chardev: forbid 'wait' option with client
>>sockets") effectively deprecates usage of "wait" with client sockets
>>starting with qemu 4.0, and earlier versions ignored the value.
>>
>>Cc: Daniel P. Berrangé <berrange@redhat.com>
>>Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>---
>>src/qemu/qemu_monitor_json.c | 14 ++++++++++----
>>tests/qemumonitorjsontest.c  |  2 --
>>2 files changed, 10 insertions(+), 6 deletions(-)
>>
>
>Reviewed-by: Ján Tomko <jtomko@redhat.com>
>
>Jano

Pushed now.

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list