Bug 1545155

Summary: gluster volume QAPI schema is not accepted by qemu
Product: Red Hat Enterprise Linux 7 Reporter: Peter Krempa <pkrempa>
Component: qemu-kvm-rhevAssignee: Kevin Wolf <kwolf>
Status: CLOSED ERRATA QA Contact: Longxiang Lyu <lolyu>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: chayang, coli, juzhang, knoel, michen, mrezanin, ngu, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: qemu-kvm-rhev-2.12.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-01 11:04:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 760547, 1558125    

Description Peter Krempa 2018-02-14 11:48:37 UTC
Description of problem:

QAPI schema describes the field to pass the unix socket path as:

{ 'struct': 'BlockdevOptionsGluster',
  'data': { 'volume': 'str',
            'path': 'str',
            'server': ['SocketAddress'],
            '*debug': 'int',
            '*logfile': 'str' } }

{ 'union': 'SocketAddress',
  'base': { 'type': 'SocketAddressType' },
  'discriminator': 'type',
  'data': { 'inet': 'InetSocketAddress',
            'unix': 'UnixSocketAddress',
            'vsock': 'VsockSocketAddress',
            'fd': 'String' } }

{ 'struct': 'UnixSocketAddress',
  'data': {
    'path': 'str' } }

Using the 'path' field ends in a failure:

qemu-system-x86_64: -drive file.driver=gluster,file.volume=vol0,file.path=img4,file.server.0.type=unix,file.server.0.path=/tmp/sock,file.server.1.type=unix,file.server.1.path=/tmp/sock2,file.debug=9,format=qcow2,if=none,id=drive-virtio-disk0,cache=none: Parameter 'socket' is missing

Comment 2 Kevin Wolf 2018-04-04 15:03:11 UTC
Fixed in upstream commit 9dae635af ('gluster: Fix blockdev-add with server.N.type=unix').

Comment 5 Longxiang Lyu 2018-05-03 05:00:39 UTC
GlusterFS server and client are on the same machine.
GlusterFS version: glusterfs-server-3.8.4-18.6.el7rhgs.x86_64

a. reproduction
QEMU version: qemu-kvm-rhev-2.9.0-16.el7_4.5.x86_64
# qemu-kvm -drive file.driver=gluster,file.volume=gv0,file.path=rhel75-64-virtio-scsi.qcow2,file.server.0.type=unix,file.server.0.path=/var/run/glusterd.socket -monitor stdio
qemu-kvm: -drive file.driver=gluster,file.volume=gv0,file.path=rhel75-64-virtio-scsi.qcow2,file.server.0.type=unix,file.server.0.path=/var/run/glusterd.socket: Parameter 'socket' is missing
hint: check in 'server' array index '0'
Usage: -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.qcow2[,file.debug=9][,file.logfile=/path/filename.log],file.server.0.type=inet,file.server.0.host=,file.server.0.port=24007,file.server.1.transport=unix,file.server.1.socket=/var/run/glusterd.socket ...

b. verification
QEMU version: qemu-img-rhev-2.12.0-1.el7.x86_64
# qemu-kvm -drive file.driver=gluster,file.volume=gv0,file.path=rhel75-64-virtio-scsi.qcow2,file.server.0.type=unix,file.server.0.path=/var/run/glusterd.socket -monitor stdio
[2018-05-03 04:59:39.906819] I [MSGID: 104045] [glfs-master.c:91:notify] 0-gfapi: New graph 6c79756c-6170-746f-702e-757365727379 (0) coming up
[2018-05-03 04:59:39.906847] I [MSGID: 114020] [client.c:2356:notify] 0-gv0-client-0: parent translators are ready, attempting connect on transport
[2018-05-03 04:59:39.909556] I [rpc-clnt.c:2001:rpc_clnt_reconfig] 0-gv0-client-0: changing port to 49152 (from 0)
[2018-05-03 04:59:39.911714] I [MSGID: 114057] [client-handshake.c:1439:select_server_supported_programs] 0-gv0-client-0: Using Program GlusterFS 3.3, Num (1298437), Version (330)
[2018-05-03 04:59:39.912057] I [MSGID: 114046] [client-handshake.c:1215:client_setvolume_cbk] 0-gv0-client-0: Connected to gv0-client-0, attached to remote volume '/home/brick'.
[2018-05-03 04:59:39.912066] I [MSGID: 114047] [client-handshake.c:1226:client_setvolume_cbk] 0-gv0-client-0: Server and Client lk-version numbers are not same, reopening the fds
[2018-05-03 04:59:39.930828] I [MSGID: 114035] [client-handshake.c:201:client_set_lk_version_cbk] 0-gv0-client-0: Server lk version = 1
[2018-05-03 04:59:39.931667] I [MSGID: 104041] [glfs-resolve.c:966:__glfs_active_subvol] 0-gv0: switched to graph 6c79756c-6170-746f-702e-757365727379 (0)
[2018-05-03 04:59:39.932399] W [MSGID: 114031] [client-rpc-fops.c:2211:client3_3_seek_cbk] 0-gv0-client-0: remote operation failed [No such device or address]
QEMU 2.12.0 monitor - type 'help' for more information
(qemu) VNC server running on ::1:5900
(qemu) info block
ide0-hd0 (#block107): json:{"driver": "qcow2", "file": {"driver": "gluster", "path": "rhel75-64-virtio-scsi.qcow2", "server.0.path": "/var/run/glusterd.socket", "server.0.type": "unix", "volume": "gv0"}} (qcow2)
    Attached to:      /machine/unattached/device[22]
    Cache mode:       writeback

mark as VERIFIED then.

Comment 6 errata-xmlrpc 2018-11-01 11:04:15 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.