Home | History | Annotate | Download | only in qemu

Lines Matching refs:opts

124 int inet_listen_opts(QemuOpts *opts, int port_offset)
139 const char* socket_fd = qemu_opt_get(opts, "socket");
145 if ((qemu_opt_get(opts, "host") == NULL) ||
146 (qemu_opt_get(opts, "port") == NULL)) {
150 pstrcpy(port, sizeof(port), qemu_opt_get(opts, "port"));
151 addr = qemu_opt_get(opts, "host");
153 to = qemu_opt_get_number(opts, "to", 0);
154 if (qemu_opt_get_bool(opts, "ipv4", 0))
156 if (qemu_opt_get_bool(opts, "ipv6", 0))
224 qemu_opt_set(opts, "host", uaddr);
225 qemu_opt_set(opts, "port", uport);
226 qemu_opt_set(opts, "ipv6", (e->ai_family == PF_INET6) ? "on" : "off");
227 qemu_opt_set(opts, "ipv4", (e->ai_family != PF_INET6) ? "on" : "off");
232 int inet_connect_opts(QemuOpts *opts)
242 const char* socket_fd = qemu_opt_get(opts, "socket");
253 addr = qemu_opt_get(opts, "host");
254 port = qemu_opt_get(opts, "port");
260 if (qemu_opt_get_bool(opts, "ipv4", 0))
262 if (qemu_opt_get_bool(opts, "ipv6", 0))
309 int inet_dgram_opts(QemuOpts *opts)
324 addr = qemu_opt_get(opts, "host");
325 port = qemu_opt_get(opts, "port");
334 if (qemu_opt_get_bool(opts, "ipv4", 0))
336 if (qemu_opt_get_bool(opts, "ipv6", 0))
355 addr = qemu_opt_get(opts, "localaddr");
356 port = qemu_opt_get(opts, "localport");
424 static int inet_parse(QemuOpts *opts, const char *str)
447 qemu_opt_set(opts, "ipv6", "on");
455 qemu_opt_set(opts, "ipv4", "on");
464 qemu_opt_set(opts, "host", addr);
465 qemu_opt_set(opts, "port", port);
471 qemu_opt_set(opts, "to", h+4);
473 qemu_opt_set(opts, "ipv4", "on");
475 qemu_opt_set(opts, "ipv6", "on");
492 qemu_opt_set(opts, "socket", str_fd);
501 QemuOpts *opts;
505 opts = qemu_opts_create(&dummy_opts, NULL, 0);
506 if (inet_parse(opts, str) == 0) {
507 sock = inet_listen_opts(opts, port_offset);
510 if (qemu_opt_get_bool(opts, "ipv6", 0)) {
512 qemu_opt_get(opts, "host"),
513 qemu_opt_get(opts, "port"),
517 qemu_opt_get(opts, "host"),
518 qemu_opt_get(opts, "port"),
523 qemu_opts_del(opts);
529 QemuOpts *opts;
532 opts = qemu_opts_create(&dummy_opts, NULL, 0);
533 if (inet_parse(opts, str) == 0)
534 sock = inet_connect_opts(opts);
535 qemu_opts_del(opts);
541 int unix_listen_opts(QemuOpts *opts)
544 const char *path = qemu_opt_get(opts, "path");
569 qemu_opt_set(opts, "path", un.sun_path);
591 int unix_connect_opts(QemuOpts *opts)
594 const char *path = qemu_opt_get(opts, "path");
624 QemuOpts *opts;
628 opts = qemu_opts_create(&dummy_opts, NULL, 0);
636 qemu_opt_set(opts, "path", path);
640 qemu_opt_set(opts, "path", str);
643 sock = unix_listen_opts(opts);
646 snprintf(ostr, olen, "%s%s", qemu_opt_get(opts, "path"), optstr ? optstr : "");
647 qemu_opts_del(opts);
653 QemuOpts *opts;
656 opts = qemu_opts_create(&dummy_opts, NULL, 0);
657 qemu_opt_set(opts, "path", path);
658 sock = unix_connect_opts(opts);
659 qemu_opts_del(opts);
665 int unix_listen_opts(QemuOpts *opts)
672 int unix_connect_opts(QemuOpts *opts)