Bug 1524399 - client-info return incorrect readonly info when connected by tcp/tls in readonly mode
Summary: client-info return incorrect readonly info when connected by tcp/tls in reado...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: Lili Zhu
Depends On:
TreeView+ depends on / blocked
Reported: 2017-12-11 12:32 UTC by yalzhang@redhat.com
Modified: 2018-10-30 09:52 UTC (History)
3 users (show)

Fixed In Version: libvirt-4.3.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-10-30 09:52:20 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 None None None 2018-10-30 09:52:59 UTC

Comment 2 Erik Skultety 2017-12-13 15:49:13 UTC
patch posted upstream: https://www.redhat.com/archives/libvir-list/2017-December/msg00465.html

Comment 3 Erik Skultety 2018-01-03 11:46:37 UTC
Fixed upstream by:

commit a8582e3656d626a0728bbbfb4fd715aa51676522
Refs: v3.10.0-76-ga8582e365
Author:     Erik Skultety <eskultet@redhat.com>
AuthorDate: Wed Dec 13 14:39:40 2017 +0100
Commit:     Erik Skultety <eskultet@redhat.com>
CommitDate: Mon Dec 18 08:42:29 2017 +0100

    admin: Use the connection to determine a client is connected readonly

    Prior to this change, we relied solely on the inherited readonly
    attribute of a service's socket. This only worked for our UNIX sockets
    (and only to some degree), but doesn't work for TCP sockets which are RW
    by default, but such connections support RO as well. This patch forces
    an update on the client object once we have established a connection to
    reflect the nature of the connection itself rather than relying on the
    underlying socket's attributes.
    Clients connected to the admin server have always been connected as RW

    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1524399
    Signed-off-by: Erik Skultety <eskultet@redhat.com>

Comment 5 Lili Zhu 2018-06-22 06:21:02 UTC
Verify this bug with 

tcp connection:
1. configure in server host in /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
auth_tcp = "none"

and in /etc/sysconfig/libvirtd uncomment the

2. on client host, connect to the server by tcp in readonly mode
# virsh -c qemu+tcp://server-hostname/system -r 
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh > 

3. on server host, check the connection info
# virt-admin client-list libvirtd
 Id    Transport       Connected since
 1     tcp             2018-06-21 23:31:42-0400

# virt-admin client-info libvirtd 1
id             : 1
connection_time: 2018-06-21 23:31:42-0400
transport      : tcp
readonly       : **yes**
sock_addr      : *client-ip*:33200

tls connection:
1. on client host, connect to the server by tls in readonly mode
# virsh -c qemu+tls://server-hostname/system -r 
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh > 

2. check the connection using virt-admin cmd
# virt-admin client-info libvirtd 2
id             : 2
connection_time: 2018-06-22 01:42:02-0400
transport      : tls
readonly       : **yes**
sock_addr      : *client-ip*:38098
tls_x509_dname : CN=,O=Red Hat,L=London,ST=London,C=GB

As the now the readonly attribute of both tls and tcp connection are correct,
mark this bug as verified.

Comment 7 errata-xmlrpc 2018-10-30 09:52:20 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.