From patchwork Fri Feb 3 18:09:00 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: 650100 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972380pva; Fri, 3 Feb 2023 10:12:22 -0800 (PST) X-Google-Smtp-Source: AK7set9NyPJkgCmyztVuYfLx/PmgJicjHpI3a8gcG/yET0jaStRrHZbvpvwNjtxp9qYhfcQ5t73g X-Received: by 2002:a05:6102:559e:b0:3f1:1a46:6187 with SMTP id dc30-20020a056102559e00b003f11a466187mr7787376vsb.20.1675447941987; Fri, 03 Feb 2023 10:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447941; cv=none; d=google.com; s=arc-20160816; b=MF8UAsOdTJsIYdjEVw1J4j8Ou6BDOP+1zdx349VVBzIvNO3FWynHbxTE2YYMaWVBpt jw0N0VrsDwoxJTvPHYFHRt9lzRGvwlEQxXDznzyQzBBMCa39rTNnfRyStazZh9vaeKIK b6BDV7hEyvnoCQ57T+SO8g1wG9xQ4MioVKQCSbJuoU98GG5L1Z72kcAouicio8Dyhbxn 28IcIfVTUdvwm2lHBQtmKPGFUKGzDfZPc3YyPMp5Mrtwy/C5bjxfYhPiB8oPlvZWwbzN PTJZVwAQDTkudKUIxVgtxuXiJs+3wahToXRbClCBrOjfIBjwdLJCQMjVSRltLphublqB PkWQ== 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=i7hpzOoatAaR1sv90A1kGZcFCN2UpEoRoocI+6JRu0E=; b=uS9s4nQgokS/zf+6nYEBmt5ywSwEM1qEswiGq4LU1NWWEBFUJa2ziX1OCGLrduXdAl rYCVAIlGbrwXnwBn3fqd+U+ZBlLA7WHvX6Ty5uG+MUnTuHsZxPc48TZ2y/WF9Lsymmpa bzUHt9rC5sZp7skPGchsCmOdvuswpZNlyD0sWASLCZRI7cZfTvOoK9YkafnVppGa6EOe Q6zVkMYU7Pmd4fZBHXj+/1GPUerCzNtFW/F1Ma1rTF5kKcOq8FNrQrfkDCZHQZhp0X2L RG1aPb1j4xlcAQ1OlhQdngjRnhHPKDhh8SbARzyIUKdSBIGOQm5H67zfF1FgY0KkRPYr fBlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z6eTEeWH; 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 n17-20020a0561023ed100b003f86b0c482asi989510vsv.508.2023.02.03.10.12.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:12:21 -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=z6eTEeWH; 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 1pO0VO-000796-8X; Fri, 03 Feb 2023 13:09:46 -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 1pO0VN-00078n-81 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:45 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0VL-0008Ed-Pe for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:45 -0500 Received: by mail-wr1-x436.google.com with SMTP id a2so5116401wrd.6 for ; Fri, 03 Feb 2023 10:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=i7hpzOoatAaR1sv90A1kGZcFCN2UpEoRoocI+6JRu0E=; b=z6eTEeWHfQXgqllooKcV4N3zoNYO15jzWZdtIsI/zQXKfW4kKTCVtgnUybmZOXl1gw sB7bBMD5AcXW7wkfOyQNIJVWUR8/n8BSUvffXvYyH0yGiS5/axnZ2hCz+gkySmfTrdPZ S2hs6bu03Nq2hTPEmCqqVEbP1bgaXvk1NxfSaf//6Hs8E9ZTrHJewvdHsKuIQwUtNWTG PEdkuQyhc+7LritXI3ro0aO4hUQXNrfjkmJ+cqKEO05cjLQZN4sXmdQ0y8B0k5ndkJSE YVZO2yPPE1bHW1tofInIfuiT5KTWWpBhceySQSjmnBr76EuR8CDCn07FsVIYaCEE+nbE Qh4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=i7hpzOoatAaR1sv90A1kGZcFCN2UpEoRoocI+6JRu0E=; b=z4AOcQAk9m/7snxuQ5ZuPH6oX1F6Kahfsc2bEzaKMSURrh5Tl/gNsl9hXo6n0LH+RS 2pwr1BUdmXMPiJoedY0LhfobmlV867lG1kwyAfNvdISa0XVNoUUmk8qTqDB6wt3WRcPb 6jjl9XCjHwAN2JuU2i5Cibp/5995mIaaMEEHSxdYeG4PGWfB5YPSVNgk1V3sELfaXkAi aB34mcv4MuqZiHn2m9OLCuAnJX2hXe1aZ699V1BnCOVyEOFbjHkwiFUOarFSb2oBxrKH mOrvo9BF1OZn6OUHjXsW0qIVtYX4QgKfSTKEBDSiWziu2ZmlwTKPnoqhYrnIA7kasWFN Aetg== X-Gm-Message-State: AO0yUKVcFk/w2QCxfB6H0YLmKMJj32GiCp/hWsNvEHQACNEHdaMfogwY F2cRZk9rt8/yrgbFmYAmI1x5O5xezC1QLKer X-Received: by 2002:adf:fc88:0:b0:2bf:d940:29b6 with SMTP id g8-20020adffc88000000b002bfd94029b6mr9838575wrr.54.1675447782284; Fri, 03 Feb 2023 10:09:42 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e15-20020a5d65cf000000b002bfc0558ecdsm2513920wrw.113.2023.02.03.10.09.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Yanan Wang Subject: [RFC PATCH 05/19] hw/core/numa: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:00 +0100 Message-Id: <20230203180914.49112-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index d8d36b16d8..9b6f9848e3 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -34,6 +34,7 @@ #include "qapi/opts-visitor.h" #include "qapi/qapi-visit-machine.h" #include "sysemu/qtest.h" +#include "hw/qdev-properties.h" #include "hw/core/cpu.h" #include "hw/mem/pc-dimm.h" #include "migration/vmstate.h" @@ -740,8 +741,7 @@ void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp) /* due to bug in libvirt, it doesn't pass node-id from props on * device_add as expected, so we have to fix it up here */ if (slot->props.has_node_id) { - object_property_set_int(OBJECT(dev), "node-id", - slot->props.node_id, errp); + qdev_prop_set_int32(dev, "node-id", slot->props.node_id); } } else if (node_id != slot->props.node_id) { error_setg(errp, "invalid node-id, must be %"PRId64,