From patchwork Thu Dec 23 10:14:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12698074 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1DD79C433F5 for ; Thu, 23 Dec 2021 10:16:35 +0000 (UTC) Received: from localhost ([::1]:52680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0L9G-0000cw-3m for qemu-devel@archiver.kernel.org; Thu, 23 Dec 2021 05:16:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0L7U-0006fj-60 for qemu-devel@nongnu.org; Thu, 23 Dec 2021 05:14:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0L7S-0006rU-PN for qemu-devel@nongnu.org; Thu, 23 Dec 2021 05:14:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640254482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ayL3Y6gZm6XhBH2r4HXO5sw4wKPzmz4WxHL5sCFdC0w=; b=XlAAOruHSKdu+YB67H7kJvPWgE8NEpytNINmI5xGxQ1rjvICljNgxCL4u60lz4yGn+s20L HK6zKjqYan9Vt8jGXIPiSwhl6+gRwhFWjwrzpOlmJ7Azf+iO7pTVv2PMHZIx7zsE+pElE9 ci4j1xsX6E0RX/Sn6p9ETDYWZyIfWf0= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-544-7MhYPLvcODqM20vt7DEErg-1; Thu, 23 Dec 2021 05:14:41 -0500 X-MC-Unique: 7MhYPLvcODqM20vt7DEErg-1 Received: by mail-wm1-f72.google.com with SMTP id v62-20020a1cac41000000b0033719a1a714so1819624wme.6 for ; Thu, 23 Dec 2021 02:14:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ayL3Y6gZm6XhBH2r4HXO5sw4wKPzmz4WxHL5sCFdC0w=; b=E07lATqFHJGFXLAj/gaVbrcOuKcLOMZ6Hifx9R8dxRrxAPbtVlPwoPCLcCwNisEZ5b lQ56QpmpZQmah2jClTn4L6Ia7HacF3w+fb0GeWI0NB+FPAVe6flhbQZRFtEEE0+EfVRV DwiPQ+gNec0bAHCJWp3X2nNiEY24cutvx1Bjv+V06htkbR7sDrFPGsBvZUUnMqG7GkkU tmwiVd2kl9Zk4X0abVsVkEC5TepyjGyrNCQ87qHkhlbBqKiot31/fZCSCJDSj+1QJlco XJJOqDiTJId1uVpNJeTXGysNupowjJEUxDDr4YwNQ43nzMV+pegbPj4XEfLF9uhkfxhg 5yGw== X-Gm-Message-State: AOAM532chpcohsLvqs0oVCseJ73sQgHmuSQQdhqpoUUKmaZM4phB1eL+ AMCOZZA6EhAmb/Xu8suA8DSxTpckksbPUS+8+OrBQ2LyXIgbO/hVRpobz/4VcK8+nm4dFkfeZlX 0hF9g1NgY8CpZngczUXJLkVvci/WjTYw1GI4haxRdIE2x57kbsRKEka/CI6H/yHBh X-Received: by 2002:adf:e844:: with SMTP id d4mr1212965wrn.151.1640254479924; Thu, 23 Dec 2021 02:14:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzZ0UO5oY2YIF+4pXbv/1JYA2isTkwfvU1LoGnVF5/B17dvuFf7LivJ76OgR17ZBEyijJdhg== X-Received: by 2002:adf:e844:: with SMTP id d4mr1212940wrn.151.1640254479696; Thu, 23 Dec 2021 02:14:39 -0800 (PST) Received: from x1w.. (33.red-193-152-124.dynamicip.rima-tde.net. [193.152.124.33]) by smtp.gmail.com with ESMTPSA id s1sm7400975wmh.35.2021.12.23.02.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 02:14:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 1/2] qemu-storage-daemon: Add vhost-user-blk help Date: Thu, 23 Dec 2021 11:14:25 +0100 Message-Id: <20211223101426.3143647-2-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211223101426.3143647-1-philmd@redhat.com> References: <20211223101426.3143647-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Qing Wang , qemu-block@nongnu.org, Eric Blake , Markus Armbruster , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add missing vhost-user-blk help: $ qemu-storage-daemon -h ... --export [type=]vhost-user-blk,id=,node-name=, addr.type=unix,addr.path=[,writable=on|off] [,logical-block-size=][,num-queues=] export the specified block node as a vhosts-user-blk device over UNIX domain socket --export [type=]vhost-user-blk,id=,node-name=, fd,addr.str=[,writable=on|off] [,logical-block-size=][,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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Blake --- 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=,node-name=,\n" +" addr.type=unix,addr.path=[,writable=on|off]\n" +" [,logical-block-size=][,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=,node-name=,\n" +" fd,addr.str=[,writable=on|off]\n" +" [,logical-block-size=][,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" From patchwork Thu Dec 23 10:14:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12698075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C33B6C433F5 for ; Thu, 23 Dec 2021 10:16:38 +0000 (UTC) Received: from localhost ([::1]:52910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0L9J-0000mA-T6 for qemu-devel@archiver.kernel.org; Thu, 23 Dec 2021 05:16:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0L7d-0006oR-M0 for qemu-devel@nongnu.org; Thu, 23 Dec 2021 05:14:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0L7a-0006sD-FH for qemu-devel@nongnu.org; Thu, 23 Dec 2021 05:14:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640254489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N8Lqsw6/q5K/GsbrbDDFAAcbrQAsX6YJVuBetTcmBeI=; b=iYkZdtqSZWs29SVAQ2iIdy9haLaC+5TYvyZUWvyCSawP+pOzbN9zIAPIP+vf2hxijySkil J1b7eNpuVuZ3TjLMlOE1zgEhNDhDdUrvFIa8WlZN0dB4XAw4guzdp/CgbsXevbtoCLJKUR mwbuZ4H5KfpTUe5udEzKNwdnJv2VEBc= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-522-fDodpEWoOXiOh9NO4ogdeA-1; Thu, 23 Dec 2021 05:14:48 -0500 X-MC-Unique: fDodpEWoOXiOh9NO4ogdeA-1 Received: by mail-wr1-f69.google.com with SMTP id s23-20020adf9797000000b001a24674f0f7so1179575wrb.9 for ; Thu, 23 Dec 2021 02:14:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N8Lqsw6/q5K/GsbrbDDFAAcbrQAsX6YJVuBetTcmBeI=; b=K2ZgAVuFiHhN4VtfCvVBQwWUW2GNPX/wTEyDgG6o+giXElXVn0pNRtBQx+Hcxd2ehK Iyqz0IXzvQky8IRDVy/r9ygphdi5kjh7dDkDRzj913xgek3VZfO3MK8xVWbIx2KYkJgq qjyMEHve8E7kW//zO4CTcC+Emd/MhUhs8ETrCmNwfyEzQQlQDmDJaXCTuJgGqr3pD1Dd 7iFb9aiB/Bs/fg5HQjKb2nNrg3d0MhBMGunmhExJqmzdJN+rqxCK53xOFnLrtj6p4AYq nTl6qcPtv2TL32ui3jDNcLrkqik7i9KXnOZK4ROy1ocqt7RKf2F27VDZVsOGyU+Yrj/R gYdQ== X-Gm-Message-State: AOAM531bmk1u7UyZ/pMnekMFyVPBSSfueaSiFoMP0T75Tn0ftIdKmGo7 gFFWMyYEvz4iqBNdeyaldiigPYz7rotxnLC/UKE+XDSej+khLj3nQ26O3PVuB6U49egpEXTL5tV mJHdlpU/4RB+F13h1njkMutRqrCVwK2dpn1wYl3KCC40mY/S33e1/pG/ZvyUvk5cq X-Received: by 2002:adf:f085:: with SMTP id n5mr1260854wro.418.1640254487357; Thu, 23 Dec 2021 02:14:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuPiMDSO+/2Ya793k51CAu30dNj1ZMZB6VUUTNVzkq45z9Jqso+3uTbR2AvsA4pP73JnPSCg== X-Received: by 2002:adf:f085:: with SMTP id n5mr1260840wro.418.1640254487186; Thu, 23 Dec 2021 02:14:47 -0800 (PST) Received: from x1w.. (33.red-193-152-124.dynamicip.rima-tde.net. [193.152.124.33]) by smtp.gmail.com with ESMTPSA id r1sm5505403wrz.30.2021.12.23.02.14.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 02:14:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER Date: Thu, 23 Dec 2021 11:14:26 +0100 Message-Id: <20211223101426.3143647-3-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211223101426.3143647-1-philmd@redhat.com> References: <20211223101426.3143647-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Eric Blake , Markus Armbruster , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" When building QEMU with --disable-vhost-user and using introspection, query-qmp-schema lists vhost-user-blk even though it's not actually available: { "execute": "query-qmp-schema" } { "return": [ ... { "name": "312", "members": [ { "name": "nbd" }, { "name": "vhost-user-blk" } ], "meta-type": "enum", "values": [ "nbd", "vhost-user-blk" ] }, Restrict vhost-user-blk in BlockExportType when CONFIG_VHOST_USER_BLK_SERVER is disabled, so it doesn't end listed by query-qmp-schema. Fixes: 90fc91d50b7 ("convert vhost-user-blk server to block export API") Signed-off-by: Philippe Mathieu-Daudé Acked-by: Markus Armbruster --- v2: Reword + restrict BlockExportOptions union (armbru) --- qapi/block-export.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qapi/block-export.json b/qapi/block-export.json index c1b92ce1c1c..f9ce79a974b 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' } ] } ## @@ -319,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' } } }