virJSONValuePtr data = NULL;
virJSONValuePtr addr = NULL;
const char *backend_type = NULL;
+ const char *host;
+ const char *port;
char *tlsalias = NULL;
bool telnet;
virJSONValueObjectAppend(data, "remote", addr) < 0)
goto cleanup;
- if (chr->data.udp.bindHost) {
- addr = qemuMonitorJSONBuildInetSocketAddress(chr->data.udp.bindHost,
- chr->data.udp.bindService);
+ host = chr->data.udp.bindHost;
+ port = chr->data.udp.bindService;
+ if (host || port) {
+ if (!host)
+ host = "";
+ if (!port)
+ port = "";
+ addr = qemuMonitorJSONBuildInetSocketAddress(host, port);
if (!addr ||
virJSONValueObjectAppend(data, "local", addr) < 0)
goto cleanup;
"'data':{'host':'localhost',"
"'port':'4321'}}}}}");
+ chr.data.udp.bindHost = NULL;
+ chr.data.udp.bindService = (char *) "4321";
+ CHECK("udp", false,
+ "{'id':'alias',"
+ "'backend':{'type':'udp',"
+ "'data':{'remote':{'type':'inet',"
+ "'data':{'host':'example.com',"
+ "'port':'1234'}},"
+ "'local':{'type':'inet',"
+ "'data':{'host':'',"
+ "'port':'4321'}}}}}");
memset(&chr, 0, sizeof(chr));
chr.type = VIR_DOMAIN_CHR_TYPE_UNIX;
chr.data.nix.path = (char *) "/path/to/socket";