From patchwork Wed Feb 12 21:32:47 2025 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: 864489 Delivered-To: patch@linaro.org Received: by 2002:a5d:47a6:0:b0:38f:210b:807b with SMTP id 6csp138084wrb; Wed, 12 Feb 2025 13:35:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUuTSN15gF6tOTSrto1THP2kX/HnuVtpR8dP2DlNe6k/GLhojPvLRnwxggIBpk9te+6mp37zQ==@linaro.org X-Google-Smtp-Source: AGHT+IEGPOEcWau4NFLJnjVhB5afDWSzE7m79S3gL4n18V/olwnbg5nryCEyc/Kaynor5BM/4K1N X-Received: by 2002:a05:620a:24d2:b0:7c0:7921:4fc5 with SMTP id af79cd13be357-7c0792153a4mr320747285a.44.1739396131490; Wed, 12 Feb 2025 13:35:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739396131; cv=none; d=google.com; s=arc-20240605; b=Yspx7HFRjKRQnjjWXmp5kYvYKq2c9Js9dEir8qTScfcVtBE0DXw56kic/A9ExTG6zW 7IMNHTLMZxqH80BBTj5bezEI5nmFW/oRiOFb6mTRHhoOykZBkpSnGXAASFgc6WG8oZFe 1mTANeO/Z/aAYZve7iXN63aFmHQPnXhmA6h6gp/U3X0SQd+a/xOgBBRPWq0IjEsEI0Xk 3g3pnTJZ5nYLxm0n4zDuUeaB/wh66ZU6jW5sZ0tYjWbNU6O+c+gMdVu/KWLFzXIP3MUn 8lY5MqwqCL27SIQRYs3uSBEYsR/zgJcnHXpdl+I9oj38AKiF7uvejRtN+HJXJfIjdWPw 0EEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=3tahwZukGhQY0cObaTIwWhUmXQqOFwvV4yeEEvNe3Ak=; fh=fz3DJMUXEzejNv0JWYQ+xa02BmrDN+/I7HIv5ot61VY=; b=WiqwQugdpmacgp96958oB8GNoZbfEgu9pxIklU/sdk2oXMTSUFHJwck4wNj+5k2bqo VT/Rv3pk4DgKoiDyXWO911O5+z4C22WckGSOL9S5hJEEvKMpffVhqfybeRQJlI83PXBk d4JGd5iHEPGF3auzi0fDQUzoSzne5pRYLkPSS5Cc2SPA8vdmBQy9ZDj6MPe3fNZaZEzI BcBSGatSN0JgbojX3kOxpVjAXu4lKGs6+lAaBbO7DquSt7qAcYsz27vzx7XQ+XSBqIWX YxXzFbbfvWkjqLiT5T/ztuH6cTORJHCO2MLWN+VOtj955Ji4Th5j2hUTZD6FO0Fn+JXi 60mA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YfIj8rwM; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c078e90bebsi103907885a.529.2025.02.12.13.35.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2025 13:35:31 -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=YfIj8rwM; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKNG-00058E-So; Wed, 12 Feb 2025 16:34:27 -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 1tiKND-0004se-Pv for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:24 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKNC-0000Zi-9O for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:23 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4394a0c65fcso2195365e9.1 for ; Wed, 12 Feb 2025 13:34:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396060; x=1740000860; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3tahwZukGhQY0cObaTIwWhUmXQqOFwvV4yeEEvNe3Ak=; b=YfIj8rwM399z1uK855bV+qJDRi+1SpaVlSr16qLYDrewAdegp0GidellzbfSF6Qa2Z Dz7WFTeKYgDMaQQtCr5lJUMrs5JX8gwAy1xh04/uLtDhAIy401UszLjjgQDFiJU+xwdQ b7BImy/kqG0+Y6wHq+Yz1JqGAV7VD1cH9MX8pzr+uLySYUcnnZ9xgL1e1YacNj+eryKz ikjVoKbVMDNnhauwPj0GiLktdeQDcMl1d4VHzRDroEW76kb2ECtHt0XqVFrWTU/LC6Be x23F31qjMfe4+YTFpucA1cvwc7CZuk3BUw63HTn3rMxQZDuz9D3Xo0HR3qQ+uCAGmjya MCcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396060; x=1740000860; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3tahwZukGhQY0cObaTIwWhUmXQqOFwvV4yeEEvNe3Ak=; b=ayb8s8yJHuSZnONb0YMwG2SWoeStsq1RNqBEy2SUn+BypO5usO3g3+e1Oh48o1O4SB cKNCQwdN3VX4uOc20JJq/g0EvyeVyyfEFEqyYc27mpLIk5O7w9pZ5TCJ/ttxFLowUU7Q rzFFCcttx3tlPdDQT3l3V05znBi6KxlibCF6GwyoXOtu9gb4AxUB3u196mNoHGqlf0/+ dM2lG21pLCecNrSvyeBfmnWxq6rwvrTUq2TBxa7uMnWyXNWm6RPdiQ9Fe8Pv6OTmCvBf GnXvXELakP5XFM0hn5sdAdHZkcRiJ/ZXc5UgVmkfwPgkL5epmLi1V9pYnYXPssC8fov8 ElGQ== X-Gm-Message-State: AOJu0YwLrKhzCxWuf40lVfZ8kpuxD4y5kCdXJU9umoXz6YG1X3T2WcA6 ePAJogTwpDVzulNc9GPbLOCjacg0bzBe2gRI/TPk0rqQDq7w8H4FQCECBAfNNhqNW7LuOtn2a13 NlMg= X-Gm-Gg: ASbGncuwKyjo7y5B3iBnIwUSSmXv7W30YaKctUsQBaAsBRKeP3996poUfhFlqIYFb2U Sj9bn+h5op9Ot7hHx6goQMIqXIlmHWiK4jBN8CNErPw/Qvt9U7BS90QYhtnvuBllagvKVvaxw3k 3iHKaL+lTWYinw7o2cQCurVbYvSs+d56aJd55dH4BriHzMVC63WqweFNVa2L3XRE5Q1V44Uq2cl l+aARCLmXBbuqhdrrTppWIEKasig92HA2xLGd4yh7txPUX4BPJV1vrq131d24xSZwiZlu628ELd JDk/XoJzh7uAZiI6xDswJ1CMv+1+GQVxfJGsr4EibDezZTAFPTbeB/qjhnRh1zem8Q== X-Received: by 2002:a05:600c:1e0f:b0:434:f586:7520 with SMTP id 5b1f17b1804b1-43960185f0amr11972505e9.6.1739396060389; Wed, 12 Feb 2025 13:34:20 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259d5e9esm20117f8f.61.2025.02.12.13.34.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:34:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 17/19] hw/virtio/virtio-pci: Reduce generic_type_info scope Date: Wed, 12 Feb 2025 22:32:47 +0100 Message-ID: <20250212213249.45574-18-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 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 Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio-pci.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 6f0e1772669..99724deb3d9 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2488,18 +2488,6 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .abstract = true, .interfaces = t->interfaces, }; - const TypeInfo generic_type_info = { - .name = t->generic_name, - .parent = t->base_name ?: base_name, - .class_init = t->base_name ? virtio_pci_generic_class_init - : virtio_pci_base_class_init, - .class_data = t->base_name ? NULL : t, - .interfaces = (const InterfaceInfo[]) { - { INTERFACE_PCIE_DEVICE }, - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { } - }, - }; assert(t->base_name || !t->non_transitional_name); assert(t->base_name || !t->transitional_name); @@ -2507,6 +2495,19 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) type_register_static(&base_type_info); if (t->generic_name) { + const TypeInfo generic_type_info = { + .name = t->generic_name, + .parent = t->base_name ?: base_name, + .class_init = t->base_name ? virtio_pci_generic_class_init + : virtio_pci_base_class_init, + .class_data = t->base_name ? NULL : t, + .interfaces = (const InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { } + }, + }; + type_register_static(&generic_type_info); }