Skip to contentSkip to conversation

spice: return unspecified address according to protocol

PATCH In review Amos Kong 3 participants 4 messages May 9, 2014 – May 12, 2014

lore
Share & tools
lore

Amos Kong

author
#0 lore raw

PATCH 1/1 spice: return unspecified address according to protocol

Commit 4f60af9a changed '0.0.0.0' to '*' to indicate unspecified address.

"::" is used to indicate unspecified address in IPV6.

This patch returns different address for different protocol, it's more meaningful for the protocol specification than returning '*'.

---
 ui/spice-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
ui/spice-core.c +3 -1
index d10818a..929c405 100644
@@ -533,7 +533,9 @@ SpiceInfo *qmp_query_spice(Error **errp)
     info->auth = g_strdup(auth);
 
     info->has_host = true;
-    info->host = g_strdup(addr ? addr : "*");
+    info->host = g_strdup(addr ? addr : (qemu_opt_get_bool(opts,
+                                                           "ipv6", 0)
+                                         ? "::" : "0.0.0.0"));
 
     info->has_compiled_version = true;
     major = (SPICE_SERVER_VERSION & 0xff0000) >> 16;
Signature · 1 line
1.9.0
#1 lore raw

Hi,

ui/spice-core.c SpiceInfo *qmp_query_spice(Error **errp) · line 538

Quoted 5 lines
     info->has_host = true;
ui/spice-core.c +3 -1
-    info->host = g_strdup(addr ? addr : "*");
+    info->host = g_strdup(addr ? addr : (qemu_opt_get_bool(opts,
+                                                           "ipv6", 0)
+                                         ? "::" : "0.0.0.0"));

"ipv6" means "force ipv6". If the option is not present spice-server might still listen on ipv6, and qemu can't easily figure whenever that is the case or not.

cheers,
Gerd

author
#2 lore raw
Quoted 11 lines · Gerd Hoffmann

Hi,

ui/spice-core.c SpiceInfo *qmp_query_spice(Error **errp) · line 538

Quoted 5 lines
     info->has_host = true;
ui/spice-core.c +3 -1
-    info->host = g_strdup(addr ? addr : "*");
+    info->host = g_strdup(addr ? addr : (qemu_opt_get_bool(opts,
+                                                           "ipv6", 0)
+                                         ? "::" : "0.0.0.0"));

"ipv6" means "force ipv6". If the option is not present spice-server might still listen on ipv6, and qemu can't easily figure whenever that is the case or not.

OK. And management will not use this returned address, so it's not a serious issue.

Thanks. NAK this patch.

Quoted 4 lines

cheers,
Gerd

Signature · 1 line
			Amos.
#3 lore raw
Quoted 9 lines · Amos Kong
Quoted 8 lines · Gerd Hoffmann

Hi,

Quoted 5 lines
     info->has_host = true;
ui/spice-core.c +3 -1
-    info->host = g_strdup(addr ? addr : "*");
+    info->host = g_strdup(addr ? addr : (qemu_opt_get_bool(opts,
+                                                           "ipv6", 0)
+                                         ? "::" : "0.0.0.0"));
Quoted 8 lines
Quoted 3 lines

"ipv6" means "force ipv6". If the option is not present spice-server might still listen on ipv6, and qemu can't easily figure whenever that is the case or not.

OK. And management will not use this returned address, so it's not a serious issue.

Thanks. NAK this patch.

Thanks for trying, Amos. The "*" is ugly... but I have no better ideas, either.