From patchwork Tue Nov 7 18:02:39 2023 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: 741913 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1764829wrr; Tue, 7 Nov 2023 10:03:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIC+Rm9OWtQCc3xDPJjk2i/hWFpg3u9NyyYPGPkmxMf6tbhTtcFGFaCCOLthHDXM9yfNea X-Received: by 2002:a05:622a:198a:b0:419:5162:5e0f with SMTP id u10-20020a05622a198a00b0041951625e0fmr40653880qtc.13.1699380215929; Tue, 07 Nov 2023 10:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699380215; cv=none; d=google.com; s=arc-20160816; b=uCkBOlHFDUAWBYezDhf4FAuG4dIwFikU0T0ZkwJW+t7wgR+OxcfLoRr8jsd1HMJoOJ yQoYN+eGn8OvTruCjW7eAzlXXO0ooFnue+VN9i9R2JOI9IRvpr96l2rlUznwnUREii/U SE20S+8tj4M5SblelGqdIeBU5sCxulgMSMhYbgzzKKJfQyePCyhVQOHTvXFpIxxE0QGt ergMRYmPuDOlL52cEsWAMACqCEzC77LO7v0YTMpFAGFEfGme1IGtfr3sMObVOv4Yjd7O gPpJhFRjOfonuDKkMTBpORwM/4+E9HDZVdXEC8+NT67oVvW1nen2tjlbtXf813vlC/Kp N9rA== 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=7/NS4jzylqsR4woBmmhWZ8uZVX9wA7qTXVASTS+L4CQ=; fh=TJJmyUUgRcCZXtFwaXktCcgbc+ZTKj0atn5yhJf6P90=; b=Z3LypU2lZDBuN9j2u71aqli7i7WhSigtE2fIjag79aBt9IGuIAzhg/Ak9oSnx5Gl9g 9G6HWMGUjmK7o/N4IYJ+GEmKMvgbUlwEW0pDdF9xvZKWO2/ZlV6gD+w2kbTn92x9KZN1 K+nq8WNz/x6uYh1NBf3zbS2vJUom1JUDQPpyRKQMNMW9FbAy/Ohocywov7tbD0Lch+2c jFhx8/brIs0GvAEowwKkewmvGcM2nKulM6aGX1o3wvQgglO9bH+2iiyoMlbx7wV2+ucg nqTJB7kSvRLO5j9YPGOzzKWflemb91ENpIHZl0ZIsATJ0jGgXvrh3SHgcdmrEfEKxOpI VbpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uo5sBcrE; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 2-20020ac85902000000b004197e89b6e1si172802qty.474.2023.11.07.10.03.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2023 10:03:35 -0800 (PST) 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=@linaro.org header.s=google header.b=uo5sBcrE; 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=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0QPe-00085o-Gi; Tue, 07 Nov 2023 13:02:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0QPc-000859-F0 for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:02:52 -0500 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0QPZ-0000dU-JN for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:02:52 -0500 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c501bd6ff1so84439361fa.3 for ; Tue, 07 Nov 2023 10:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699380167; x=1699984967; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7/NS4jzylqsR4woBmmhWZ8uZVX9wA7qTXVASTS+L4CQ=; b=uo5sBcrEd0KVUGtPhp94ugnS70n1VvYn+0RBiDsBX2PCIpIk2061Y9cuuD1LY1zE28 JuglZCV9l50T7eeltJW0GNaArurw33ftWyFsqWFy1f58mNMbBbJBuStJunZNM5lx4bf/ 2NZlBWhmdax7wtWOcxEbjwKITdy7H12OB/htcpC6TGrcHzrK5F4epSJDacSirzZ3Z/g+ 5/AroVjEgrU0VL9lBrA6RjxRUUMHPPykxhhff69A0kAaxPpevMQQnP/DInzdk8c0tNZt OgrK1piNL9rmC0KKkGxWswxxGBd+4CXjHvZxhsdaIxDoWC5lNA0FR2vuhYHw4ETK0J1I 2jJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699380167; x=1699984967; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7/NS4jzylqsR4woBmmhWZ8uZVX9wA7qTXVASTS+L4CQ=; b=CKBpGHKEIZ9DAXElRoGZJCVLYjw7NLd+b6xDNOHiQ7XlvB3r36AUE+/vjl0Y0x57n7 mUViXyreNXZcb/I83XRQ39a6qFW0ZLdSrqyXSqxvJFSX2i8ARSgCnb96trNrg2Yx3dGD wx6Rlo3GSkyZqDzApuNR9IWE9c27ZeNgGuuHiRPWVLVJrso+wT0bUJbYpf6aF1dLrzSv 5bANoE9J+jzkESWNoCPeQbhqnz8UBFxIbPKXMm8KcYTASvV5su4uHyTW0q/6R2qICF3b 8vbHjoQE+4pj+SK4sk5lE4XWkSuZwo1mccT2eekfiBeRA1MbwLCXBVYW6Cs3ph1BU69r Fm5A== X-Gm-Message-State: AOJu0YwO4CNuWr0J8mscOf/OaX3d7tpmYAYm/Jy4G3MREnWXrMfTzMs+ jFsPlmUYOoXU7TM3LUcNTFpNxw== X-Received: by 2002:a2e:a793:0:b0:2c5:8b1:7561 with SMTP id c19-20020a2ea793000000b002c508b17561mr33035440ljf.10.1699380167523; Tue, 07 Nov 2023 10:02:47 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c021100b004053e9276easm16057705wmi.32.2023.11.07.10.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 10:02:47 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A31645F790; Tue, 7 Nov 2023 18:02:46 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Eric Blake , Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= , Fam Zheng , Jason Wang , =?utf-8?q?Dan?= =?utf-8?q?iel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-An?= =?utf-8?q?dr=C3=A9_Lureau?= , Viresh Kumar , Manos Pitsidianakis , Raphael Norwitz , Hanna Reitz , Erik Schilling , "Michael S. Tsirkin" , Mathieu Poirier , qemu-block@nongnu.org, Paolo Bonzini , Eduardo Habkost , Markus Armbruster , Stefan Hajnoczi , Mark Cave-Ayland , virtio-fs@redhat.com, Kevin Wolf , "Gonglei (Arei)" Subject: [PATCH v7 0/7] virtio: cleanup vhost-user-generic and reduce c&p Date: Tue, 7 Nov 2023 18:02:39 +0000 Message-Id: <20231107180246.3456598-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org A lot of our vhost-user stubs are large chunks of boilerplate that do (mostly) the same thing. This series continues the cleanups by splitting the vhost-user-base and vhost-user-generic implementations. After adding a new vq_size property the rng, gpio and i2c vhost-user devices become simple specialisations of the common base defining the ID, number of queues and potentially the config handling. I've also added Manos' vhost-user-sound while I was at it. Changes ------- v7 - various review comments - move to async teardown (fixes CI failure) v6 - re-base to current master - make vhost-user-device abstract - mention abstractness in docs v5 - addressing comments and tags - improved the docs v4 - dropped the F_TRANSPORT work for another series - added vhost-user-sound Alex Bennée (6): virtio: split into vhost-user-base and vhost-user-device hw/virtio: convert vhost-user-base to async shutdown hw/virtio: derive vhost-user-rng from vhost-user-base hw/virtio: derive vhost-user-gpio from vhost-user-base hw/virtio: derive vhost-user-i2c from vhost-user-base docs/system: add a basic enumeration of vhost-user devices Manos Pitsidianakis (1): hw/virtio: add vhost-user-snd and virtio-snd-pci devices MAINTAINERS | 13 + docs/system/devices/vhost-user-rng.rst | 2 + docs/system/devices/vhost-user.rst | 70 ++- ...{vhost-user-device.h => vhost-user-base.h} | 21 +- include/hw/virtio/vhost-user-gpio.h | 25 +- include/hw/virtio/vhost-user-i2c.h | 14 +- include/hw/virtio/vhost-user-rng.h | 13 +- include/hw/virtio/vhost-user-snd.h | 24 ++ hw/virtio/vhost-user-base.c | 354 +++++++++++++++ hw/virtio/vhost-user-device-pci.c | 13 +- hw/virtio/vhost-user-device.c | 338 +-------------- hw/virtio/vhost-user-gpio.c | 406 +----------------- hw/virtio/vhost-user-i2c.c | 272 +----------- hw/virtio/vhost-user-rng.c | 278 +----------- hw/virtio/vhost-user-snd-pci.c | 75 ++++ hw/virtio/vhost-user-snd.c | 67 +++ hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 23 +- 18 files changed, 719 insertions(+), 1294 deletions(-) rename include/hw/virtio/{vhost-user-device.h => vhost-user-base.h} (71%) create mode 100644 include/hw/virtio/vhost-user-snd.h create mode 100644 hw/virtio/vhost-user-base.c create mode 100644 hw/virtio/vhost-user-snd-pci.c create mode 100644 hw/virtio/vhost-user-snd.c