From: Ján Tomko Date: Tue, 26 Sep 2017 11:56:36 +0000 (+0200) Subject: qemu: fix hotplug of udp device with no connect host X-Git-Tag: v3.8.0-rc1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=955caf171c0370cf4a32eec9a18aca2b653e6b82;p=thirdparty%2Flibvirt.git qemu: fix hotplug of udp device with no connect host Use an empty string to let qemu fill out the default. This matches what's done in qemuBuildChrChardevStr. https://bugzilla.redhat.com/show_bug.cgi?id=1454671 Signed-off-by: Ján Tomko Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 63b855920b..c63d250d36 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)