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 <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Ján Tomko
2017-09-27 12:38:27 +02:00
parent 80740d9c66
commit 955caf171c
+4 -1
View File
@@ -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)