From patchwork Tue Jun 28 04:42:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 585494 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp438000mab; Mon, 27 Jun 2022 22:28:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t2rY9NVUoNvP3AgTLxI8WJDWJW8Muw63BM1KwoyakHF/04315P73C3RBPpgVQFORVX4SM7 X-Received: by 2002:a05:6214:21c4:b0:470:4aa8:1eba with SMTP id d4-20020a05621421c400b004704aa81ebamr978133qvh.125.1656394092238; Mon, 27 Jun 2022 22:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656394092; cv=none; d=google.com; s=arc-20160816; b=A0B4BWu6Uz9BfjLoi5v0IY7rZJzLEFxdc8A3S5VSe5DpGCwm1xNfleC5wV34wisMWw s5w6Rdd0NroVm8osP/sgLJyQJS9MAwe3Wp1upvVQrT8zBmgzabs5TdjP7HtUeuEKmDD9 QE3lZMsqhqL5pSEuOVjx36D3pilZ3rfJNFCtzlxUQvCMVfKd/gS/EfWDhwvNM7UPCDU0 dbEbiVnlmnxBq2j/J2mSBbBB8trQG7nnISQfTsp1Q4PqIIp4q9DdYj8gLs1yFNAdXYsF GOFe549ce3h3VW3EB+dlzujFbaetVP8bfJcbkeEQ6jnfIOqikjCyogSyLBDs776jEAhS 4EcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PephaWAYB4wWrCOWcp9B8RIb1PHmOnQGuhXQJ5K1XL0=; b=o0s+nVc7a1XTmn6H4aCismIw5snhPG3VssBxvB5X51kZ24xGqNWFBP8OIjO2mdR+pg 4Rlb2njfC7vanSFIRaMbbsqyCsy0Xffn5J9DC9mveOPJvDsiRPXo+f1VF74acJI4fZ9D ez57H2BaPdjtQkZtgLK2FJwQQAkoC3oeYE83JXyv+dq5X8XkcKvMcFsWaZ7zflGLBwsm Ej+bs2rOH9waUnD5MjvjXL5XUgJBS41NPrK2/t7civznhgwWKxkqfLmknkHXDFSBkc7f cwle6UQJekXyJW25EGRfuS2c8sDzg1fXfcRcLYMkPY5aILJZze/N0O8SRV282bX/2GfE /Hrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ScNsksgf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 13-20020a05621420ad00b004702ed40a61si6542196qvd.547.2022.06.27.22.28.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jun 2022 22:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ScNsksgf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:60376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63lj-0005Rx-N6 for patch@linaro.org; Tue, 28 Jun 2022 01:28:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634E-0000PN-6W for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634C-0006td-Ec for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391391; 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=PephaWAYB4wWrCOWcp9B8RIb1PHmOnQGuhXQJ5K1XL0=; b=ScNsksgfAPCvTSN4UVSyBaiIAUDfhMr9m6KdkS2+K6RF/YoyKU3BWh7sqQHuy/vorQFmSp FsQprPXAe8MINfo8rIKevepGfLzs3ttZ9fcJ1lmhEnVg3iptpsN8ctoY9Ch/lqD0wkj5bd utD0cqiFti41T3e1WivGvUHjdwIhdz4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-524-8BfHnBxZMECElNPyUegGFg-1; Tue, 28 Jun 2022 00:43:02 -0400 X-MC-Unique: 8BfHnBxZMECElNPyUegGFg-1 Received: by mail-wm1-f71.google.com with SMTP id az40-20020a05600c602800b003a048edf007so2174085wmb.5 for ; Mon, 27 Jun 2022 21:43:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=PephaWAYB4wWrCOWcp9B8RIb1PHmOnQGuhXQJ5K1XL0=; b=L+Fv01Rv+MVEHOi47s5vUr6Fnpsfp+gYiApmfYF8DM4xY27ILNHydPExqPdxfBR1OT PGpkErFoGaD2e6HpBMcltZNErohAO3tzRFyHGJfON0N5X2vLhOT4gjkj0xL5l8jdmw2n WGwSwi570gYQC6onA7+8CjujBTCPi8ihrGjJH7K2deyZOUjGD9z8nntl0u/47bUCez8T j9jh90EmB6eZRlBXDnwxK2qNW5T9XhEpy1TBksHw/tnWkMpkcORuDX/4OEPepaAGFoFt sh9UQmpgHbIgCrVQFMW8wk8XAv2Tdy7wpfe3aujDNO7VWLEc2revqK+E5xzhpQYDRtLI OFNQ== X-Gm-Message-State: AJIora+KEvh/Nti2cnrBWM/CHU5neiSTyze8GrrTOxQN2Ib9XuNclW48 VEZJzwtFdnsFZzoqWBfGxr5aYu2rkf3XZLW9bhmGzsAGNqydTmgGFL04TEc+yQLbSwlip2O+jvo 96yBKk8yAzQCGUyPew8CfLO0WKiZWgZqjUpPPdM6jC0je+z3YvbLbJjDQADdB X-Received: by 2002:a05:6000:1f87:b0:21b:970b:e88c with SMTP id bw7-20020a0560001f8700b0021b970be88cmr15772685wrb.320.1656391380595; Mon, 27 Jun 2022 21:43:00 -0700 (PDT) X-Received: by 2002:a05:6000:1f87:b0:21b:970b:e88c with SMTP id bw7-20020a0560001f8700b0021b970be88cmr15772664wrb.320.1656391380283; Mon, 27 Jun 2022 21:43:00 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id r11-20020a05600c35cb00b0039c4ba160absm2364281wmq.2.2022.06.27.21.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:59 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:57 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?q?Benn=C3=A9e?= , Stefan Hajnoczi , Raphael Norwitz Subject: [PULL 10/12] contrib/vhost-user-blk: fix 32 bit build and enable Message-ID: <20220628044201.217173-11-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée We were not building the vhost-user-blk server due to 32 bit compilation problems. The problem was due to format string types so fix that and then enable the build. Tweak the rule to follow the same rules as other vhost-user daemons. Signed-off-by: Alex Bennée Message-Id: <20220321153037.3622127-12-alex.bennee@linaro.org> Message-Id: <20220524154056.2896913-2-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Reviewed-by: Raphael Norwitz --- contrib/vhost-user-blk/vhost-user-blk.c | 6 +++--- contrib/vhost-user-blk/meson.build | 3 +-- meson.build | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c index cd4a5d7335..9cb78ca1d0 100644 --- a/contrib/vhost-user-blk/vhost-user-blk.c +++ b/contrib/vhost-user-blk/vhost-user-blk.c @@ -146,7 +146,7 @@ vub_readv(VubReq *req, struct iovec *iov, uint32_t iovcnt) req->size = vub_iov_size(iov, iovcnt); rc = preadv(vdev_blk->blk_fd, iov, iovcnt, req->sector_num * 512); if (rc < 0) { - fprintf(stderr, "%s, Sector %"PRIu64", Size %lu failed with %s\n", + fprintf(stderr, "%s, Sector %"PRIu64", Size %zu failed with %s\n", vdev_blk->blk_name, req->sector_num, req->size, strerror(errno)); return -1; @@ -169,7 +169,7 @@ vub_writev(VubReq *req, struct iovec *iov, uint32_t iovcnt) req->size = vub_iov_size(iov, iovcnt); rc = pwritev(vdev_blk->blk_fd, iov, iovcnt, req->sector_num * 512); if (rc < 0) { - fprintf(stderr, "%s, Sector %"PRIu64", Size %lu failed with %s\n", + fprintf(stderr, "%s, Sector %"PRIu64", Size %zu failed with %s\n", vdev_blk->blk_name, req->sector_num, req->size, strerror(errno)); return -1; @@ -188,7 +188,7 @@ vub_discard_write_zeroes(VubReq *req, struct iovec *iov, uint32_t iovcnt, size = vub_iov_size(iov, iovcnt); if (size != sizeof(*desc)) { - fprintf(stderr, "Invalid size %ld, expect %ld\n", size, sizeof(*desc)); + fprintf(stderr, "Invalid size %zd, expect %zd\n", size, sizeof(*desc)); return -1; } buf = g_new0(char, size); diff --git a/contrib/vhost-user-blk/meson.build b/contrib/vhost-user-blk/meson.build index 601ea15ef5..dcb9e2ffcd 100644 --- a/contrib/vhost-user-blk/meson.build +++ b/contrib/vhost-user-blk/meson.build @@ -1,5 +1,4 @@ -# FIXME: broken on 32-bit architectures executable('vhost-user-blk', files('vhost-user-blk.c'), dependencies: [qemuutil, vhost_user], - build_by_default: false, + build_by_default: targetos == 'linux', install: false) diff --git a/meson.build b/meson.build index a113078f1a..65a885ea69 100644 --- a/meson.build +++ b/meson.build @@ -1516,7 +1516,7 @@ have_vhost_user_blk_server = get_option('vhost_user_blk_server') \ error_message: 'vhost_user_blk_server requires linux') \ .require(have_vhost_user, error_message: 'vhost_user_blk_server requires vhost-user support') \ - .disable_auto_if(not have_system) \ + .disable_auto_if(not have_tools and not have_system) \ .allowed() if get_option('fuse').disabled() and get_option('fuse_lseek').enabled() From patchwork Tue Jun 28 04:43:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 585495 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp438371mab; Mon, 27 Jun 2022 22:28:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sxhIM2iDrZVZfmj/FBRcwUdYxKD6/PrgU4sNaObOdsnB1/Dh3gET8/AEeXVA6d5l2weltW X-Received: by 2002:a0c:e3cd:0:b0:470:5aec:e158 with SMTP id e13-20020a0ce3cd000000b004705aece158mr2294838qvl.42.1656394134166; Mon, 27 Jun 2022 22:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656394134; cv=none; d=google.com; s=arc-20160816; b=RVvigq94j9Y85rCWZNMQ4eXLeDWmKkxXcLR/Vr1n9ly3t4GCdA6sb7kRl0udNNt5TG p5LD1c8Cd6BlgOD7c7bbpN9g52cwoe8a2VljfodLDR4MfpZD70+2TiIcr4dgYff/G3Ty /J06lMvjg0JrdYzf8q2oLgA7q6dBN2N558Rb1KhIJv8QOUQDcPrFK6vw0rVNFI3ZBI47 EXe7qY3yTQC+sAT4IhNZVnR4xyyEYWEZYlW+JAGDeg+H0sSIUwX+oa0ub3ChTKyLHBOP 0Y1ewK/pxIUNeFBhIZGirGW2R5gnxVxdbihgClH+R3itQZSCc3DvkLQoiXBCl9dCzilB xukA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0F75Xkg7ztQgcowiItypu8oAqV/zHE5jhJdNwWc/ppM=; b=ya6buAgpFYKXtR1vLt2x5qr1LQMmrS3kAKdvJRELrPELvew2ReCptRh+nhYVVg7nth nkUo58kpYga2Dv/NyrbPgBYGQqOP76jdcxDeJHo0OBUACjKc4pEr8HUBj1CdL/62D96W W9dpv85Gvhbd0PI4xZTJSXZOm7iwf+gVXf/WWwYUFEqKu7wDr+aWto+AKWB5uHID57z0 wa/z6olvaG+GYRqd3DSxQGiIlnCRVc0uE+0X4Y6Vw2NbDyyC8faW0kMNiwulMQdSG1SR rjtjiRDKjbCQKpav1RVAuOZh96FwaPc7+3UYLhFHbV4SzQoRn6lwNILKiYW27+ExPgUV s2yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="I+23pb1/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id js10-20020a0562142aaa00b00470470cabe4si6244156qvb.199.2022.06.27.22.28.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jun 2022 22:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="I+23pb1/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:34628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63mO-0007JH-41 for patch@linaro.org; Tue, 28 Jun 2022 01:28:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6348-0000GB-JJ for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6347-0006tL-3C for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391386; 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=0F75Xkg7ztQgcowiItypu8oAqV/zHE5jhJdNwWc/ppM=; b=I+23pb1/J8Xp/Zl59+7LUKyFuIfxTt6faj+qiz9OkqDI+VYzeaXeOj0jQeix7Wd6BIktbL VB1WGLhv2O/o5GZpGNVgzmASvLk2Jdy32qcPfoM187bTQYKu7T866NZLHpVkhp2EP6vxzd OCLiZvGNOYdeH3U2/2wKkFAwzf1X3Ls= 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-671-xyduXKGIP9KdeBm5qPU2tw-1; Tue, 28 Jun 2022 00:43:05 -0400 X-MC-Unique: xyduXKGIP9KdeBm5qPU2tw-1 Received: by mail-wm1-f72.google.com with SMTP id m17-20020a05600c3b1100b003a04a2f4936so2607222wms.6 for ; Mon, 27 Jun 2022 21:43:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=0F75Xkg7ztQgcowiItypu8oAqV/zHE5jhJdNwWc/ppM=; b=t74tFIi8vJTytdCHiPRVshqVeJYwKvZm3wDGNf87vv54jYsaepfphCiF/Y+Afnr4sb O7mJD+HGs+ZmF1btBz/ctq+BR3UzoVCB9Bb1hFmRsI5Jybij6u9zitwNFO5q75IdSOH8 lbsfqMPATrf+c+bVidMcSlGNmDkxNAN88z+Yiav2ukXDMwiNx39Y6EBi5f9qDkTZhLzh VWIa2EqL4rrZ3E51Eyubjn3wpnL3fTIWyoeZghM7XY/2my9/c1wGtwq43rQGBR7Wr5Fc cd+RHieQVlCUoC2TWSa2oyd/vNwqniDmkwZMTvUOH/HsaBZ6zR0ENmChEjTHN8QC9ycC e4BQ== X-Gm-Message-State: AJIora8Mp9nyqbzaXUTbenD2OHcpQe2nB5LuyX+L9V7qxbqMRi8hvdg5 cM7OrWZnwhb32jHPJlQ05b/xD/tpFcYy8QSvQC60oAY0hPCS5ihITuJTBjGNk1OHrz3oErAyJ2C 4p1ORk2cIfJbKcqqYOtxPeBz/uYRcLJtrV2FJufqDr7hHv4Z7omu7eQm2plUn X-Received: by 2002:a1c:7414:0:b0:3a0:201c:5b7f with SMTP id p20-20020a1c7414000000b003a0201c5b7fmr24007167wmc.170.1656391383667; Mon, 27 Jun 2022 21:43:03 -0700 (PDT) X-Received: by 2002:a1c:7414:0:b0:3a0:201c:5b7f with SMTP id p20-20020a1c7414000000b003a0201c5b7fmr24007146wmc.170.1656391383453; Mon, 27 Jun 2022 21:43:03 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id t11-20020adff60b000000b0021b962f4256sm12109445wrp.80.2022.06.27.21.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:43:02 -0700 (PDT) Date: Tue, 28 Jun 2022 00:43:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?q?Benn=C3=A9e?= , Stefan Hajnoczi Subject: [PULL 11/12] include/hw/virtio: document vhost_get_features Message-ID: <20220628044201.217173-12-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20220524154056.2896913-4-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi --- include/hw/virtio/vhost.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index 1e7cbd9a10..bfc71b7c50 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -247,6 +247,17 @@ bool vhost_virtqueue_pending(struct vhost_dev *hdev, int n); */ void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n, bool mask); + +/** + * vhost_get_features() - return a sanitised set of feature bits + * @hdev: common vhost_dev structure + * @feature_bits: pointer to terminated table of feature bits + * @features: original feature set + * + * This returns a set of features bits that is an intersection of what + * is supported by the vhost backend (hdev->features), the supported + * feature_bits and the requested feature set. + */ uint64_t vhost_get_features(struct vhost_dev *hdev, const int *feature_bits, uint64_t features); void vhost_ack_features(struct vhost_dev *hdev, const int *feature_bits, From patchwork Tue Jun 28 04:43:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 585498 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp442557mab; Mon, 27 Jun 2022 22:36:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sr7LPwSSwuXkbpjpIGqW8oPoMXXM3dECGhbh6Z4TgtV0q5K5kV20bxYmAWeA716ljCSQwL X-Received: by 2002:ac8:5c46:0:b0:315:a78a:4cb1 with SMTP id j6-20020ac85c46000000b00315a78a4cb1mr12308778qtj.560.1656394577164; Mon, 27 Jun 2022 22:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656394577; cv=none; d=google.com; s=arc-20160816; b=bJyRa1OibwgwwTuus4drjhacpfJ+TNWEsYkaTsq4payhE8LrBtDxrKNQlD/x2J9pXe FkrvlF3K8jlrSjqvVa7A2yn4n5Ja0lr3yvmc96yAZikVfBQ6X0Vpf7ItdNft73xihdcC sKNG+QovFYN6tsGWvNkjo9WOYFXw3VtPxkZwmUj1InSpoJONepEHS/stDV93IsmJ8xOa 1Kse+apz1RZGtjmBK0N8AnCshitFf07sCVRv5B/M11FI/YzZm0U3Xwc1fbT9429/TUdK DsarX8mxxr29qy9eK+wcvHghaMV+wUfRQcURIqDQmhkTvZvRTNdMLarVgKotpwj7yjCP evRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Mn/g7m0RmM5cceBjPMwfMkeTDlaWZwcXKTll3LlqMLQ=; b=YtTt3y5NaF85W6cmKRf2q+G1rAg6CYDf4XGgGv0ydHLSFXUOBTAYyWZA/yi0mR9AiD Af4GMnYd81vbOXjU5XiqH34SgLDQ8KK8NlonDkM5r06iytsE46qP8dlLkzY1yv+9XiFM ds+P+lVidqhxCHt/EoRI6MRK6MDupKWtAY/U8wCvl8aP2vK/DID1kvEbAjHiRVgL928j lADNr0lTuPQNSKneuFYgZCT+bgHA6LsXdNXpbPyDMHWo3VSunZxZ+1g/VqXxH5WE8PAC w1bL+YTTCYLxaAuSt4xgxZ7Z7DBG6LjKRZIa+BTQrTkr6AWxhp/klFS0dLmK3jK05JFs vcqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N90Ej6LP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d19-20020ac800d3000000b002f93c4a2337si6244620qtg.472.2022.06.27.22.36.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jun 2022 22:36:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N90Ej6LP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:44400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63tY-0005hw-O4 for patch@linaro.org; Tue, 28 Jun 2022 01:36:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634D-0000NF-Jv for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:37865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634C-0006tY-1a for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391391; 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=Mn/g7m0RmM5cceBjPMwfMkeTDlaWZwcXKTll3LlqMLQ=; b=N90Ej6LPlPewDm/o07wgXGkw6l9omowsS31ACDq7OZbyUiKO6VMaIEax2GARAUWCJo8s8Q EQWZcU/QNdFbfsBbOJ6K0Yb034tF2LCr/Gi9inho2sbYS4pEUCW9lbxJl92heE+cPS/sJf NFL6BDAvvpi36OO7Skr0dl87EZ+dfIY= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-m4bKAoQ-OyCNv69Ot8YPZA-1; Tue, 28 Jun 2022 00:43:08 -0400 X-MC-Unique: m4bKAoQ-OyCNv69Ot8YPZA-1 Received: by mail-wm1-f69.google.com with SMTP id z11-20020a05600c0a0b00b003a043991610so4282223wmp.8 for ; Mon, 27 Jun 2022 21:43:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Mn/g7m0RmM5cceBjPMwfMkeTDlaWZwcXKTll3LlqMLQ=; b=kIQoQcvlHHPsF2+cJ6WmZbKv5IS7lbRj1iEMcHIELNVLZxWvEm+3D5Fr/bf95QjMpB zksYuJf0b8VmlDv/3NIgKKIC0J3FZIsy4FqsZWqCYzHs9Vcelv54jIq+qravJRI9DQl+ aZE59w76ImlwM/Q0WUbhN4goUjbPwL4ZuOSHnhf0R9Jja27k6CA41NOXndqns60qGFgX VAD2D2fif3JRakjoN8JsSZFNPcVWycwZVnFpMQ3KFLFeVKS6qATUWDt5RmkklT9ntPFQ Xl9Hk1ey4lxEeHi2SpPfBRyWWbOx4QI7s8JyeoIyRMKrYJx3I3YHRSxUkeQhIkIKpr0O Jmmw== X-Gm-Message-State: AJIora+UIa0hksoSAQ13fQEi8CC6lNVJQsBia4A9qs0vn+Fyekk48mwl 1UkXgIg4rMK9ItHR2Pv+Snr3mhWwVNg+LPANJ49mw28p3M7DScRL+XR74geUvksXGNoa17fQtwS 0JNt8+rCCKkKD1bhIRpQcpzj9ksU02sk7VjVJPNFvTHw+BZRsfvVug7uJmy5U X-Received: by 2002:a05:6000:911:b0:21d:2100:b97b with SMTP id bz17-20020a056000091100b0021d2100b97bmr274225wrb.649.1656391387402; Mon, 27 Jun 2022 21:43:07 -0700 (PDT) X-Received: by 2002:a05:6000:911:b0:21d:2100:b97b with SMTP id bz17-20020a056000091100b0021d2100b97bmr274209wrb.649.1656391387143; Mon, 27 Jun 2022 21:43:07 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id n12-20020a5d6b8c000000b0020c5253d8fcsm14641936wrx.72.2022.06.27.21.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:43:06 -0700 (PDT) Date: Tue, 28 Jun 2022 00:43:03 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?q?Benn=C3=A9e?= , Stefan Hajnoczi Subject: [PULL 12/12] include/hw/virtio: document vhost_ack_features Message-ID: <20220628044201.217173-13-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20220524154056.2896913-5-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi --- include/hw/virtio/vhost.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index bfc71b7c50..a346f23d13 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -260,6 +260,16 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n, */ uint64_t vhost_get_features(struct vhost_dev *hdev, const int *feature_bits, uint64_t features); + +/** + * vhost_ack_features() - set vhost acked_features + * @hdev: common vhost_dev structure + * @feature_bits: pointer to terminated table of feature bits + * @features: requested feature set + * + * This sets the internal hdev->acked_features to the intersection of + * the backends advertised features and the supported feature_bits. + */ void vhost_ack_features(struct vhost_dev *hdev, const int *feature_bits, uint64_t features); bool vhost_has_free_slot(void);