From patchwork Tue Oct 17 14:01:44 2023 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: 734404 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp497689wro; Tue, 17 Oct 2023 07:02:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWNzSU9p+gwSPALmjvGZx63HWf6GQRYhv0C6Y8IAdaixQogSST7OfkWOu1dYwgdk7J9QTw X-Received: by 2002:a05:6102:2ea:b0:457:c982:57f9 with SMTP id j10-20020a05610202ea00b00457c98257f9mr2564061vsj.23.1697551374547; Tue, 17 Oct 2023 07:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551374; cv=none; d=google.com; s=arc-20160816; b=ZYx8ZY+nHcE99xjLpBjNvaidKZSsi88vqqOiBc0HV1cppaL6rZFxaTVznf3AmD4Lj0 wlieMyk0vioZFeyoaj0vChaTBm+7u7Zx5F0n7ujJf7MzJG5qf2wTFXvzOltLJhg9hayz fkYp0C/7s6cTXRi+4kYcrGfELrOP1OFHXKWUnHk9ESeSBLS61MLtuT5Tfw/nUMsfWssQ JsiUVrJHbPTd7b/QJouOHUmrf4FuZ2F8Lj22tzeaDmBUKk+ljfjZrOIwJgyw/Ica+NaI OssLZWwDCDbxWxNfuzpyAZX8/H8lVXeOurXg7gPLa16c2B1qbXegFy2Tn+FD2ClLHloI Tllw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jK9MnOkarN7NF0Qc/XLSYHaYAFfcVhsfbF2N1g/hNuw=; fh=PkQUf9c5shm23GEgSgwIjaGjrTFXVTBGToef+bFaIfM=; b=LpSCaMXas7puraMRNI3+YwqlRd54OsxW3lRXLPEu3vFMTzinO314+6AhvViwMCLYV4 ewNIZTHLlgB5MmS0q18la5V5pupevZE7qkFxL4s4c7keTB8p+ZW4mdI4YWHDU73EQtQi i3+NmwbAUBAXU3K80yva8beXcHTCz7ZBW0UpS8xvvMsTZE2N5AmR6MMDeYi6P/ZDA7uj 4umctYbwzO8M3djlAP+zF2YCrSDPgcFBfXsJDm0woucLV6nZLIqjtubLGuOCYRKFyaZz NJT0joXeH88hYeRQI8KYMnIT6rotsmLIEF/sN5yTD/oiPY/IGCO0D9M1cNCJoQXUJDpV am/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zSdT+W3R; 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 az18-20020a056102285200b00440a6ecd062si117339vsb.338.2023.10.17.07.02.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2023 07:02:54 -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=pass header.i=@linaro.org header.s=google header.b=zSdT+W3R; 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 1qskeI-000402-BX; Tue, 17 Oct 2023 10:02:18 -0400 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 1qskeD-0003yO-P6 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:16 -0400 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 1qske4-0008Ko-T8 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:13 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4056ce55e7eso54919655e9.2 for ; Tue, 17 Oct 2023 07:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697551322; x=1698156122; 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=jK9MnOkarN7NF0Qc/XLSYHaYAFfcVhsfbF2N1g/hNuw=; b=zSdT+W3RXlk8Y+3VgBCP3MsJ/OnvuuLZTZbf33m0UqBVFYinFzWm6xqx6vKB6VfhXd gG+KmKFbIUiNRNOdeQUutJzVOmjxZ7ba+ROV/s0htRUPb5NPdvbQ39sMMIODSIlu/5rW mTUwO+ntSr7ziwNfdqQNZcrLoHSnvWd6xQ4SDOdOTUinTj867TNy34HndKO7fx+oZkj4 wSbFIDxlWYkl/ew3vhaPebKznJv45Hr17BeJ+6hH8v+fXa20RaHa9qF8L1WyhFGjWIww 0tQKRHF40rF+C/QVRDtLqgNAJPgVkNAGXexNxl/dQTuSHPw+TxzBQavNWEI9RlFzGWvh EVKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551322; x=1698156122; 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=jK9MnOkarN7NF0Qc/XLSYHaYAFfcVhsfbF2N1g/hNuw=; b=Rd32QW7bjr+qRstnaXcQbLDN1mRNVTkOWG2hjcdyG/sDu6LVNKKGckx3u7jiU8DaNS 7LJohEBR2nHYaKV/CLWJ5QkEEXEWf0Grkty+t7Mn6bfQzp+1NH7zj01rhpkZInPf0CyN ROUiHGTYgd74BOk9JYH6kyu6lcmp59U7D2Qh/YwXaNV+bXIe1FDLVsLDQQ7rLzgvWKIW BX0I4amxEra3eP2MMSGmvFjN5bpHHOhRl1rTEYtu/dCMWmjtjzicBuLLeLdRiEIogrQy IbvVXOI9MrTNQS0W/uFanH/MONNN/Kjo+5nroG9Y1w/806GWoi7A+1G3f5HEFo0FPH16 Qq2g== X-Gm-Message-State: AOJu0Yz1uYVVmX/MtDABLbJ7JU3XHLuA2B88Kcq9lHOPwrut9gNIAbbe vFeWhfznRUBSWJiIebHtEhWkv1W8OeNNKwqL3LFhMw== X-Received: by 2002:a5d:6802:0:b0:32d:9a1b:5d79 with SMTP id w2-20020a5d6802000000b0032d9a1b5d79mr1705786wru.33.1697551321681; Tue, 17 Oct 2023 07:02:01 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.33]) by smtp.gmail.com with ESMTPSA id x5-20020a5d60c5000000b0032179c4a46dsm1730095wrt.100.2023.10.17.07.01.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 17 Oct 2023 07:02:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Hanna Reitz , Fam Zheng , qemu-arm@nongnu.org, "Michael S. Tsirkin" , qemu-block@nongnu.org, Kevin Wolf , Jason Wang , Peter Maydell , Raphael Norwitz , "Edgar E. Iglesias" , Alistair Francis , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/7] hw/virtio/virtio-pmem: Replace impossible check by assertion Date: Tue, 17 Oct 2023 16:01:44 +0200 Message-ID: <20231017140150.44995-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017140150.44995-1-philmd@linaro.org> References: <20231017140150.44995-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 The get_memory_region() handler is used when (un)plugging the device, which can only occur *after* it is realized. virtio_pmem_realize() ensure the instance can not be realized without 'memdev'. Remove the superfluous check, replacing it by an assertion. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis --- hw/virtio/virtio-pmem.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c index c3512c2dae..cc24812d2e 100644 --- a/hw/virtio/virtio-pmem.c +++ b/hw/virtio/virtio-pmem.c @@ -147,10 +147,7 @@ static void virtio_pmem_fill_device_info(const VirtIOPMEM *pmem, static MemoryRegion *virtio_pmem_get_memory_region(VirtIOPMEM *pmem, Error **errp) { - if (!pmem->memdev) { - error_setg(errp, "'%s' property must be set", VIRTIO_PMEM_MEMDEV_PROP); - return NULL; - } + assert(pmem->memdev); return &pmem->memdev->mr; } From patchwork Tue Oct 17 14:01:45 2023 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: 734401 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp497578wro; Tue, 17 Oct 2023 07:02:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdYQsQH+V6gkeeITR6etOU8G3PTDQQrWcdrN04sH2+nVyIZBujNXWja4/kTOYv+CCrwqYQ X-Received: by 2002:a05:6359:100e:b0:166:cc78:ee9b with SMTP id ib14-20020a056359100e00b00166cc78ee9bmr2602099rwb.8.1697551366749; Tue, 17 Oct 2023 07:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551366; cv=none; d=google.com; s=arc-20160816; b=VZNibOMDAXQdBolHEqQuTxgmGYDLCeDS04vjI+eNTfsdta8UN53oNCc4xD+0EbQm/u kd32Tjj7u341TOnFxFI3gNkuIfFdWfWiyD3F5sk4fZP8usU4qru0NPjCyEjNggI4B5BQ QSLybM2pfVV0uMj3OH03ZphD50190pUfeNdurM22oZ04bTOdLLWDryRoRk9Yfz2OzuhF 5jfWQGyR/DLioPwfRC45q3hFVJ4KhD9YIyPyJ4L4m2T+A6Fly76RrGBpkhUOAc4uN1YE kR7Y0eS8pG5R3SXpc3VXdtG59wAbC/6L5TaeS4tMx0URmsLPG+3S6G018b8yIrLTJoBn ojIQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B7R3ShGuEPvQsYMJ+sC0uKzUQHXrwcjcpcC+wh9jeQo=; fh=PkQUf9c5shm23GEgSgwIjaGjrTFXVTBGToef+bFaIfM=; b=wUHjrlVN6uvZoeCCMDIXMW1s7FszgvY4DjYBKGUE8UoMJyMK6BzTha2E5D3+5bPtO9 KRLPdNUlhBOFEEri3W3OcW+zTzaLWeFkTy7vGHHS2a3nKdQCqd9nrSTgIZjrbHKefJ7k 6xseRPvVxMkxQMAxE+BpZnXImUmIKV0sjjCuLEYrXckWsfwsFLjbsmpXGgMaVxpDMFp8 f//oqwt/gRnjb4dknI7mX+iHuUz1tvOc1VrYWrVoNSQyGvoQ9dKfKrOeVFOSbcid7uhw hI7fcqRLvJwNuS78K8DpwIC8NcGP/XNqgsp8/IF73uFI6O3GtNNr8d9i6F0Uwemj/d2J 8Lew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fQ1fBQCw; 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 c6-20020ab030c6000000b007a4f6a4c4dasi152595uam.78.2023.10.17.07.02.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2023 07:02:46 -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=pass header.i=@linaro.org header.s=google header.b=fQ1fBQCw; 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 1qskeH-0003zw-Or; Tue, 17 Oct 2023 10:02:17 -0400 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 1qskeD-0003yP-P6 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:16 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qskeA-0008MC-8Y for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:12 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31c5cac3ae2so5047461f8f.3 for ; Tue, 17 Oct 2023 07:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697551328; x=1698156128; 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=B7R3ShGuEPvQsYMJ+sC0uKzUQHXrwcjcpcC+wh9jeQo=; b=fQ1fBQCwqY6aUlwdW7UDuH77GInRel443gr4dloLqxr055WFYebtDGSJI0GceqlrEv C9ZNxk/isWLsm0SjpEG8G9GEjd1Qv0kedttqluzabjGwD1YL3Gtr4Ks4Ug9BD9x9Y0Ew sEdgyxX29y+67IZxUpr4u4kzijPnT4IAPJ2Z34pEFwEa2PAff/Wypp50Vn+DpVAYIK14 t5SWgbEdGeyv6dRRrqPjWTDPfCpp12SBpYgjlWuxie+S3CiFBmEC7e5tV+VQjs0Av6kw QTPmva+slRGEa+U8l64grud/ctDIeABGUxSD6KriOfz06W6pdFxL1RKbWJf50H6lI9Jg mxdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551328; x=1698156128; 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=B7R3ShGuEPvQsYMJ+sC0uKzUQHXrwcjcpcC+wh9jeQo=; b=UGDzcGzvdeF3VMevFI59d5XDC3rJ1ZYT9sufpby9Hrh3xEEv2m4wSIEF+sBgBoeUu4 /Bjl6ziBAOUWD3EjKNXmYjfp7kyaP3OxFTeiP0xGl7LYfdenNo05yhPT+5j5tAGDI2V6 PhrpXT4XaO9Jv+gnrtMvirz5fGT2PdMt9JWiF+RLR5m+7Jqou03N6pMVC4xl8ik+keaV zqUZyMOgEuvrV809ELCFaxKHcQs/LwtjBEpMy72L7a4Dfru6SFVf0O9xpUepOiYrlT9Q AemsdfyLcCMnX6Gg4xwCgiSAl/RS9DL09ym+WQzB2oSVHsuNmVm8jT47x8UZ4wkg293f G1Gw== X-Gm-Message-State: AOJu0Yx7asVOxeBOgfTP1gp9FmnPfRjVINkrr9IgW7RMM4nXXTkLqDlJ 3xvV/6oIAEvNvRqklG5s5H3SZZYCGriNXXIFelI3Lw== X-Received: by 2002:a5d:408c:0:b0:32d:a818:a74d with SMTP id o12-20020a5d408c000000b0032da818a74dmr1952521wrp.47.1697551328607; Tue, 17 Oct 2023 07:02:08 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.33]) by smtp.gmail.com with ESMTPSA id p5-20020adfe605000000b0031fb91f23e9sm1752461wrm.43.2023.10.17.07.02.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 17 Oct 2023 07:02:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Hanna Reitz , Fam Zheng , qemu-arm@nongnu.org, "Michael S. Tsirkin" , qemu-block@nongnu.org, Kevin Wolf , Jason Wang , Peter Maydell , Raphael Norwitz , "Edgar E. Iglesias" , Alistair Francis , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/7] hw/block/vhost-user-blk: Use DEVICE() / VIRTIO_DEVICE() macros Date: Tue, 17 Oct 2023 16:01:45 +0200 Message-ID: <20231017140150.44995-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017140150.44995-1-philmd@linaro.org> References: <20231017140150.44995-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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 Access QOM parent with the proper QOM [VIRTIO_]DEVICE() macros. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Mark Cave-Ayland --- hw/block/vhost-user-blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index eecf3f7a81..4b37e26120 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -405,7 +405,7 @@ static void vhost_user_blk_event(void *opaque, QEMUChrEvent event) static int vhost_user_blk_realize_connect(VHostUserBlk *s, Error **errp) { - DeviceState *dev = &s->parent_obj.parent_obj; + DeviceState *dev = DEVICE(s); int ret; s->connected = false; @@ -423,7 +423,7 @@ static int vhost_user_blk_realize_connect(VHostUserBlk *s, Error **errp) assert(s->connected); ret = vhost_dev_get_config(&s->dev, (uint8_t *)&s->blkcfg, - s->parent_obj.config_len, errp); + VIRTIO_DEVICE(s)->config_len, errp); if (ret < 0) { qemu_chr_fe_disconnect(&s->chardev); vhost_dev_cleanup(&s->dev); From patchwork Tue Oct 17 14:01:46 2023 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: 734403 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp497686wro; Tue, 17 Oct 2023 07:02:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqxpksVMN6xvUzeNgnV51TsRbw3OrdSSDU8cAga5ywkY+b1fP0ORTFx7ZpVk+dC2Siw93U X-Received: by 2002:a05:690c:d84:b0:5a8:5ce9:d740 with SMTP id da4-20020a05690c0d8400b005a85ce9d740mr2938541ywb.33.1697551374487; Tue, 17 Oct 2023 07:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551374; cv=none; d=google.com; s=arc-20160816; b=UIzYRN1rTVLs7qYGZ2csGI9jCswVMbnV+noFmxACLCSAL7u3FqzwAHvqWOGmDrZkXi XkqpcAPjqUKSICiKUUhQd5nXA+J3el+LHRPg9NACBLYlQeKZIb1W1e2QZemFECP/EmYO FT2bHgAugV8BgNKt6p3nop5+ovRPjKal51mNCHxf3Xvn7/lsZGvh8sqq4PiBpf5H2A7Y bZ4Myv3n/MKS/SVdxe2qp4cgAVUm68/1tjOqaI3zrS8iu1/oJS4uzWaDxcbeuvMfyk4s Uqhkoy2KmOJye/jf9wDXlkq+R6AdFGxbcFTk8ebTa5pv4Ngjs/2IcKcnKexPOODwNpbs Q5hQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eu+I0Mxgw0c1e0TXhFwzYxAgC+Cbp6NkKlE9STdvd/w=; fh=PkQUf9c5shm23GEgSgwIjaGjrTFXVTBGToef+bFaIfM=; b=0fcJYgyMSpvGZG0zCNhcu9hOllchoX/gkfoHz4ZXwVxN0ZJz2u4NNke4QjwrwElz31 pnmugds74eZRXJX+UHgRd8Q3RG3ncNAc2NrsGhTIIIEJ64MKdbiR0v3r07c7HZbil4Ce 2NpHpAOYvN5s5QJLvj3iLwVUbijn45+KWBmthrQvgCh4D+Yl4guagQ3etvHALDG0hjQ4 jVuMxB1Aqk6LibpDYzlXRcSG8VhE8NnQNVhNslpFpBuH7R4JXO9fGzd+Fx5SuAFJIqoZ kwl2vq6tf+J5IL6PL64f75Qd7hucJyvw0it2FSSPXYRjUCqTYYvmKon1UdfGjL5HKkdB R1Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lCj+YU0e; 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 n3-20020a67e443000000b00457c0970b72si122039vsm.773.2023.10.17.07.02.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2023 07:02:54 -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=pass header.i=@linaro.org header.s=google header.b=lCj+YU0e; 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 1qskef-00049V-Rv; Tue, 17 Oct 2023 10:02:42 -0400 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 1qskeL-00046a-Cy for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:21 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qskeI-0008Nv-89 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:21 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40572aeb673so54835305e9.0 for ; Tue, 17 Oct 2023 07:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697551336; x=1698156136; 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=eu+I0Mxgw0c1e0TXhFwzYxAgC+Cbp6NkKlE9STdvd/w=; b=lCj+YU0egaVlMJub5HB/y8z5CY5Tg2MEJNXVW+M7z2G1uH5XKkEInvV7u1iQrcjd92 ydVktC3o3FoACsTBxYMy9cxx/LOCVALGBeyTKFF4vSE4MIGP0QD/bxxpiQGlRv4ow1As 3Jp3gebZP3tb9rWr9NQnR689ufh6Fc4LdqON1nswhPcJNAMG61liN3+XNvSbHEJiUjnH Z8pr7Ch+PISFDCmzpKnh6F+Q9KBM0ZRWbteymLafcFrCUoGV9mTyAYo94QgSVXVz6/Cd E4FGfznYXtyPQacjHcI4jA8YKTXV7GApxDGfc7ZfAEEGzCDCo09Dmuq4p6Cakwr3TTkB hT5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551336; x=1698156136; 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=eu+I0Mxgw0c1e0TXhFwzYxAgC+Cbp6NkKlE9STdvd/w=; b=AVVM/OfwvRwQx3ZcMTWA3sZCUNDByl/1mQ7YDN9ewndq2Sj12Tr/u0VCmhNGomEC4H +kUl8k4hVAcZZhZDz1QQwYd0KvkMYUP8RHtYB2gFQggl0sr4SJaBCqPU3ZtucsMaCyee +rJ/D1zB2PkT7P6S0XRiSJg6xxQs7rxoI/G+/9IvzVcuQ/pVvKx5eLG+nje7XCLhYnfx jqv255JL7Xw1IRO3N9AHY++uKIDtphGZUH08CrMXpAxEDsD23Fo0/q2nnIPDyZjW7GtB EfBC2/pYKnvaCwunqAJ9x4pgoGakUyI0DnT23bgt9NVD1LnDFd7PQZ9XY0hG/tfECpsl vP8g== X-Gm-Message-State: AOJu0YzPtvpOiC9Xxc0F0eGLRF553uApk3xy7yHj0NBARFBjzOxrOv6N J8Dz8Qxm0pHuCx3DZ9SO66ynooydB/eNb/ZPXH7Sjw== X-Received: by 2002:a05:600c:4708:b0:406:3fda:962c with SMTP id v8-20020a05600c470800b004063fda962cmr1977009wmo.31.1697551336464; Tue, 17 Oct 2023 07:02:16 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.33]) by smtp.gmail.com with ESMTPSA id n35-20020a05600c502300b004064ac107cfsm2006747wmr.39.2023.10.17.07.02.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 17 Oct 2023 07:02:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Hanna Reitz , Fam Zheng , qemu-arm@nongnu.org, "Michael S. Tsirkin" , qemu-block@nongnu.org, Kevin Wolf , Jason Wang , Peter Maydell , Raphael Norwitz , "Edgar E. Iglesias" , Alistair Francis , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/7] hw/display/virtio-gpu: Use VIRTIO_DEVICE() macro Date: Tue, 17 Oct 2023 16:01:46 +0200 Message-ID: <20231017140150.44995-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017140150.44995-1-philmd@linaro.org> References: <20231017140150.44995-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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 Access QOM parent with the proper QOM VIRTIO_DEVICE() macro. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Mark Cave-Ayland --- hw/display/virtio-gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 93857ad523..51cb517999 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1132,7 +1132,7 @@ static void virtio_gpu_ctrl_bh(void *opaque) VirtIOGPU *g = opaque; VirtIOGPUClass *vgc = VIRTIO_GPU_GET_CLASS(g); - vgc->handle_ctrl(&g->parent_obj.parent_obj, g->ctrl_vq); + vgc->handle_ctrl(VIRTIO_DEVICE(g), g->ctrl_vq); } static void virtio_gpu_handle_cursor(VirtIODevice *vdev, VirtQueue *vq) From patchwork Tue Oct 17 14:01:47 2023 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: 734407 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp498715wro; Tue, 17 Oct 2023 07:04:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHriRQoS8FEhZ3d1ix7bvNJ/ILSpdJfWr7O9zEh3yWVQbWsr26+wgZmYTItQAX8GUaaZvnQ X-Received: by 2002:a05:600c:3b1a:b0:407:7e7a:5faa with SMTP id m26-20020a05600c3b1a00b004077e7a5faamr1800566wms.4.1697551457561; Tue, 17 Oct 2023 07:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551457; cv=none; d=google.com; s=arc-20160816; b=ImhIScqiuooq5+5evIAsYTr5HPogJcMWFLrl4hnx2C3J6knN5QYkhoAwIZ8OoFZEgk m4puyQPKcIFRponQBDevpOPGO4ujtVs69tkUpIwM8pCLUeNOT9RDstsg5uPTww+PKsb5 EyudoJLD0OVzq6yQt49dySmPLLNpQn4J3a206xcYxvICf+AtxFchEAFkIuY/nyf70Edw kY3JpQqtWyWl2Ey9i8m5ASllfCMmAEr5AxiH/umc0TKuDOCzRzDtxz5WBBw/Sc41sk2M NHoK4hkYCg961OkwOVQvwQX0vmYk4xF87RhmVEJ059z8bDNE4wHxxhVPdrkDCplCfF+B 58Qg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=puWItc3Dt59czgvz0D+TYHTdmTo5qF+fqrS6/T95/pw=; fh=PkQUf9c5shm23GEgSgwIjaGjrTFXVTBGToef+bFaIfM=; b=c5EFHZ1HysUrfMRtX0ASA3Sl4mZKJqwPL9RdnozF3TRVNyzrxH2kJ3uesQgy1+GFtm AQJyB8b3Quhh/zfKI9KneSq38sZpooKV7G107deCxLgH5mLT8zrsy5u/FhHTA9h42uzN tw2cAms5PNIaCAUmwjDAw9ZhG8NQyZv+CFFUNd8qRfNJqhJgazsgIPDlbrXBv7Dg7otQ hl3a0mYf804bIrTul8l62Xq8M+xyJ+UnGmUQHMIb+W9pWi0LHvfb64hhZRizyT5ti1po T7NW1eZDkC5gSwxp8FsuTDi2WtL0kGveLHwW4JwhkEMvyqY9p+wjvT8juSc400bXehcO oZSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Jr0gTcj/"; 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 h16-20020adffd50000000b0032dafea2f5asi988819wrs.166.2023.10.17.07.04.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2023 07:04:17 -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=pass header.i=@linaro.org header.s=google header.b="Jr0gTcj/"; 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 1qskes-0004iX-6N; Tue, 17 Oct 2023 10:02:54 -0400 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 1qskei-0004Jh-RI for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:48 -0400 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qskea-0008PT-CT for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:40 -0400 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c50305c5c4so66003731fa.1 for ; Tue, 17 Oct 2023 07:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697551343; x=1698156143; 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=puWItc3Dt59czgvz0D+TYHTdmTo5qF+fqrS6/T95/pw=; b=Jr0gTcj/RCvda45qJVoLxlOfPrQpxeFOoJ2DoUamqij+IWMFPQooAP21YBJEujOIg8 EnXLDix5/EJ3ZaMyJ9wBXU/5KG0BhejhGQsh5SXnktfDoEsDrwe1Bw65DxUt85QF0an2 NJPXWsiNffazl3UmUeAaMSierH6+Go/ivvvMKsjYyOWWZ5BHI2M5PHsWfwyNXPbidcmQ EDbKvSKuQyc3b2sJBH4CpP498jB09jivLysTpZVwiIIyz4V1jVG9AsWd/YMkFxzSUKvc EwqbP12RNOno5pUZh+3ZZP4y4ssv1/haZmbND1QQo7aDCMDwGSdhOdNZdjLaFsHf5Jq2 JrXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551343; x=1698156143; 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=puWItc3Dt59czgvz0D+TYHTdmTo5qF+fqrS6/T95/pw=; b=cwjlW0h2eJ/eZS9Bw5643H1V/zndv5bNgf+pq8CT96Mb/CSKAfFIcDN1n2aoqa3RAU 4NxajWf93VZ6+5knTQDGkDOOrClArCHL0QICUdJ0ENRYKfRfjIhN+EX3qXSbfnk14zPN exg/iGR96AirTLrvd/Keozt2ccNT7cn4mpkohVSlg7O766IDfDE6dARBWWKlqaKSLq6M Wix95BdOuc4rST/G1abbG+p8P+VK+jNb16Xw6pcw5X9WhcOVhh4fpGEUat+CKMz80X16 OQqN/zEu+5vgdy9U8JEwln1sW+e05zyb0aIBDwmPLdDnoP8zsh4qbFKNckxWZa1YOqv/ T5/w== X-Gm-Message-State: AOJu0Yy54ElByYEabPMK2kq1ntztc8ivoFAvl00oK9vtUBsbv2zzuzMs +glXAyrJ6oSN85CdiRIGqwgd6AcRgXIstU98toZqzw== X-Received: by 2002:a2e:5052:0:b0:2bc:f78a:e5e0 with SMTP id v18-20020a2e5052000000b002bcf78ae5e0mr1671765ljd.43.1697551343116; Tue, 17 Oct 2023 07:02:23 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.33]) by smtp.gmail.com with ESMTPSA id p11-20020a05600c358b00b004075d5664basm10086258wmq.8.2023.10.17.07.02.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 17 Oct 2023 07:02:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Hanna Reitz , Fam Zheng , qemu-arm@nongnu.org, "Michael S. Tsirkin" , qemu-block@nongnu.org, Kevin Wolf , Jason Wang , Peter Maydell , Raphael Norwitz , "Edgar E. Iglesias" , Alistair Francis , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/7] hw/scsi/virtio-scsi: Use VIRTIO_SCSI_COMMON() macro Date: Tue, 17 Oct 2023 16:01:47 +0200 Message-ID: <20231017140150.44995-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017140150.44995-1-philmd@linaro.org> References: <20231017140150.44995-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::230; envelope-from=philmd@linaro.org; helo=mail-lj1-x230.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 Access QOM parent with the proper QOM VIRTIO_SCSI_COMMON() macro. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Mark Cave-Ayland --- hw/scsi/virtio-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 45b95ea070..fa53f0902c 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -761,7 +761,7 @@ static void virtio_scsi_fail_cmd_req(VirtIOSCSIReq *req) static int virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req) { - VirtIOSCSICommon *vs = &s->parent_obj; + VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s); SCSIDevice *d; int rc; From patchwork Tue Oct 17 14:01:48 2023 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: 734406 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp498265wro; Tue, 17 Oct 2023 07:03:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWPhMPJqf+5R5TZyBwzUVPszu606D1L3RmbfTZ3jmyXdEorrJPBbP7fXOiW9gUpjVJybRt X-Received: by 2002:a67:cb92:0:b0:458:3bc1:8941 with SMTP id h18-20020a67cb92000000b004583bc18941mr1207509vsl.22.1697551420717; Tue, 17 Oct 2023 07:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551420; cv=none; d=google.com; s=arc-20160816; b=R5nUEa3/rsQCPyVsACakBRoN6F16hPFybxHyGD/QqFJLhFKup91F4FykYVmh54ytmi HtlohyceGCB5SN0/kx/SYCyE4DtDPHGoyTMjO8eiTG/IIQ3yA8o3T6+eq8tmo1FtzbRr JchKyRd0hLTECzzUcSlBqM6S2OIY0+6GaLfvBJcsxBHjwMuoTOJxhYJpTtw0Zu80Qgie KdAjaHQACsbK5b3WmOS+MwSIYahE33PkCo7iKlni2AV7q7PbXUDTnDIQFQw7u2nbQ8ey 10cptle+XfB/bL0sfGeErrYRJkrHLiw8Jk/jdH2g6DNX5t2gH1bRUhOiY4U8D5G32BO2 ufQA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8Zd7XFPGgQEK2cJC81izUf+xDXi7YU9Dxs0UeK55tGc=; fh=PkQUf9c5shm23GEgSgwIjaGjrTFXVTBGToef+bFaIfM=; b=exW9xu0Dwx6TBXfo6kGriii5pA1ymFKPEfalIPJY1Z1qUd7D+yM4nwk+0vHElieQn6 g4nImRKraF8yPAJgqUnG3EGnNTHjgtNG/JBHr6M3XZr+TNlWZzkV/QqzoGUuFUSiUBfu 9JAEqkR6weJo78QnfE+uAnT1jwxJ+tp4eLMeMU98xWxysfrnw2auU/z7lhUduHyXKx5h IqWE+650vcqv9uKtkEdVGCx6dFZJF9wj5bPdWMvBAKcnV0yEZSXiZ8Lsx5CkSEduWEkI pazQ39/Oef636t2AAuYl/DGR8M+bGbVZO29aL0fgQs+zvOWvkPkXzyv6HMlbYBkox2NQ 41RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sMVJhPUZ; 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 p13-20020a67f30d000000b00452662c4284si126923vsf.739.2023.10.17.07.03.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2023 07:03:40 -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=pass header.i=@linaro.org header.s=google header.b=sMVJhPUZ; 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 1qsket-0004pd-4u; Tue, 17 Oct 2023 10:02:55 -0400 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 1qsked-0004F2-2j for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:40 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qskeZ-0008Q3-NC for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:38 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4064876e8b8so60406065e9.0 for ; Tue, 17 Oct 2023 07:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697551351; x=1698156151; 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=8Zd7XFPGgQEK2cJC81izUf+xDXi7YU9Dxs0UeK55tGc=; b=sMVJhPUZHMJjYFGLGbMb5BHLHrWSFrRS5URZ00agLBSFkOAjuLF7+SupN/pCddravn vPwbEviyf0vNTn0KI4CpLdeV2E9WMXiPs+a0Qu4gHhwD+IojRlGyaRv8DDs7oHZsJIeH +Sm2/oxNIY4bNWcf8BFyZHqOG+UuihzmCmN0eAhZFHBXh34G9TPDHhKIkV6b3sL5Qhec EICDkUiEam61zFHQKHfrs2FEIe9y8bD6anQn9S2dIOApSWL3ZkQkCv3lte7HckoUPafb XNWzQ019M1BjU7kxLxhHE/VaJiw4BJTp+VtO/g1Mjk4HzKLO7VBM4TjFGyPyHGhShajX 4HuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551351; x=1698156151; 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=8Zd7XFPGgQEK2cJC81izUf+xDXi7YU9Dxs0UeK55tGc=; b=DuSwazjrm1xEzF7nvv0DnH3sJlW142sakdauG9H6C49XA2Ho1UnefjxCQdJJKx2vEo Ys9EqNBbkgl/7gBG4ki98ejFTtdyg9EZY10U5aoEMUmoXW8Wds7UpijgwaTv+KlMNRyD 7qEWa1hQsGsuz/qerP7JQHmKOyv6y4popTdktkpQX/26qDLd/+hhU7yCVk9IQxwol8ea GBbqarvBCgy7MVLJrMciUGdyfYNo+tFEwgW+E6TL358dFWksU+wJVaDRqH1NeJPbIgvW 6/4alEWsF8p1hRlEASfDSep2VI4+UaPrADCL4b8K8EnSLldx6HF+EfNTHcRVK/C9kpY8 TwIQ== X-Gm-Message-State: AOJu0Yx/yy2SS0if9HQqpjAH0XSdACFIUJuot4FCWxaFbs4OkGXf3yXt zW2pJMSPFqwT6NeRmN7m+QxY6fhSHoeJpNvSrIZaZQ== X-Received: by 2002:a5d:5232:0:b0:313:f463:9d40 with SMTP id i18-20020a5d5232000000b00313f4639d40mr1747107wra.65.1697551350315; Tue, 17 Oct 2023 07:02:30 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.33]) by smtp.gmail.com with ESMTPSA id o14-20020a5d62ce000000b0031779a6b451sm1744270wrv.83.2023.10.17.07.02.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 17 Oct 2023 07:02:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Hanna Reitz , Fam Zheng , qemu-arm@nongnu.org, "Michael S. Tsirkin" , qemu-block@nongnu.org, Kevin Wolf , Jason Wang , Peter Maydell , Raphael Norwitz , "Edgar E. Iglesias" , Alistair Francis , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/7] hw/dma: Declare link using static DEFINE_PROP_LINK() macro Date: Tue, 17 Oct 2023 16:01:48 +0200 Message-ID: <20231017140150.44995-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017140150.44995-1-philmd@linaro.org> References: <20231017140150.44995-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Declare link statically using DEFINE_PROP_LINK(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- hw/dma/xilinx_axidma.c | 6 ++---- hw/dma/xlnx-zdma.c | 7 ++----- hw/dma/xlnx_csu_dma.c | 13 ++++--------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 12c90267df..0ae056ed06 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -577,10 +577,6 @@ static void xilinx_axidma_init(Object *obj) object_initialize_child(OBJECT(s), "axistream-control-connected-target", &s->rx_control_dev, TYPE_XILINX_AXI_DMA_CONTROL_STREAM); - object_property_add_link(obj, "dma", TYPE_MEMORY_REGION, - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); sysbus_init_irq(sbd, &s->streams[0].irq); sysbus_init_irq(sbd, &s->streams[1].irq); @@ -596,6 +592,8 @@ static Property axidma_properties[] = { tx_data_dev, TYPE_STREAM_SINK, StreamSink *), DEFINE_PROP_LINK("axistream-control-connected", XilinxAXIDMA, tx_control_dev, TYPE_STREAM_SINK, StreamSink *), + DEFINE_PROP_LINK("dma", XilinxAXIDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c index 4eb7f66e9f..84c0083013 100644 --- a/hw/dma/xlnx-zdma.c +++ b/hw/dma/xlnx-zdma.c @@ -795,11 +795,6 @@ static void zdma_init(Object *obj) TYPE_XLNX_ZDMA, ZDMA_R_MAX * 4); sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq_zdma_ch_imr); - - object_property_add_link(obj, "dma", TYPE_MEMORY_REGION, - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); } static const VMStateDescription vmstate_zdma = { @@ -817,6 +812,8 @@ static const VMStateDescription vmstate_zdma = { static Property zdma_props[] = { DEFINE_PROP_UINT32("bus-width", XlnxZDMA, cfg.bus_width, 64), + DEFINE_PROP_LINK("dma", XlnxZDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c index 88002698a1..e89089821a 100644 --- a/hw/dma/xlnx_csu_dma.c +++ b/hw/dma/xlnx_csu_dma.c @@ -702,6 +702,10 @@ static Property xlnx_csu_dma_properties[] = { * which channel the device is connected to. */ DEFINE_PROP_BOOL("is-dst", XlnxCSUDMA, is_dst, true), + DEFINE_PROP_LINK("stream-connected-dma", XlnxCSUDMA, tx_dev, + TYPE_STREAM_SINK, StreamSink *), + DEFINE_PROP_LINK("dma", XlnxCSUDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), }; @@ -728,15 +732,6 @@ static void xlnx_csu_dma_init(Object *obj) memory_region_init(&s->iomem, obj, TYPE_XLNX_CSU_DMA, XLNX_CSU_DMA_R_MAX * 4); - - object_property_add_link(obj, "stream-connected-dma", TYPE_STREAM_SINK, - (Object **)&s->tx_dev, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); - object_property_add_link(obj, "dma", TYPE_MEMORY_REGION, - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); } static const TypeInfo xlnx_csu_dma_info = { From patchwork Tue Oct 17 14:01:49 2023 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: 734408 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp499169wro; Tue, 17 Oct 2023 07:04:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpUu9qd/zTKe7WNQ+opMOCCL1w3DqC0dYPXyDiuCe1Pl2ncC7TZ3cJpARrgTX/VRuj0pjz X-Received: by 2002:a05:6512:401:b0:504:7bb0:9d7e with SMTP id u1-20020a056512040100b005047bb09d7emr1925452lfk.27.1697551494476; Tue, 17 Oct 2023 07:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551494; cv=none; d=google.com; s=arc-20160816; b=YI/jWfmlBh23ylvO9uRYt/KdBM8GIrldh2buZtjyww91fMfYFr27RzAk6iahJhpEhC ge7FGgtB879lwdnECzSepaxOepBdty2kH80iEf4fBv9i7MaMqJGNVfmWz77woO1sLZ8q SIWDMEPMI+olAblYDz9o1lDY74VKqfT/6pNBZyvWmSb4Uh8fCElhFulkcKkMmXbM3TwQ LTM7NxzBnrNZJqXQguGKDMYy2xkkfWLWbfpRzgy7WYEVnwSsncRHOROkBmiMM/zc6Gm/ UANieZgU960O+vr8Xsi2NzInqH1c9DG+vzLxKx38htLJxOiZJDLAqDRGmeDYOh5DbMF5 HxGg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NToGoJ6Wynf9U+JMhRHgYhmueSEj1NaVzBYgpFOz3E4=; fh=PkQUf9c5shm23GEgSgwIjaGjrTFXVTBGToef+bFaIfM=; b=T1X1Awe8VMPM3rEFUb9jfQnJwB3uMAhbaI239JT/GkwCDFA94xzWcZFtaRbWf1n9Rd jXbjjSEM5TeTdQWjEh5lS1ijs4PmTjx7F93S3pa63PvS7HaY/oDcgo47GZsQLWmwo5MX /khJpAN7OYGpZ4JCwCuYyt7HmQ/KUAiarCdSneY7MBav2/YeVkYHjU+gA3fTg6kQM6AY isJedhZdRzHt3tdQbEQcACJ1DEclM5n390ZWWdI6Q3144XcnELDuhgo8BnMIJi3sLH6o chgZKzNZw5tWEEj8mX5XG9gO6J5Bpg/um3wK27xI34t/f0H4OFgcKCbWT/r+nUc8QDz8 6HaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ud+JuwQq; 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 x13-20020adff64d000000b0032d9357110asi1036812wrp.990.2023.10.17.07.04.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2023 07:04:54 -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=pass header.i=@linaro.org header.s=google header.b=ud+JuwQq; 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 1qskeu-00054K-RE; Tue, 17 Oct 2023 10:02:56 -0400 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 1qskem-0004OL-JA for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:50 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qskei-0008RF-Kt for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:48 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32da9ef390fso2280392f8f.2 for ; Tue, 17 Oct 2023 07:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697551359; x=1698156159; 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=NToGoJ6Wynf9U+JMhRHgYhmueSEj1NaVzBYgpFOz3E4=; b=ud+JuwQq1dph6KsVXgWvspTQVI7sdDS3ycspcbTA4YwwurxLANaNIB6FsnvepHr7fX 2MYfvF49fVzTptSTTeusr5O6e0Egr0RIeyUhmVpZ32V5p+uB0/Nugd63oD/4wkb1Kqk/ J8eOjbsWY3XgKRsRBebsK4nCGhy2E+uKev06hDx+EWV/urBhuBzghfqd5alMcQxIfw2B c4TENnQhggLvnnaMQhecFUMDyDJnWG/6N8rNtG7lkt1hythIW5Oa7EyVGbs4wOpJtYjn JxIRdtQD9fzS6HzIXscCLAN+keWIVrLYbmP1VStmLbVSUDmoHDpxosQqEBXBeFSiSFYG +IJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551359; x=1698156159; 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=NToGoJ6Wynf9U+JMhRHgYhmueSEj1NaVzBYgpFOz3E4=; b=c+uLL0LZIQBK/ZG4YTF0MZyfkRRZTJLd0GHTcBE+aRwxtHBM3x60PcJBHeiqzL7mGU Zjo/cyIY9+QhRtGGJ2mAbX3WpTEfExbLestN3Cc6G2E9vY45cgOkf/gx9K65N9NroIOA Ks0oDuuMQXZs2fYkSnZcrLucshuqxaVu7okXFtlfW1w9H8S9KrmBSeoxzpJ4KbxHLFPF 651HRqew5VduUykOatXpUk7Ez4ZFbuEarUKfVMeHJqROV71LWVtt4Z+7Mgco527gsbdh n9DI4voTiZSFqAE9zva38VN45q5GwpgFdve2PMLb1tQRQ7Wl6ZtTNxuJVDQ+EvlfLIFD +rSQ== X-Gm-Message-State: AOJu0YzesZ6LFpLx2SMKB1AEWM0jLHZLwGzPcr+Yqcy5z2KrWfN7jSQj eDo3bpwAuZSBYs2eDiW1B5HpnAAECvbLVYBreFgyRg== X-Received: by 2002:a5d:5107:0:b0:32d:937c:9ac9 with SMTP id s7-20020a5d5107000000b0032d937c9ac9mr2373929wrt.31.1697551358060; Tue, 17 Oct 2023 07:02:38 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.33]) by smtp.gmail.com with ESMTPSA id l17-20020a5d6751000000b003200c918c81sm1735455wrw.112.2023.10.17.07.02.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 17 Oct 2023 07:02:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Hanna Reitz , Fam Zheng , qemu-arm@nongnu.org, "Michael S. Tsirkin" , qemu-block@nongnu.org, Kevin Wolf , Jason Wang , Peter Maydell , Raphael Norwitz , "Edgar E. Iglesias" , Alistair Francis , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 6/7] hw/net: Declare link using static DEFINE_PROP_LINK() macro Date: Tue, 17 Oct 2023 16:01:49 +0200 Message-ID: <20231017140150.44995-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017140150.44995-1-philmd@linaro.org> References: <20231017140150.44995-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 Declare link statically using DEFINE_PROP_LINK(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- hw/net/cadence_gem.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index f445d8bb5e..37e209cda6 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1654,11 +1654,6 @@ static void gem_init(Object *obj) "enet", sizeof(s->regs)); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); - - object_property_add_link(obj, "dma", TYPE_MEMORY_REGION, - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); } static const VMStateDescription vmstate_cadence_gem = { @@ -1691,6 +1686,8 @@ static Property gem_properties[] = { num_type2_screeners, 4), DEFINE_PROP_UINT16("jumbo-max-len", CadenceGEMState, jumbo_max_len, 10240), + DEFINE_PROP_LINK("dma", CadenceGEMState, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), }; From patchwork Tue Oct 17 14:01:50 2023 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: 734405 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp498260wro; Tue, 17 Oct 2023 07:03:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgUQaUzIoN4RM+z2C8LHatAKbcMGnHibzPd6pHh+XCIhm2+vC00qce6tYrDIoKoja8fLuC X-Received: by 2002:a05:6214:d69:b0:64c:9d23:8f55 with SMTP id 9-20020a0562140d6900b0064c9d238f55mr3352357qvs.58.1697551420202; Tue, 17 Oct 2023 07:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551420; cv=none; d=google.com; s=arc-20160816; b=SEYWmgb/CJxZJC4AXQp0fivaEFRejH5vwiC+Qtug2q/ehkFuja0EECzum6RnJsloqp dgvmk61ute7dgQXVAIx2OBSiL+UT3tybVc4i0Nh0tom+CHFmXvO2RPqaJs4nQLd4/iQF oiIDOPRdqQCcUR3vezZJNJQaCkucz6aA0/+5OCuOY1Rfkb8ZzZEgWg8V6wFItuCOwIq0 vClRG20xOJvBgz61fOukaQSDi0zlGcni/Ba06HGprwVyjFKZw5LKLJHHeA6EyQjYhFVX kwi+d4kkkXu18aG9Oo4ejV2nTOaLeCM8XS/Dleu907TdfAwTRCSVU3hb08lJlCPSXdE7 Ivug== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WSV6TxGYLgcQL/krz5TOyE8HELjjUeVpowrQ5kqb6M0=; fh=PkQUf9c5shm23GEgSgwIjaGjrTFXVTBGToef+bFaIfM=; b=tmfgq8RoKCI0eLBZ+sy2VbdAj7rhY3css+Msu957E8jzhB4u3VoKQlefs64DpAJ0Hy hieRgGAYDy3InrBu/+Fs5x0bHoThV8VKf++TH3C7+J3yPzd1Xi6GNyjhZIMibEosLyPP E/Rr60wGguRRUq7ZPHZGIsnfZJ1pqhfuihKKzbnxQ+Oa8JExP9MnwqwQdSvsoz+WZTv6 usobgVOdjDrvyw11Ic1Dgs3R1YPyifjwTNuXyl8DNVrIlw/Eb8Pvq9wCHVOR7aJwKaFX f6QE7K0n24mafOZuhXCUg/VWQMW4r/Q9dtjCNlFGqLK2wjWSAYo9thlgjYE5pcXwFtqz cMnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ChgdXX7h; 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 dj3-20020a056214090300b0065637c67204si994275qvb.334.2023.10.17.07.03.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2023 07:03:40 -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=pass header.i=@linaro.org header.s=google header.b=ChgdXX7h; 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 1qsket-0004sa-Ev; Tue, 17 Oct 2023 10:02:55 -0400 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 1qskep-0004P2-0m for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:52 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qskem-0008Sa-9t for qemu-devel@nongnu.org; Tue, 17 Oct 2023 10:02:50 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40684f53ef3so60050235e9.3 for ; Tue, 17 Oct 2023 07:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697551366; x=1698156166; 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=WSV6TxGYLgcQL/krz5TOyE8HELjjUeVpowrQ5kqb6M0=; b=ChgdXX7hg0odR/B9WbhlAGKUQatVxNaRdajE2hHb2knOpCxehS/w8D+KGiVRTpmMEt tMKPijUzP7GHwArvUjRVpMo+J6XQbmjOVkNZVe/lzzTJv5oozJB6OuDwowkX8+2wdRjW XRTQdYoWm34yAVsPASVtv2GuP4t1Um5Skpy5q6pWYmcy6pHZCgd0ucwZI+CGkrwWtHtP ViyR85uVxc9XZQGlGW5XjO6iHO/0SY2VPvgwWdlJli3UYRa734lcd2bJQkF4WwvrVNkD 1Vit5Qkd2wcul3Z5Jt/KuoBuoAWsoibAmjnaXlSXvGRSkndXwRn+fVOSbh0lhlfudZmb NUbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551366; x=1698156166; 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=WSV6TxGYLgcQL/krz5TOyE8HELjjUeVpowrQ5kqb6M0=; b=Nbxu6603HGGLT/VIVsEdxXWos1z5UgJTTn8NCvDPM1kDc+ogCemecG4zc02WWB07DX IB9ve/ZCkNyhZnP4JoAUxZkITBNDXjwqornbe1Q/pArQg7gp7L/VST3cACbkrqkAalia OjqhHWDOM914GezI2VwrkNI/5pRho6rPEJy9GEZNoUUdKpIR6f7T28OMa2/UkDj/VeDY rQf/2qfGpN5XI6Oe7HDha4INnzkHEroLlJFXCC7+Xm/Xn+vs0wlgZk9/EZina1CSGiFJ rElmBn4xNu5j/AME/40dhdbYRhdobUA7RKklcd+TyES4vZXuwFWCblMSz+7RA1pyBO2N miFw== X-Gm-Message-State: AOJu0Yznw6eNGZLNlSHXJ0PUf3IyZ7TmqqsAeut2vDBeTty1ehPiPRL+ uRx1UL7KCF9TjKJa5COscqdfqcm5otOb7W6INsDNzQ== X-Received: by 2002:a05:6000:a87:b0:32d:8894:6aa2 with SMTP id dh7-20020a0560000a8700b0032d88946aa2mr1705571wrb.2.1697551365810; Tue, 17 Oct 2023 07:02:45 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.33]) by smtp.gmail.com with ESMTPSA id x5-20020a5d60c5000000b0032179c4a46dsm1731419wrt.100.2023.10.17.07.02.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 17 Oct 2023 07:02:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Hanna Reitz , Fam Zheng , qemu-arm@nongnu.org, "Michael S. Tsirkin" , qemu-block@nongnu.org, Kevin Wolf , Jason Wang , Peter Maydell , Raphael Norwitz , "Edgar E. Iglesias" , Alistair Francis , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 7/7] hw/usb: Declare link using static DEFINE_PROP_LINK() macro Date: Tue, 17 Oct 2023 16:01:50 +0200 Message-ID: <20231017140150.44995-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017140150.44995-1-philmd@linaro.org> References: <20231017140150.44995-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 Pull the 'dma' property to the core XHCI type, declare its link statically using DEFINE_PROP_LINK(). Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-xhci-sysbus.c | 4 ---- hw/usb/hcd-xhci.c | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c index faf57b4797..15983d0b96 100644 --- a/hw/usb/hcd-xhci-sysbus.c +++ b/hw/usb/hcd-xhci-sysbus.c @@ -60,10 +60,6 @@ static void xhci_sysbus_instance_init(Object *obj) object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI); qdev_alias_all_properties(DEVICE(&s->xhci), obj); - object_property_add_link(obj, "dma", TYPE_MEMORY_REGION, - (Object **)&s->xhci.dma_mr, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); s->xhci.intr_update = NULL; s->xhci.intr_raise = xhci_sysbus_intr_raise; } diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 4b60114207..012a6f3644 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3638,6 +3638,8 @@ static Property xhci_properties[] = { DEFINE_PROP_UINT32("p3", XHCIState, numports_3, 4), DEFINE_PROP_LINK("host", XHCIState, hostOpaque, TYPE_DEVICE, DeviceState *), + DEFINE_PROP_LINK("dma", XHCIState, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), };