From patchwork Wed Jan 15 23:22: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: 857625 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2730990wrc; Wed, 15 Jan 2025 15:25:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVy9ChHLbxdOdfSMi39B6dUS8Ng3jwYOUluHfCHg7TJUMKsnStneIa4xFtJJ782QaOaSdWU2g==@linaro.org X-Google-Smtp-Source: AGHT+IFQMFDCVIyWToRFz3TqawYJyNN7kTJuXx/+PgrqmoJeCCr2QnmDB3686GrumyyRywfRKvtq X-Received: by 2002:ac8:5f95:0:b0:46c:82dd:9a69 with SMTP id d75a77b69052e-46df578de9amr80468161cf.19.1736983518535; Wed, 15 Jan 2025 15:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983518; cv=none; d=google.com; s=arc-20240605; b=DeCrEmOk43TfWtebFmZAlyEN3V24LYU0OhxPG7wbM808qZD7BMJRE0P6iXFG+z2lPt y7aifaVlVHgM0zezx0YVUQK6hkxK+L5zXLnRFKxFOAoQ4x0hrWNcNW7rotLvuiyjy74H CvPg+IbNCfvMt/6XESHKOCNP1tQgGQY7D5dkxS8uSkGbvJaZcYUlKr9erqh10u+t5M5D 6nOUSTfgMkxzvzW0GCE/M4VriU7VMFU3zLzSyzhWWQ9ZEUCBhAJ8ZZWaIrs3qJiD3LNA 97ohCPmDadkK/boLWSOUArJ3974PeUyatA02E5CPYUjGWt/WhyGqyrqjg3vWUcwFMGcN Ppzw== 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=3MeEeWLQLu5S/9pne2OBNrXJxMiShf4rM4A4caNKWSo=; fh=6uCsJEqu0l7fwjMp6wYCwiXDsQFV46+Cnzseg3I3wJE=; b=QGOqHAZpzYHCrIodEPy/2tedoh0y46usx3tdKfVSC2pe64jmBc6kjCt2RbfFATNGvE K0P3qj/iVIZvf5Pwc3nlWR/+lgGq2OH6B+1hYocG6twkCDV0PJVmfhLL9oRGsxgwfkgl LWkcCENK+2UDjkYCv2rB17yfqXOk8SZj1xnWdzpV02+YKhwpCCR5imDE5GJo7n2Km/9p 0oDm8hwVjki2D+1FW+fq2y4bL3hG5ygKN8KM9LGXgVM7WP2eMhuQwMO8qKfkEzpRwOoK YLLrMhG/14OYM1absDfmMAKo9ML8jazp1O3+oig2QiOK4lnVqrDv+EjB3BvHjEgq/vX+ 0Xtg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IgzQDk5/"; 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-7bce322c182si1681595585a.88.2025.01.15.15.25.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:25:18 -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="IgzQDk5/"; 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 1tYCkv-0005Gh-3v; Wed, 15 Jan 2025 18:25:01 -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 1tYCki-0004uM-SO for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:24:54 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCkg-00044M-Jh for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:24:48 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43618283dedso2225635e9.3 for ; Wed, 15 Jan 2025 15:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983484; x=1737588284; 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=3MeEeWLQLu5S/9pne2OBNrXJxMiShf4rM4A4caNKWSo=; b=IgzQDk5//arKXdZPMm2eHpgzcswuNLqGFgGmMOKQYQH0pu9zuLJ9QSZqjnAhf27nz+ DA9WrsRhWCL/yjg9LWSzAQbjeNRcj1NWzH4f0Enb/OBOOb6k5gUyVJPEPpyJgVIHgdC4 /0mJjJRzxt5jpkQvp2YMiUyDCZKEdJ88zUCfK4F7YSct/RpO8U4FNR5WLy8ogVbn19yD vrlzapHzBWsxoxX2yeQcerMwCKqc03UE/xSCkkcBpqO5GpjqoUlb46xfRCufY5Hx+2Zp PIiCbPcJ3K5+BYpmQk9hiN561ytrIiqfbo2Ea4tutQCE4zZIQeM9Q3YtP+UJkNH9K6Au mC3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983484; x=1737588284; 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=3MeEeWLQLu5S/9pne2OBNrXJxMiShf4rM4A4caNKWSo=; b=O2En8MpPLvu6mjBuZ1l6GSTXHVsspzrqCbQVGPHdw9LfDRrmLSru6tZTxmdDa9gCaY MVhfyCVIwCrn+iiYdUcsqs+3EfPZX7kHpcDYuCkC9dz0L31AgCz1DVSjRwYsqZeK6iIM 9uw58Ze5T98YCDdjVGaUhnJWtibpTt35fK3F+s2ywH1X18oCb/HSyPWq/A3A+pB5pg49 +rKd88POvQnsyck6X9yQvlDUEwuXi+6DBlID+bjUmkFPvzFcCJPee7Wt4tKkLv5vs+pL /XLVSw7wEwLlK2IRBVlK7rlKZl0CAf9bNbNQydApXb9pHLUEKLQXELzwUzuCM6/XuSpt Y/2Q== X-Gm-Message-State: AOJu0Yxs8ZEnybr6N3ALXUR5k68LbQskJa+oCiiBUpHXCTkzj2NGaJVO wfQQDwfASMilaL5rolDFrKYtE+J3bynq8oZbJqEiuI7WkfiBeiwcu5fhC8vr48hTLDzZp4Own2N 8a4o= X-Gm-Gg: ASbGnctw8ayKZUeFze/fxCcvYZNu7EMB7NVVaMZBOskrF6ne3dl1rb2UIl45LjCRy3N iim/L3WJoecDPnygcWx3BhHuDv2ejM1/fQnVJcTgyhwtm/alrebbWJRTHYDPUymlRJ4e5zrNqas WHisWRB2BDzQauYiiYHymc8f+AACT5UQmPT9AYXxtHvsS9heeOkVDuZgivBPcIOLsj3968EFMGJ bjGzYTCd89QwnbeF+FmBJHsED+6U/Oj8cUsB1IRfnMC4uOusfQTvs/JpsZNr+jKa7TJ3PyySwHj 6MJjrZUfmPb7MPVB2dg5gNAaEdBdg+8= X-Received: by 2002:a05:600c:348c:b0:435:14d:f61a with SMTP id 5b1f17b1804b1-436e2707c4emr241072415e9.25.1736983484554; Wed, 15 Jan 2025 15:24:44 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c74ac604sm38605875e9.13.2025.01.15.15.24.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:24:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jason Wang , Hanna Reitz , Dmitry Fleytman , qemu-block@nongnu.org, Fam Zheng , Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Zhao Liu , Yanan Wang , Kevin Wolf , Eduardo Habkost , Richard Henderson , Marcel Apfelbaum , Gerd Hoffmann , John Snow Subject: [PATCH 21/21] hw/net/vmxnet3: Merge DeviceRealize in InstanceInit Date: Thu, 16 Jan 2025 00:22:47 +0100 Message-ID: <20250115232247.30364-22-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232247.30364-1-philmd@linaro.org> References: <20250115232247.30364-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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=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 Simplify merging vmxnet3_realize() within vmxnet3_instance_init(), removing the need for device_class_set_parent_realize(). Signed-off-by: Philippe Mathieu-Daudé --- hw/net/vmxnet3.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index d8132773fad..2757fd83505 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -2239,6 +2239,7 @@ static void vmxnet3_instance_init(Object *obj) device_add_bootindex_property(obj, &s->conf.bootindex, "bootindex", "/ethernet-phy@0", DEVICE(obj)); + PCI_DEVICE(obj)->cap_present |= QEMU_PCI_CAP_EXPRESS; } static void vmxnet3_pci_uninit(PCIDevice *pci_dev) @@ -2464,22 +2465,10 @@ static const Property vmxnet3_properties[] = { DEFINE_NIC_PROPERTIES(VMXNET3State, conf), }; -static void vmxnet3_realize(DeviceState *qdev, Error **errp) -{ - VMXNET3Class *vc = VMXNET3_DEVICE_GET_CLASS(qdev); - PCIDevice *pci_dev = PCI_DEVICE(qdev); - VMXNET3State *s = VMXNET3(qdev); - - pci_dev->cap_present |= QEMU_PCI_CAP_EXPRESS; - - vc->parent_dc_realize(qdev, errp); -} - static void vmxnet3_class_init(ObjectClass *class, void *data) { DeviceClass *dc = DEVICE_CLASS(class); PCIDeviceClass *c = PCI_DEVICE_CLASS(class); - VMXNET3Class *vc = VMXNET3_DEVICE_CLASS(class); c->realize = vmxnet3_pci_realize; c->exit = vmxnet3_pci_uninit; @@ -2490,8 +2479,6 @@ static void vmxnet3_class_init(ObjectClass *class, void *data) c->class_id = PCI_CLASS_NETWORK_ETHERNET; c->subsystem_vendor_id = PCI_VENDOR_ID_VMWARE; c->subsystem_id = PCI_DEVICE_ID_VMWARE_VMXNET3; - device_class_set_parent_realize(dc, vmxnet3_realize, - &vc->parent_dc_realize); dc->desc = "VMWare Paravirtualized Ethernet v3"; device_class_set_legacy_reset(dc, vmxnet3_qdev_reset); dc->vmsd = &vmstate_vmxnet3;