From nobody Thu May 2 03:29:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1506428302007412.4529896485526; Tue, 26 Sep 2017 05:18:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B35FA61468; Tue, 26 Sep 2017 12:18:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E1705D9C9; Tue, 26 Sep 2017 12:18:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 50F441855944; Tue, 26 Sep 2017 12:18:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8QBww9r031994 for ; Tue, 26 Sep 2017 07:58:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 16BBA5C578; Tue, 26 Sep 2017 11:58:58 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 941C363758 for ; Tue, 26 Sep 2017 11:58:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B35FA61468 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 26 Sep 2017 13:58:52 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] conf: fix formatting of udp chardev attributes X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 26 Sep 2017 12:18:21 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It is possible (although possibly not very useful) to leave out the service attribute when using Fix the formatter bug introduced by commit 4a0da34 and format the host when its present (checked for non-NULL inside virBufferEscapeString) instead of basing it on the presence of the service attribute. https://bugzilla.redhat.com/show_bug.cgi?id=3D1455825 --- src/conf/domain_conf.c | 12 ++++-------- tests/genericxml2xmloutdata/generic-chardev-udp.xml | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 44cfb52b4..3c3db7291 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23307,19 +23307,15 @@ virDomainChrSourceDefFormat(virBufferPtr buf, case VIR_DOMAIN_CHR_TYPE_UDP: if (def->data.udp.bindService || def->data.udp.bindHost) { virBufferAddLit(buf, "data.udp.bindService) - virBufferEscapeString(buf, " host=3D'%s'", def->data.udp.b= indHost); - if (def->data.udp.bindService) - virBufferEscapeString(buf, " service=3D'%s'", def->data.ud= p.bindService); + virBufferEscapeString(buf, " host=3D'%s'", def->data.udp.bindH= ost); + virBufferEscapeString(buf, " service=3D'%s'", def->data.udp.bi= ndService); virBufferAddLit(buf, "/>\n"); } =20 if (def->data.udp.connectService || def->data.udp.connectHost) { virBufferAddLit(buf, "data.udp.connectService) - virBufferEscapeString(buf, " host=3D'%s'", def->data.udp.c= onnectHost); - if (def->data.udp.connectService) - virBufferEscapeString(buf, " service=3D'%s'", def->data.ud= p.connectService); + virBufferEscapeString(buf, " host=3D'%s'", def->data.udp.conne= ctHost); + virBufferEscapeString(buf, " service=3D'%s'", def->data.udp.co= nnectService); virBufferAddLit(buf, "/>\n"); } break; diff --git a/tests/genericxml2xmloutdata/generic-chardev-udp.xml b/tests/ge= nericxml2xmloutdata/generic-chardev-udp.xml index c4a719f2f..c9b3e5550 100644 --- a/tests/genericxml2xmloutdata/generic-chardev-udp.xml +++ b/tests/genericxml2xmloutdata/generic-chardev-udp.xml @@ -29,7 +29,7 @@ - + --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 03:29:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150642757752923.405094278993147; Tue, 26 Sep 2017 05:06:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4FF015D687; Tue, 26 Sep 2017 12:06:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29EBE69573; Tue, 26 Sep 2017 12:06:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D46201855946; Tue, 26 Sep 2017 12:06:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8QBwwMB032004 for ; Tue, 26 Sep 2017 07:58:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB32D5C578; Tue, 26 Sep 2017 11:58:58 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 645D063747 for ; Tue, 26 Sep 2017 11:58:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4FF015D687 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 26 Sep 2017 13:58:53 +0200 Message-Id: <10ee79a6873d469b01f7f16306f2174ac1aaed3e.1506427120.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: fix hotplug of udp device with no connect host X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 26 Sep 2017 12:06:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use an empty string to let qemu fill out the default. https://bugzilla.redhat.com/show_bug.cgi?id=3D1454671 Reviewed-by: John Ferlan --- src/qemu/qemu_monitor_json.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 63b855920..c63d250d3 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6522,7 +6522,10 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrI= D, =20 case VIR_DOMAIN_CHR_TYPE_UDP: backend_type =3D "udp"; - addr =3D qemuMonitorJSONBuildInetSocketAddress(chr->data.udp.conne= ctHost, + host =3D chr->data.udp.connectHost; + if (!host) + host =3D ""; + addr =3D qemuMonitorJSONBuildInetSocketAddress(host, chr->data.udp.connect= Service); if (!addr || virJSONValueObjectAppend(data, "remote", addr) < 0) --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list