From patchwork Thu Jan 4 21:09:34 2024 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: 759872 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp7182943wrw; Thu, 4 Jan 2024 13:10:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8+Uh3s8cCrIYA1RoNjPXWATKhDsieMVRDB8qYW24rrMyFv6WtKLrSPpUQ6uTBHS2IvvPh X-Received: by 2002:a05:6808:17a6:b0:3bc:29da:fc11 with SMTP id bg38-20020a05680817a600b003bc29dafc11mr1306903oib.60.1704402629737; Thu, 04 Jan 2024 13:10:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704402629; cv=none; d=google.com; s=arc-20160816; b=pviyoPmjB66ShWn3M2pNQT9xXOewh/bdH7eigtlipR8xSOOiE1H0kpg0Sa5yMfOvb9 FEgavaPVDIXAfLOo83CT3NA/rjlm1Sw6klRbs1Mf8oN2nXylrZWft//uSxscr0vVTq+j grBGQlrTbyweQxSRyFTOX83KJLuQKc8j3+lQNi6CkptO7Gaorka0ul1rA1OxEVymgXOB saeSQUMczRIVIJIIGSnk6KKJYW48lZ8pwUAgqANWw/7axdyPyB8/R4DirLnLaP8Xy5ZS Uh8HCfmNWy/+CwOVQYs/ZL3+LYQ3SMVD6Qg+QFXejOOA0C+sz5yFrB62BuNv27eQsos6 v9RA== 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=mmocIxVHM9Ec8y34XjBRHTx+9ZyDi8yaIR+1yW6fQco=; fh=FJgCuuUiQlhQb75y4DqgTcYU/2dmCchdcJEae1kKAEw=; b=VlBIPXAPdp380C4A4njThIODXyc6x2qO+KUNHHTHUnw+JG14AHHcd4DZ/JBvhQZGCX /sQ8Bm9bnsZ8DjxEo85IY5byXBedRPmaTGyLHOw6/7OznoLG7LskMxf9agKWr/1IBpAs BBqwBdAtuBY51MsyPBB474o6cXP4h0Ghs4Dtv7fwN9qcLyNVwjaq/6BlPEkGSbthmicP Uz+gS/LbQfUsBo0Q5//IvlcK/3aDOY7Oed+c3Zk11ICS0UJqKH1MPKJiQ9XO1NgoVf6S BvFOP3jgcLm050BKmlHW7HF3Ct03Imnuzc2ebkA6T24Jetosld19mdjCdqn23gyWAmIb Pn9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C0udZ34v; 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 a6-20020a0cca86000000b0067f727f401fsi292297qvk.310.2024.01.04.13.10.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jan 2024 13:10:29 -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=C0udZ34v; 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 1rLUyO-0006u5-Pe; Thu, 04 Jan 2024 16:09:52 -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 1rLUyM-0006tU-3G for qemu-devel@nongnu.org; Thu, 04 Jan 2024 16:09:50 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLUyK-0007R7-1g for qemu-devel@nongnu.org; Thu, 04 Jan 2024 16:09:49 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e36bd5643so2515435e9.1 for ; Thu, 04 Jan 2024 13:09:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704402586; x=1705007386; 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=mmocIxVHM9Ec8y34XjBRHTx+9ZyDi8yaIR+1yW6fQco=; b=C0udZ34vvtUAJl26VaUFV3z2ZfcTzzOECBc6tCiQOs9ecNFntH2m+FYW+LgKHk0O+4 m/iDUBUMtE+Rd/E3i7iIP7FkfzqNaKx8jHchz8cTbWjz49fPDjGlQIM3yPivVBP9G8C7 +jC0d0Vwwi6WH1JnEP/GvjvLCrTV3XkstLXVmThSYH+FkTr6ga8/dCHiMN21EuPAHIsS bC3xyVfM1rZyWQzigTA9RoBFhqC9i8mgtrWjSHHtfXYEkclldKT2jGRhrFB3YeXuQ8FT MiByxvvtwEnckPDdGNLP+UrCG87jWlmb+ePR8TzVF1DdeYEbUSuEQ6QOY/ZcuLZyBeof Ur4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704402586; x=1705007386; 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=mmocIxVHM9Ec8y34XjBRHTx+9ZyDi8yaIR+1yW6fQco=; b=S53B/cUBKCICiYvHVSae0qqgHY0gk117JoTSOSoxMhIMx0LHZcFYjAzIDUMEfFXi4h UI1l3svDeKLXpFmC98NNUFs9Q1Hegan/pN3zPXNl+SPUVRQbwniUKAuuVikGOhgck+bX dKdF1/fuBQ1iZfGkjjwPL29B85gYTe8l2LJQP5d1fwhI3itIuBdTdP62FZtZVWtiZL+M PLIpdUuwfaOcLMKOxNu+SayasxsWMAJBPSdO4s0ZuGunx38K6JMfE72Eq8sg30Foss+c V0l53dqg0p+RTnF7eYx8heyjyG6IUaM2AY3PeGQaDMjmP+SkZ2n8ubIGtQjXL3czFEIH HD+A== X-Gm-Message-State: AOJu0Yw01+xw4VrG81FUf4meJOxdVlKdGeVHaHLg/0mKbJ884ijKMC36 fUV2s+mQ4q9/rNbkU7El75N8SZAsPZh6AQ== X-Received: by 2002:a05:600c:1e01:b0:40d:86ab:2b00 with SMTP id ay1-20020a05600c1e0100b0040d86ab2b00mr667812wmb.123.1704402586061; Thu, 04 Jan 2024 13:09:46 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h8-20020adfa4c8000000b003375083ff8esm109398wrb.32.2024.01.04.13.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 13:09:45 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1244A5F92F; Thu, 4 Jan 2024 21:09:45 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Mathieu Poirier , Kevin Wolf , Mark Cave-Ayland , Jason Wang , Erik Schilling , Eric Blake , Fam Zheng , =?utf-8?q?Marc-?= =?utf-8?q?Andr=C3=A9_Lureau?= , Eduardo Habkost , virtio-fs@redhat.com, Hanna Reitz , =?utf-8?q?Alex_Benn=C3=A9e?= , Manos Pitsidianakis , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , qemu-block@nongnu.org, Markus Armbruster , "Gonglei (Arei)" , "Michael S. Tsirkin" , Raphael Norwitz , Paolo Bonzini , Viresh Kumar , Stefan Hajnoczi Subject: [PATCH v9 00/11] virtio: cleanup vhost-user-generic and reduce c&p + vhost-user-input Date: Thu, 4 Jan 2024 21:09:34 +0000 Message-Id: <20240104210945.1223134-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::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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=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-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 and Leo's vhost-user-input stubs which are based on the same base. Changes ------- v9 - re-base and fix conflicts - add Leo's vhost-user-input series v8 - scrubbed errant Message-Id 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 Leo Yan (4): hw/virtio: Support set_config() callback in vhost-user-base docs/system: Add vhost-user-input documentation hw/virtio: Move vhost-user-input into virtio folder hw/virtio: derive vhost-user-input from vhost-user-base Manos Pitsidianakis (1): hw/virtio: add vhost-user-snd and virtio-snd-pci devices MAINTAINERS | 16 +- docs/system/device-emulation.rst | 1 + docs/system/devices/vhost-user-input.rst | 45 ++ docs/system/devices/vhost-user-rng.rst | 2 + docs/system/devices/vhost-user.rst | 72 +++- ...{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 ++ include/hw/virtio/virtio-input.h | 6 +- hw/input/vhost-user-input.c | 136 ------ hw/virtio/vhost-user-base.c | 371 ++++++++++++++++ hw/virtio/vhost-user-device-pci.c | 13 +- hw/virtio/vhost-user-device.c | 338 +-------------- hw/virtio/vhost-user-gpio.c | 407 +----------------- hw/virtio/vhost-user-i2c.c | 272 +----------- hw/virtio/vhost-user-input-pci.c | 3 - hw/virtio/vhost-user-input.c | 58 +++ hw/virtio/vhost-user-rng.c | 294 +------------ hw/virtio/vhost-user-snd-pci.c | 75 ++++ hw/virtio/vhost-user-snd.c | 67 +++ hw/input/meson.build | 1 - hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 27 +- 25 files changed, 850 insertions(+), 1456 deletions(-) create mode 100644 docs/system/devices/vhost-user-input.rst rename include/hw/virtio/{vhost-user-device.h => vhost-user-base.h} (71%) create mode 100644 include/hw/virtio/vhost-user-snd.h delete mode 100644 hw/input/vhost-user-input.c create mode 100644 hw/virtio/vhost-user-base.c create mode 100644 hw/virtio/vhost-user-input.c create mode 100644 hw/virtio/vhost-user-snd-pci.c create mode 100644 hw/virtio/vhost-user-snd.c