qemu-doc: update gluster protocol usage guide
PATCH 1/1 qemu-doc: update gluster protocol usage guide
Document:
1. The new debug and logfile options with their usages and
2. New json format and its usage.
--- qemu-doc.texi | 46 ++++++++++++++++++++++++++++++++-------------- qemu-options.hx | 14 ++++++++++++-- 2 files changed, 44 insertions(+), 16 deletions(-)
qemu-doc.texi +32 -14
@@ -1041,35 +1041,50 @@ GlusterFS is an user space distributed file system. You can boot from the GlusterFS disk image with the command: @example -qemu-system-x86_64 -drive file=gluster[+@var{transport}]://[@var{server}[:@var{port}]]/@var{volname}/@var{image}[?socket=...] +URI: +qemu-system-x86_64 -drive file=gluster[+@var{type}]://[@var{host}[:@var{port}]]/@var{volume}/@var{path}[?socket=...] + +JSON: +qemu-system-x86_64 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"N","logfile":"...","server":[@{"type":"tcp","host":"...","port":"..."@},@{"type":"unix","socket":"..."@}]@}@}' @end example @var{gluster} is the protocol. -@var{transport} specifies the transport type used to connect to gluster +@var{type} specifies the transport type used to connect to gluster management daemon (glusterd). Valid transport types are -tcp, unix and rdma. If a transport type isn't specified, then tcp -type is assumed. +tcp, unix. Incase of URI, if a transport type isn't specified, +then tcp type is assumed. -@var{server} specifies the server where the volume file specification for -the given volume resides. This can be either hostname, ipv4 address -or ipv6 address. ipv6 address needs to be within square brackets [ ]. -If transport type is unix, then @var{server} field should not be specified. +@var{host} specifies the server where the volume file specification for +the given volume resides. This can be either hostname, ipv4 address. +If transport type is unix, then @var{host} field should not be specified. Instead @var{socket} field needs to be populated with the path to unix domain socket. @var{port} is the port number on which glusterd is listening. This is optional -and if not specified, QEMU will send 0 which will make gluster to use the -default port. If the transport type is unix, then @var{port} should not be -specified. +and if not specified, it default to port 24007. If the transport type is unix, +then @var{port} should not be specified. + +@var{volume} is the name of the gluster volume which contains the disk image. + +@var{path} is the path to the actual disk image that resides on gluster volume. + +@var{debug} is the logging level of the gluster protocol driver. Debug levels +are 0-9, with 9 being the most verbose, and 0 representing no debugging output. +Default is level of 4. The current logging levels defined in the gluster source +are 0 - None, 1 - Emergency, 2 - Alert, 3 - Critical, 4 - Error, 5 - Warning, +6 - Notice, 7 - Info, 8 - Debug, 9 - Trace + +@var{logfile} is a commandline option to mention log file path which helps in +logging to the specified file and also help in persisting the gfapi logs. The +default is stderr. + -@var{volname} is the name of the gluster volume which contains the disk image. -@var{image} is the path to the actual disk image that resides on gluster volume. You can create a GlusterFS disk image with the command: @example -qemu-img create gluster://@var{server}/@var{volname}/@var{image} @var{size} +qemu-img create gluster://@var{host}/@var{volume}/@var{path} @var{size} @end example Examples
@@ -1082,6 +1097,9 @@ qemu-system-x86_64 -drive file=gluster+tcp://[1:2:3:4:5:6:7:8]:24007/testvol/dir qemu-system-x86_64 -drive file=gluster+tcp://server.domain.com:24007/testvol/dir/a.img qemu-system-x86_64 -drive file=gluster+unix:///testvol/dir/a.img?socket=/tmp/glusterd.socket qemu-system-x86_64 -drive file=gluster+rdma://1.2.3.4:24007/testvol/a.img +qemu-system-x86_64 -drive file=gluster://1.2.3.4/testvol/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log +qemu-system-x86_64 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"9","logfile":"/var/log/qemu-gluster.log","server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},@{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}' +qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log,file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket @end example @node disk_images_ssh
qemu-options.hx +12 -2
@@ -2595,13 +2595,23 @@ TCP, Unix Domain Sockets and RDMA transport protocols. Syntax for specifying a VM disk image on GlusterFS volume is @example -gluster[+transport]://[server[:port]]/volname/image[?socket=...] + +URI: +gluster[+type]://[host[:port]]/volume/path[?socket=...][,debug=N][,logfile=...] + +JSON: +'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"N","logfile":"...","server":[@{"type":"tcp","host":"...","port":"..."@},@{"type":"unix","socket":"..."@}]@}@}' @end example Example @example -qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img +URI: +qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log + +JSON: +qemu-system-x86_64 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"9","logfile":"/var/log/qemu-gluster.log","server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},@{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}' +qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log,file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket @end example See also @url{http://www.gluster.org}.
Signature · 1 line
2.7.4
Quoted 15 lines · Prasanna Kumar Kalever
Document:
1. The new debug and logfile options with their usages and
2. New json format and its usage.Signed-off-by Prasanna Kumar Kalever <[email protected]>--- qemu-doc.texi | 46 ++++++++++++++++++++++++++++++++-------------- qemu-options.hx | 14 ++++++++++++-- 2 files changed, 44 insertions(+), 16 deletions(-)qemu-doc.texi +0
-0
qemu-doc.texi GlusterFS is an user space distributed file system. · line 1048
Quoted 9 lines
qemu-doc.texi +5
-1@@ -1041,35 +1041,50 @@ GlusterFS is an user space distributed file system. You can boot from the GlusterFS disk image with the command: @example -qemu-system-x86_64 -drive file=gluster[+@var{transport}]://[@var{server}[:@var{port}]]/@var{volname}/@var{image}[?socket=...] +URI: +qemu-system-x86_64 -drive file=gluster[+@var{type}]://[@var{host}[:@var{port}]]/@var{volume}/@var{path}[?socket=...] + +JSON: +qemu-system-x86_64 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"N","logfile":"...","server":[@{"type":"tcp","host":"...","port":"..."@},@{"type":"unix","socket":"..."@}]@}@}'
"debug":"N" does not match the schema; the parameter is named "debug-level", and it is an integer not a string. The parameter is optional; you could just omit it. But if you are going to include it, give a reasonable example like "debug-level":0.
Can you break up this long line for legibility?
qemu-doc.texi GlusterFS is an user space distributed file system. · line 1055
Quoted 10 lines
qemu-doc.texi +2
-3@end example @var{gluster} is the protocol. -@var{transport} specifies the transport type used to connect to gluster +@var{type} specifies the transport type used to connect to gluster management daemon (glusterd). Valid transport types are -tcp, unix and rdma. If a transport type isn't specified, then tcp -type is assumed. +tcp, unix. Incase of URI, if a transport type isn't specified,
s/tcp, unix/tcp and unix/
s/Incase of URI/In the URI form/
qemu-doc.texi GlusterFS is an user space distributed file system. · line 1059
Quoted 8 lines
qemu-doc.texi +3
-4+then tcp type is assumed. -@var{server} specifies the server where the volume file specification for -the given volume resides. This can be either hostname, ipv4 address -or ipv6 address. ipv6 address needs to be within square brackets [ ]. -If transport type is unix, then @var{server} field should not be specified. +@var{host} specifies the server where the volume file specification for +the given volume resides. This can be either hostname, ipv4 address.
s/hostname, ipv4/a hostname or an ipv4/
qemu-doc.texi GlusterFS is an user space distributed file system. · line 1065
Quoted 9 lines
qemu-doc.texi +2
-3+If transport type is unix, then @var{host} field should not be specified. Instead @var{socket} field needs to be populated with the path to unix domain socket. @var{port} is the port number on which glusterd is listening. This is optional -and if not specified, QEMU will send 0 which will make gluster to use the -default port. If the transport type is unix, then @var{port} should not be -specified. +and if not specified, it default to port 24007. If the transport type is unix,
s/default/defaults/
qemu-doc.texi GlusterFS is an user space distributed file system. · line 1072
Quoted 7 lines
qemu-doc.texi +7
-0+then @var{port} should not be specified. + +@var{volume} is the name of the gluster volume which contains the disk image. + +@var{path} is the path to the actual disk image that resides on gluster volume. + +@var{debug} is the logging level of the gluster protocol driver. Debug levels
Again, the schema for BlockdevOptionsGluster spells this debug-level, so you need to fix this paragraph.
qemu-doc.texi GlusterFS is an user space distributed file system. · line 1074
Quoted 2 lines
qemu-doc.texi +2
-0+are 0-9, with 9 being the most verbose, and 0 representing no debugging output. +Default is level of 4. The current logging levels defined in the gluster source
s/Default is level of 4/The default level is 4/
qemu-doc.texi qemu-system-x86_64 -drive file=gluster+tcp://[1:2:3:4:5:6:7:8]:24007/testvol/dir · line 1100
Quoted 13 lines
qemu-doc.texi +8
-0+are 0 - None, 1 - Emergency, 2 - Alert, 3 - Critical, 4 - Error, 5 - Warning, +6 - Notice, 7 - Info, 8 - Debug, 9 - Trace + +@var{logfile} is a commandline option to mention log file path which helps in +logging to the specified file and also help in persisting the gfapi logs. The +default is stderr. +@@ -1082,6 +1097,9 @@ qemu-system-x86_64 -drive file=gluster+tcp://[1:2:3:4:5:6:7:8]:24007/testvol/dir qemu-system-x86_64 -drive file=gluster+tcp://server.domain.com:24007/testvol/dir/a.img qemu-system-x86_64 -drive file=gluster+unix:///testvol/dir/a.img?socket=/tmp/glusterd.socket qemu-system-x86_64 -drive file=gluster+rdma://1.2.3.4:24007/testvol/a.img +qemu-system-x86_64 -drive file=gluster://1.2.3.4/testvol/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log
Should be file.debug-level
qemu-doc.texi qemu-system-x86_64 -drive file=gluster+tcp://[1:2:3:4:5:6:7:8]:24007/testvol/dir · line 1102
Quoted 2 lines
qemu-doc.texi +2
-0+qemu-system-x86_64 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"9","logfile":"/var/log/qemu-gluster.log","server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},@{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}' +qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log,file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket
Two more incorrect uses of debug.
qemu-doc.texi TCP, Unix Domain Sockets and RDMA transport protocols. · line 2600
Quoted 9 lines
qemu-doc.texi +4
-1+++ b/qemu-options.hx@@ -2595,13 +2595,23 @@ TCP, Unix Domain Sockets and RDMA transport protocols. Syntax for specifying a VM disk image on GlusterFS volume is @example -gluster[+transport]://[server[:port]]/volname/image[?socket=...] + +URI: +gluster[+type]://[host[:port]]/volume/path[?socket=...][,debug=N][,logfile=...]
Again, isn't this debug-level?
qemu-doc.texi TCP, Unix Domain Sockets and RDMA transport protocols. · line 2603
Quoted 3 lines
qemu-doc.texi +3
-0+ +JSON: +'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"N","logfile":"...","server":[@{"type":"tcp","host":"...","port":"..."@},@{"type":"unix","socket":"..."@}]@}@}'
and this example matches the incorrect commit message
qemu-doc.texi TCP, Unix Domain Sockets and RDMA transport protocols. · line 2614
Quoted 12 lines
qemu-doc.texi +6
-1@end example Example @example -qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img +URI: +qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log + +JSON: +qemu-system-x86_64 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"9","logfile":"/var/log/qemu-gluster.log","server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},@{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}' +qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log,file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket
More uses of debug
Quoted 4 lines
qemu-doc.texi +0
-0@end example See also @url{http://www.gluster.org}.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 17 lines · Eric Blake
Quoted 16 lines · Prasanna Kumar Kalever
Document:
1. The new debug and logfile options with their usages and
2. New json format and its usage.Signed-off-by Prasanna Kumar Kalever <[email protected]>--- qemu-doc.texi | 46 ++++++++++++++++++++++++++++++++-------------- qemu-options.hx | 14 ++++++++++++-- 2 files changed, 44 insertions(+), 16 deletions(-)qemu-doc.texi +0
-0@@ -1041,35 +1041,50 @@ GlusterFS is an user space distributed file system.
Quoted 13 lines
qemu-doc.texi GlusterFS is an user space distributed file system. · line 1048
Quoted 8 lines
qemu-doc.texi +5
-1You can boot from the GlusterFS disk image with the command: @example -qemu-system-x86_64 -drive file=gluster[+@var{transport}]://[@var{server}[:@var{port}]]/@var{volname}/@var{image}[?socket=...] +URI: +qemu-system-x86_64 -drive file=gluster[+@var{type}]://[@var{host}[:@var{port}]]/@var{volume}/@var{path}[?socket=...] + +JSON: +qemu-system-x86_64 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":"N","logfile":"...","server":[@{"type":"tcp","host":"...","port":"..."@},@{"type":"unix","socket":"..."@}]@}@}'"debug":"N" does not match the schema; the parameter is named "debug-level", and it is an integer not a string. The parameter is optional; you could just omit it. But if you are going to include it, give a reasonable example like "debug-level":0.
Eric,
Quoted 1 line
From the code I can see
#define GLUSTER_OPT_DEBUG "debug"
And even tried this, there is no option 'debug-level'. And yes, I should admit it is 'int' not a 'string'
Thanks, rest of the comments seems convincing to me, will make the changes and spin them soon.
--
Prasanna
[...]
Quoted 6 lines
Quoted 1 line
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Quoted 5 lines · Prasanna Kalever
Quoted 4 lines
"debug":"N" does not match the schema; the parameter is named "debug-level", and it is an integer not a string. The parameter is optional; you could just omit it. But if you are going to include it, give a reasonable example like "debug-level":0.
Quoted 7 lines
Eric,
Quoted 1 line
From the code I can see
#define
GLUSTER_OPT_DEBUG"debug"And even tried this, there is no option 'debug-level'. And yes, I should admit it is 'int' not a 'string'
Uggh. We were under so much pressure to try and get GlusterServer into 2.7 that we really botched it.
The QMP definition is:
{ 'struct': 'BlockdevOptionsGluster',
'data': { 'volume': 'str',
'path': 'str',
'server': ['GlusterServer'],
'*debug-level': 'int',
'*logfile': 'str' } }and what's more, we've copied that string elsewhere for 2.8:
{ 'struct': 'BlockdevOptionsNfs',
'data': { 'server': 'NFSServer',
'path': 'str',
'*user': 'int',
'*group': 'int',
'*tcp-syn-count': 'int',
'*readahead-size': 'int',
'*page-cache-size': 'int',
'*debug-level': 'int' } }So either we need to fix the QMP to spell it 'debug' (to match the documentation you gave); or fix the docs to match the QMP and add some back-compat glue into the gluster code to manage both spellings rather than just the QMP spelling.
Since blockdev-add is still experimental, I'm leaning towards changing the QMP for both gluster and NFS. But we need to get it done before 2.8. Looks like I have some patches to propose.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 9 lines · Eric Blake
Quoted 7 lines · Prasanna Kalever
Quoted 4 lines
"debug":"N" does not match the schema; the parameter is named "debug-level", and it is an integer not a string. The parameter is optional; you could just omit it. But if you are going to include it, give a reasonable example like "debug-level":0.
Eric,
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
From the code I can see
#define
GLUSTER_OPT_DEBUG"debug"And even tried this, there is no option 'debug-level'. And yes, I should admit it is 'int' not a 'string'
Uggh. We were under so much pressure to try and get GlusterServer into 2.7 that we really botched it.
That's a great catch.
Quoted 22 lines
The QMP definition is:
{ 'struct': 'BlockdevOptionsGluster',
'data': { 'volume': 'str','path': 'str', 'server': ['GlusterServer'], '*debug-level': 'int', '*logfile': 'str' } }and what's more, we've copied that string elsewhere for 2.8:
{ 'struct': 'BlockdevOptionsNfs',
'data': { 'server': 'NFSServer','path': 'str', '*user': 'int', '*group': 'int', '*tcp-syn-count': 'int', '*readahead-size': 'int', '*page-cache-size': 'int', '*debug-level': 'int' } }
Quoted 8 lines
So either we need to fix the QMP to spell it 'debug' (to match the documentation you gave); or fix the docs to match the QMP and add some back-compat glue into the gluster code to manage both spellings rather than just the QMP spelling.
Since blockdev-add is still experimental, I'm leaning towards changing the QMP for both gluster and NFS. But we need to get it done before 2.8. Looks like I have some patches to propose.
Agree!
Lets fix it in QMP definitions, since we have 'debug' option out in 2.7. There could be people using this option now, changing the option may break something out.
I have made the changes, will send them out.
Thanks for the suggest Eric.
--
Prasanna
Quoted 5 lines
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org