From patchwork Mon Mar 21 15:30:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 553348 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp1614113mag; Mon, 21 Mar 2022 08:43:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB3m9+TRh7c2YwZgcG+uuaQUj7rHvLSxFl0shbZRNiuTHaAEFjSZpJdVsk+3YYjoqoifIl X-Received: by 2002:a05:622a:294:b0:2e1:a763:dab4 with SMTP id z20-20020a05622a029400b002e1a763dab4mr17037151qtw.467.1647877413215; Mon, 21 Mar 2022 08:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647877413; cv=none; d=google.com; s=arc-20160816; b=BReNVuX2vgsT4sr/rslEJWut71ZN7XLTZyxTw3RsPXCwa7RfiRMMkUM5PkW+OdExQk YAp5he/l1mO48Y6Jk8aQHcPwNhgY3FAe5jl19O8zx+h4nik3K+BCK6dlG0OaXf6jZQeG aoi7QoJLhTgjoBaUnx62miMTOvAvciD9jKUKllcW9zQwa7+dbcPD8HK/EIDNabAb5m10 LGMU+6TKV+MWykE1nu7ruNEuX66Dr7EMoKZaP3mAzA1j9nvndWSBQVZwxJmyxDxrbAFl Oj/rEAqcp5wUlAxnjcrn6sPPzT5eJh7Zjvxxxbpe5AFuL85gevv0kse6qTZ8jZH9Blmd kfrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=948AQ9lrmyvD+2c2nr+9RlA46f0hdo10UMuataFfsRU=; b=vPE7dreKTTkC67VG4q1/QEvEznuJMtf+B2Al6eyNWBBe7hMJ2xhC9b5ekL78Da79ss 3XHoAnppg/jLhpC+f0sjr0Iv7Uf5FnXguCwkF3b/tXRF1UeZzqXjSQIl1f0ch+V9upa7 bDz+Mg5P2fCVZ6ogflb9pZEqEfGf9zRK2yEPgRoV9A2HDlF2IDLxxKyAlhfWc/mZys36 2i9nRpcw+15gn6TuyiXw0x9emqYHRo/iYFva1+9x6O4TCRY73dHKtGkecNkf8JCItQJO j1/WoKDjh8FQNT2e/SF58BSrQGhByvTpeNOIEbENfMIA27c19WbdnnJJ3lqbMR43f810 XKtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xelr0pTx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ca16-20020a05622a1f1000b002e204c86372si2223181qtb.763.2022.03.21.08.43.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Mar 2022 08:43:33 -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=fail header.i=@linaro.org header.s=google header.b=Xelr0pTx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWKBw-00082I-Qj for patch@linaro.org; Mon, 21 Mar 2022 11:43:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWJzk-0005GT-W6 for qemu-devel@nongnu.org; Mon, 21 Mar 2022 11:31:01 -0400 Received: from [2a00:1450:4864:20::629] (port=33530 helo=mail-ej1-x629.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWJzj-0004wh-F3 for qemu-devel@nongnu.org; Mon, 21 Mar 2022 11:30:56 -0400 Received: by mail-ej1-x629.google.com with SMTP id pv16so30690030ejb.0 for ; Mon, 21 Mar 2022 08:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=948AQ9lrmyvD+2c2nr+9RlA46f0hdo10UMuataFfsRU=; b=Xelr0pTxmYIiVRbJMSe2a/MoboK6+/HNCCAERBi1Ps/Fxo9RaDrZ5E10byv9UIeLph fo8TO7tAleC7+LlbyinmLJeouUCMa/tqRFtNOij6n9y94KlC8vF9ubFX9CUKmQqavWxe VU1/zjwVoKio7j/opXdOhoD/5v8VvcTzkXAH51Zn1gLZyhYeyNZgptwf7shS6dNOYkBD lLprot8G5fvKVVxUsL4Sxzyb79VKWBQVJK2GYjXBKfSsxfho/2bJjqQU+m8g6Auu9QEY rSzvBEwiH8qBftcNglkQ2VVoVy36t5PMH2ZVy75UjZfZvav3Pjmm5cxsfh2CrIUOKDB5 L7kQ== 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=948AQ9lrmyvD+2c2nr+9RlA46f0hdo10UMuataFfsRU=; b=c8UOD5v9MZ/5unLGxaP6wLVHKlWmW6BWID2FehuQ2vRpdGtWYb/Cgp9RTfsWN0ueYe lSLfMDoAk59LZDpYvilsDEIegp1R9RKFTaNqkjSttlbYrScfuPkpTLslWQP4u2wrpmvD h50pKqp0J8znWFqp/dCwikgia9cbji+w+eEGzN6ItTB4J34W5EiCj33Xvm57rkB6IX4J lbTYhZH+88lAIM5tPL5B3/ZwUKwMreIoKTWGRXZR3XAXz6bMnaEyEhJqCeV6d1Q33z7U 8L7721ZL1aucNilpS1eueiyVvDPPr5y3qr/TcrmU2fCKyM/DrYR9O6vpQoqGHdTlAzQz aN4g== X-Gm-Message-State: AOAM531MRxo1+AGoXyotW6SceL9w0lhtOTW69KrEop0dWuiXaQvDt7VT tU5uZN5S9XVhbZqg7UrDvIyPzg== X-Received: by 2002:a17:906:9b93:b0:6da:6388:dc57 with SMTP id dd19-20020a1709069b9300b006da6388dc57mr20998595ejc.338.1647876652031; Mon, 21 Mar 2022 08:30:52 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id bd12-20020a056402206c00b00418c9bf71cbsm7887171edb.68.2022.03.21.08.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 08:30:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 66C071FFC0; Mon, 21 Mar 2022 15:30:38 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 08/13] libvhost-user: expose vu_request_to_string Date: Mon, 21 Mar 2022 15:30:32 +0000 Message-Id: <20220321153037.3622127-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321153037.3622127-1-alex.bennee@linaro.org> References: <20220321153037.3622127-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::629 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: slp@redhat.com, mathieu.poirier@linaro.org, mst@redhat.com, viresh.kumar@linaro.org, stefanha@redhat.com, marcandre.lureau@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is useful for more human readable debug messages in vhost-user programs. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- subprojects/libvhost-user/libvhost-user.h | 9 +++++++++ subprojects/libvhost-user/libvhost-user.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost-user.h index cde9f07bb3..aea7ec5061 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -473,6 +473,15 @@ bool vu_init(VuDev *dev, */ void vu_deinit(VuDev *dev); + +/** + * vu_request_to_string: return string for vhost message request + * @req: VhostUserMsg request + * + * Returns a const string, do not free. + */ +const char *vu_request_to_string(unsigned int req); + /** * vu_dispatch: * @dev: a VuDev context diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index 47d2efc60f..c218f911e7 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -99,7 +99,7 @@ static inline bool vu_has_protocol_feature(VuDev *dev, unsigned int fbit) return has_feature(dev->protocol_features, fbit); } -static const char * +const char * vu_request_to_string(unsigned int req) { #define REQ(req) [req] = #req