qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] block: Minor vhost-user-blk fixes
@ 2021-12-20 20:00 Philippe Mathieu-Daudé
  2021-12-20 20:00 ` [PATCH 1/2] qemu-storage-daemon: Add vhost-user-blk help Philippe Mathieu-Daudé
  2021-12-20 20:00 ` [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER Philippe Mathieu-Daudé
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-12-20 20:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, qemu-block, Eric Blake, Markus Armbruster,
	Stefan Hajnoczi, Philippe Mathieu-Daudé

- 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(-)

-- 
2.33.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] qemu-storage-daemon: Add vhost-user-blk help
  2021-12-20 20:00 [PATCH 0/2] block: Minor vhost-user-blk fixes Philippe Mathieu-Daudé
@ 2021-12-20 20:00 ` Philippe Mathieu-Daudé
  2021-12-20 20:00 ` [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER Philippe Mathieu-Daudé
  1 sibling, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-12-20 20:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Qing Wang, qemu-block, Eric Blake, Markus Armbruster,
	Stefan Hajnoczi, 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
  ...

Fixes: 90fc91d50b7 ("convert vhost-user-blk server to block export API")
Reported-by: Qing Wang <qinwang@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 storage-daemon/qemu-storage-daemon.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c
index 52cf17e8ace..0c19e128e3f 100644
--- a/storage-daemon/qemu-storage-daemon.c
+++ b/storage-daemon/qemu-storage-daemon.c
@@ -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"
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER
  2021-12-20 20:00 [PATCH 0/2] block: Minor vhost-user-blk fixes Philippe Mathieu-Daudé
  2021-12-20 20:00 ` [PATCH 1/2] qemu-storage-daemon: Add vhost-user-blk help Philippe Mathieu-Daudé
@ 2021-12-20 20:00 ` Philippe Mathieu-Daudé
  2021-12-22  7:05   ` Markus Armbruster
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-12-20 20:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, qemu-block, Eric Blake, Markus Armbruster,
	Stefan Hajnoczi, Philippe Mathieu-Daudé

Do not list vhost-user-blk in BlockExportType
when CONFIG_VHOST_USER_BLK_SERVER is disabled.

Fixes: 90fc91d50b7 ("convert vhost-user-blk server to block export API")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 qapi/block-export.json | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qapi/block-export.json b/qapi/block-export.json
index c1b92ce1c1c..6bc29a75dc0 100644
--- a/qapi/block-export.json
+++ b/qapi/block-export.json
@@ -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' } ] }
 
 ##
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER
  2021-12-20 20:00 ` [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER Philippe Mathieu-Daudé
@ 2021-12-22  7:05   ` Markus Armbruster
  2021-12-22 18:27     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2021-12-22  7:05 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Kevin Wolf, Stefan Hajnoczi, Eric Blake, qemu-devel, qemu-block

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> Do not list vhost-user-blk in BlockExportType
> when CONFIG_VHOST_USER_BLK_SERVER is 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.

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  qapi/block-export.json | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/qapi/block-export.json b/qapi/block-export.json
> index c1b92ce1c1c..6bc29a75dc0 100644
> --- a/qapi/block-export.json
> +++ b/qapi/block-export.json
> @@ -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:

diff --git a/qapi/block-export.json b/qapi/block-export.json
index 6bc29a75dc..f9ce79a974 100644
--- a/qapi/block-export.json
+++ b/qapi/block-export.json
@@ -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' }
    } }



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER
  2021-12-22  7:05   ` Markus Armbruster
@ 2021-12-22 18:27     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-12-22 18:27 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Kevin Wolf, Stefan Hajnoczi, Eric Blake, qemu-devel, qemu-block

On 12/22/21 08:05, Markus Armbruster wrote:
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> 
>> Do not list vhost-user-blk in BlockExportType
>> when CONFIG_VHOST_USER_BLK_SERVER is 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.

>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  qapi/block-export.json | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/qapi/block-export.json b/qapi/block-export.json
>> index c1b92ce1c1c..6bc29a75dc0 100644
>> --- a/qapi/block-export.json
>> +++ b/qapi/block-export.json
>> @@ -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:
> 
> diff --git a/qapi/block-export.json b/qapi/block-export.json
> index 6bc29a75dc..f9ce79a974 100644
> --- a/qapi/block-export.json
> +++ b/qapi/block-export.json
> @@ -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!



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-22 18:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-20 20:00 [PATCH 0/2] block: Minor vhost-user-blk fixes Philippe Mathieu-Daudé
2021-12-20 20:00 ` [PATCH 1/2] qemu-storage-daemon: Add vhost-user-blk help Philippe Mathieu-Daudé
2021-12-20 20:00 ` [PATCH 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER Philippe Mathieu-Daudé
2021-12-22  7:05   ` Markus Armbruster
2021-12-22 18:27     ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).