Red Hat Bugzilla – Bug 1029987
spice-server reports incorrect listening address on monitor with "ipv6" option
Last modified: 2015-03-05 04:43:05 EST
version: spice-server-0.12.4-3.el7.x86_64 +++ This bug was initially created as a clone of Bug #1029983 +++ Description of problem: "-spice ipv6" and "-spice addr=::" invocations are functionally equivalent (spice-server listens on address "::") but "-spice ipv6" reports listening address to be 0.0.0.0 instead of "::". Version-Release number of selected component (if applicable): spice-server-0.12.4-6.el6.x86_64 How reproducible: always Steps to Reproduce: 1. run two qemu-kvm processes with monitor with "-spice ipv6" and "-spice addr=::" 2. look at listening addresses using "info spice" monitor command 3. look at listening addresses using system tools (e.g. netstat) Actual results: address reported by "info spice" doesn't match address reported by netstat for "-spice ipv6" case Expected results: address reported by "info spice" matches the one from "netstat" Additional info: $ qemu-kvm -monitor stdio -vga qxl -spice ipv6,disable-ticketing,port=5800 iQEMU 0.12.1 monitor - type 'help' for more information (qemu) info spice Server: migrated: false address: 0.0.0.0:5800 auth: none Channels: none (qemu) quit $ qemu-kvm -monitor stdio -vga qxl -spice addr=::,disable-ticketing,port=5800 QEMU 0.12.1 monitor - type 'help' for more information (qemu) info spice Server: migrated: false address: :::5800 auth: none Channels: none (qemu) // both cases # netstat -putna | grep 5800 tcp 0 0 :::5800 :::* LISTEN 12564/qemu-kvm
This is caused by that code in qemu/ui/spice-core.c:qmp_query_spice() addr = qemu_opt_get(opts, "addr"); ... info->host = g_strdup(addr ? addr : "0.0.0.0");
Hmm, qemu doesn't know what spice-server is listening on, especially in case nothing was explicitly configured (ipv4, ipv6 options) and it depends on the host configuration whenever ipv6 or ipv6 is used by default. So we could simply replace "0.0.0.0" with "*" wildcard. Sounds ok? Better suggestions?
Reporting a wildcard is a good thing, simple and not misleading.
http://patchwork.ozlabs.org/patch/339171/
upstream commit 4f60af9ac00800d5833f6ec4317535aeaddb1616
Reproduce this bug with qemu-kvm-1.5.3-66.el7.x86_64 # /usr/libexec/qemu-kvm -monitor stdio -vga qxl -spice ipv6,disable-ticketing,port=5800 QEMU 1.5.3 monitor - type 'help' for more information (qemu) info spice Server: address: 0.0.0.0:5800 migrated: false auth: none compiled: 0.12.4 mouse-mode: server Channels: none # netstat -antpu|grep 5800 tcp6 0 0 :::5800 :::* LISTEN 14780/qemu-kvm so this bug can be reproduced. Verify with qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64 For amd & Intel host. /usr/libexec/qemu-kvm -monitor stdio -vga qxl -spice ipv6,disable-ticketing,port=5800 QEMU 2.0.92 monitor - type 'help' for more information (qemu) info spice Server: address: *:5800 migrated: false auth: none compiled: 0.12.4 mouse-mode: server Channels: none # netstat -antpu|grep 5800 tcp6 0 0 :::5800 :::* LISTEN 14970/qemu-kvm # /usr/libexec/qemu-kvm -monitor stdio -vga qxl -spice addr=::,disable-ticketing,port=5800 (qemu) info spice Server: address: :::5800 migrated: false auth: none compiled: 0.12.4 mouse-mode: server Channels: none # netstat -antpu|grep 5800 tcp6 0 0 :::5800 :::* LISTEN 15332/qemu-kvm use spice client to connect to spice server via ipv4 or ipv6 address. result: spice client connected successfully. Gerd, QE need confirm two questions with you for this test result. 1. According to this test result, Is this bug fixed? 2. If specify ipv6('-spice ipv6' or '-spice addr=::'), then spice client can connect to spice server with ipv4 or ipv6 address. Conversely,If specify ipv4(-spice ipv4),then spice client only can use ipv4 address to connect spice server. Is it expect?
Reproduce this bug with qemu-kvm-1.5.3-66.el7.x86_64 # /usr/libexec/qemu-kvm -monitor stdio -vga qxl -spice ipv6,disable-ticketing,port=5800 QEMU 1.5.3 monitor - type 'help' for more information (qemu) info spice Server: address: 0.0.0.0:5800 migrated: false auth: none compiled: 0.12.4 mouse-mode: server Channels: none # netstat -antpu|grep 5800 tcp6 0 0 :::5800 :::* LISTEN 14780/qemu-kvm so this bug can be reproduced. Verify this bug with qemu-kvm-rhev-2.1.0-2.el7.x86_64 # /usr/libexec/qemu-kvm -monitor stdio -vga qxl -spice ipv6,disable-ticketing,port=5900 QEMU 2.1.0 monitor - type 'help' for more information (qemu) info spice Server: address: *:5900 migrated: false auth: none compiled: 0.12.4 mouse-mode: server Channels: none # netstat -anp |grep 5900 tcp6 0 0 :::5900 :::* LISTEN 17300/qemu-kvm So according to above, qemu-kvm replace "0.0.0.0" with "*" wildcard, so this bug has been fixed. Additional infos: Test with ipv6 address "::" and "::1" specified in cml # /usr/libexec/qemu-kvm -monitor stdio -vga qxl -spice ipv6,addr=::,disable-ticketing,port=5900 QEMU 2.1.0 monitor - type 'help' for more information (qemu) info spice Server: address: :::5900 migrated: false auth: none compiled: 0.12.4 mouse-mode: server Channels: none # netstat -anp |grep 5900 tcp6 0 0 :::5900 :::* LISTEN 17359/qemu-kvm # /usr/libexec/qemu-kvm -monitor stdio -vga qxl -spice ipv6,addr=::1,disable-ticketing,port=5900 QEMU 2.1.0 monitor - type 'help' for more information (qemu) info spice Server: address: ::1:5900 migrated: false auth: none compiled: 0.12.4 mouse-mode: server Channels: none # netstat -anp |grep 5900 tcp6 0 0 ::1:5900 :::* LISTEN 17373/qemu-kvm Under hmp, the spice server is using ipv6 format address, and listening ipv6 address with tcp port.
> Gerd, > QE need confirm two questions with you for this test result. > 1. According to this test result, Is this bug fixed? Yes. > 2. If specify ipv6('-spice ipv6' or '-spice addr=::'), then spice client can > connect to spice server with ipv4 or ipv6 address. Conversely,If specify > ipv4(-spice ipv4),then spice client only can use ipv4 address to connect > spice server. Is it expect? ipv6 sockets allow ipv4 connects (when binding to the wildcard address), so this is normal behavior.
Hi Gerd, You changed the component to qemu-kvm-rhev.Do you plan fix this bug on qemu-kvm ? Since qemu-kvm still hit this problem. Thanks, Mazhang.
(In reply to mazhang from comment #12) > Hi Gerd, > > You changed the component to qemu-kvm-rhev.Do you plan fix this bug on > qemu-kvm ? Not planned, low priority bug.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-0624.html