block: Minor vhost-user-blk fixes
cover block: Minor vhost-user-blk fixes
- Add vhost-user-blk help to qemu-storage-daemon,
- Do not list vhost-user-blk in BlockExportType when CONFIG_VHOST_USER_BLK_SERVER is disabled.
Philippe Mathieu-Daudé (2):
qemu-storage-daemon: Add vhost-user-blk help
qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER
qapi/block-export.json | 3 ++- storage-daemon/qemu-storage-daemon.c | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-)
Signature · 1 line
2.33.1
PATCH 2/2 qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER
Do not list vhost-user-blk in BlockExportType
when CONFIG_VHOST_USER_BLK_SERVER is disabled.
--- qapi/block-export.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
qapi/block-export.json +2 -1
@@ -277,7 +277,8 @@ # Since: 4.2 ## { 'enum': 'BlockExportType', - 'data': [ 'nbd', 'vhost-user-blk', + 'data': [ 'nbd', + { 'name': 'vhost-user-blk', 'if': 'CONFIG_VHOST_USER_BLK_SERVER' }, { 'name': 'fuse', 'if': 'CONFIG_FUSE' } ] } ##
Signature · 1 line
2.33.1
PATCH 1/2 qemu-storage-daemon: Add vhost-user-blk help
In reply to Philippe Mathieu-DaudéAdd missing vhost-user-blk help:
$ qemu-storage-daemon -h
...
--export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,
addr.type=unix,addr.path=<socket-path>[,writable=on|off]
[,logical-block-size=<block-size>][,num-queues=<num-queues>]
export the specified block node as a
vhosts-user-blk device over UNIX domain socket
--export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,
fd,addr.str=<fd>[,writable=on|off]
[,logical-block-size=<block-size>][,num-queues=<num-queues>]
export the specified block node as a
vhosts-user-blk device over file descriptor
...--- storage-daemon/qemu-storage-daemon.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
storage-daemon/qemu-storage-daemon.c +13 -0
@@ -104,6 +104,19 @@ static void help(void)" export the specified block node over FUSE\n" "\n"#endif /* CONFIG_FUSE */ +#ifdef CONFIG_VHOST_USER_BLK_SERVER +" --export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,\n" +" addr.type=unix,addr.path=<socket-path>[,writable=on|off]\n" +" [,logical-block-size=<block-size>][,num-queues=<num-queues>]\n" +" export the specified block node as a\n" +" vhosts-user-blk device over UNIX domain socket\n" +" --export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,\n" +" fd,addr.str=<fd>[,writable=on|off]\n" +" [,logical-block-size=<block-size>][,num-queues=<num-queues>]\n" +" export the specified block node as a\n" +" vhosts-user-blk device over file descriptor\n" +"\n" +#endif /* CONFIG_VHOST_USER_BLK_SERVER */ " --monitor [chardev=]name[,mode=control][,pretty[=on|off]]\n" " configure a QMP monitor\n" "\n"
Signature · 1 line
2.33.1
Re: [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER
In reply to Philippe Mathieu-DaudéQuoted 4 lines · Philippe Mathieu-Daudé
Do not list vhost-user-blk in BlockExportType
whenCONFIG_VHOST_USER_BLK_SERVERis disabled.Fixes 90fc91d50b7 ("convert vhost-user-blk server to block export API")
My immediate reaction was "what exactly is broken before this patch?"
I think it's introspection: query-qmp-schema has vhost-user-blk even though it's not actually available. Let's spell that out.
Quoted 10 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- qapi/block-export.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)qapi/block-export.json +0
-0
qapi/block-export.json line 284
Quoted 9 lines
qapi/block-export.json +2
-1@@ -277,7 +277,8 @@ # Since: 4.2 ## { 'enum': 'BlockExportType', - 'data': [ 'nbd', 'vhost-user-blk', + 'data': [ 'nbd', + { 'name': 'vhost-user-blk', 'if': 'CONFIG_VHOST_USER_BLK_SERVER' }, { 'name': 'fuse', 'if': 'CONFIG_FUSE' } ] } ##
Doesn't compile when I configure --disable-vhost-user. Fix:
qapi/block-export.json +2 -1
@@ -320,7 +320,8 @@ 'discriminator': 'type', 'data': { 'nbd': 'BlockExportOptionsNbd', - 'vhost-user-blk': 'BlockExportOptionsVhostUserBlk', + 'vhost-user-blk': { 'type': 'BlockExportOptionsVhostUserBlk', + 'if': 'CONFIG_VHOST_USER_BLK_SERVER' }, 'fuse': { 'type': 'BlockExportOptionsFuse', 'if': 'CONFIG_FUSE' } } }
Re: [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER
Quoted 11 lines · Markus Armbruster
Quoted 4 lines · Philippe Mathieu-Daudé
Do not list vhost-user-blk in BlockExportType
whenCONFIG_VHOST_USER_BLK_SERVERis disabled.Fixes 90fc91d50b7 ("convert vhost-user-blk server to block export API")My immediate reaction was "what exactly is broken before this patch?"
I think it's introspection: query-qmp-schema has vhost-user-blk even though it's not actually available. Let's spell that out.
Yes, OK.
Quoted 27 lines
Quoted 10 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- qapi/block-export.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)qapi/block-export.json +0
-0qapi/block-export.json line 284
Quoted 9 lines
qapi/block-export.json +2
-1@@ -277,7 +277,8 @@ # Since: 4.2 ## { 'enum': 'BlockExportType', - 'data': [ 'nbd', 'vhost-user-blk', + 'data': [ 'nbd', + { 'name': 'vhost-user-blk', 'if': 'CONFIG_VHOST_USER_BLK_SERVER' }, { 'name': 'fuse', 'if': 'CONFIG_FUSE' } ] } ##Doesn't compile when I configure --disable-vhost-user. Fix:
qapi/block-export.json +0
-0
qapi/block-export.json line 327
Quoted 9 lines
qapi/block-export.json +2
-1@@ -320,7 +320,8 @@ 'discriminator': 'type', 'data': { 'nbd': 'BlockExportOptionsNbd', - 'vhost-user-blk': 'BlockExportOptionsVhostUserBlk', + 'vhost-user-blk': { 'type': 'BlockExportOptionsVhostUserBlk', + 'if': 'CONFIG_VHOST_USER_BLK_SERVER' }, 'fuse': { 'type': 'BlockExportOptionsFuse', 'if': 'CONFIG_FUSE' } } }
Oh, thank you very much for fixing this part!