[libvirt] [PATCH 2/2] qemu: fix hotplug of udp device with no connect host

Ján Tomko posted 2 patches 7 years, 7 months ago
[libvirt] [PATCH 2/2] qemu: fix hotplug of udp device with no connect host
Posted by Ján Tomko 7 years, 7 months ago
Use an empty string to let qemu fill out the default.

https://bugzilla.redhat.com/show_bug.cgi?id=1454671
---
 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 *chrID,
 
     case VIR_DOMAIN_CHR_TYPE_UDP:
         backend_type = "udp";
-        addr = qemuMonitorJSONBuildInetSocketAddress(chr->data.udp.connectHost,
+        host = chr->data.udp.connectHost;
+        if (!host)
+            host = "";
+        addr = qemuMonitorJSONBuildInetSocketAddress(host,
                                                      chr->data.udp.connectService);
         if (!addr ||
             virJSONValueObjectAppend(data, "remote", addr) < 0)
-- 
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] qemu: fix hotplug of udp device with no connect host
Posted by John Ferlan 7 years, 7 months ago

On 09/26/2017 07:58 AM, Ján Tomko wrote:
> Use an empty string to let qemu fill out the default.

Matches what's done in qemuBuildChrChardevStr
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1454671
> ---
>  src/qemu/qemu_monitor_json.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

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