From patchwork Fri Feb 16 11:02:53 2024 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: 773310 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1285593wre; Fri, 16 Feb 2024 03:04:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXIdpCi/zcZgopoXyu40mePiA1W6p5+3KCKK4ALQjkwHRkaHAYnH6Q3CRxruewyTRlXupgCUwzDcdGhf4MDLB7i X-Google-Smtp-Source: AGHT+IEWEHAtStIgKAjvzCps104VN+bhsAyXh6zSTVZaNrbM53u98iJ2KQkRgxEQGOhMA6p+kbdo X-Received: by 2002:a05:6214:3d06:b0:68c:cce8:34d5 with SMTP id ol6-20020a0562143d0600b0068ccce834d5mr12989303qvb.32.1708081493475; Fri, 16 Feb 2024 03:04:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081493; cv=none; d=google.com; s=arc-20160816; b=sO6E9SS2xaqHkUAUv2/ufCuXi5go2uVXQOBYuCw6jw6c23aDBbuL0rwGHmybCueYyC gvOUNSHP8mIiEYUQyibUyeZ7lRd4Ki4FFFQfqORvQ9eZpcmr0zLyJ3yvySndfOzJ/vUe Ldu1P+iNsjj1azrvxIV43lS89LBVTFJXo0Eh9eHFVDutWWuXUFLC1O4vk5rmEn8yXh3A x43o3fP1VY6aaX+iVhvyoSeN2FgUblVmgtYHmyMackyzNOpEBQrksqcRYl+VbKTWCvw1 0Ky5XXW2dz7Z00PsTmLaGeg/EA2A6Gbunwj10+6km5HTC4hjJ5soOgALOkSAWllpoB/I /wCg== 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=11uvKBQ22hdk4Lseo0ZUQbLGXppus19b55fkM12lrfA=; fh=lo699SrpvFYJnxFLZ6omanT1M6xx54FOFadsij93CRk=; b=ikE/ffirCoiItsPqQWKWbgSbaKNujsMI0wvBUTIvDkUywLkR/gbL19aeqCQgJAS6XM XKcS5tvdEGoiaoQvfy5lpqwEjFxXU4LklqoKjTfIdIQWXpm4gNQgy881iug+OhOHGF2D tzDbBJogPk5HaOa2skL2MH7KA2BKuAqwVc7Y4oj771sXB4/UhpVpawQcqhs/VmvG7R/o xU622UqDv5Ilo/JCHvUgid1F//DgM/jxXjmzKn6Z8E5bBQ0otxYMz/gE9wrDlZgRn0sz WJdgWLf/0FociQGBoGIVPSOce0a1sUhNIwMUg3EtplEVWMpfVCIFu3h8f0kz5lpG/PnZ KF+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VVtEuRON; 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 l4-20020ac848c4000000b0042db2599576si3329686qtr.700.2024.02.16.03.04.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:04:53 -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=VVtEuRON; 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 1raw0J-0006Jy-Dq; Fri, 16 Feb 2024 06:03:39 -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 1raw0H-0006JE-Mq for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:37 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw0D-0000oV-Ia for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:36 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33d14a711efso681052f8f.2 for ; Fri, 16 Feb 2024 03:03:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081409; x=1708686209; 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=11uvKBQ22hdk4Lseo0ZUQbLGXppus19b55fkM12lrfA=; b=VVtEuRONg16xx1oOe+nOWr24BGDYupjedUe7m/Ujf6aVZ+6pexCN+uWLFWnvv6/die f0p5imiKaKkivgTp0MnTNlr2Xvra4oKuMAKBKsNCGmky56UcgLPxTSbGVeIA7/qUmts1 hd8JyMbK6VxjKivF4ClO3HOjxZ6DXyTYaRKR/pAf0ei7zKtKY3RtciPy8DQTwKH0O0mV PVUSfPxkL7VgsbizmdK9JWuw7bN5bzjwwdPbwgd6To7jkWDMgWn6WGmBNy85sAuq2WFw ReVQmnsYNRJuTvqgeU2ZhqCVZfMShzvN+mXHUSnP7xeSMjG6JH7Xd1Z+UHpwTVQCgv1e fmAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081409; x=1708686209; 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=11uvKBQ22hdk4Lseo0ZUQbLGXppus19b55fkM12lrfA=; b=P7LMImfzuersiKzc/KF0cXreZa50DDJUzlHICS/l8bnSiE3OVBmmQ9Onu0AhdMm0xu WbwP91Y7vDbrbe7722+nfvWmGBDFpSCXkYM3kwCv2AiKGCQ14F/qiSv/1mt38CPfl3wo ZabAxp6xFsCzK4mhfvLgooymdqd2O05OgCMEHfHwuO3PFzGy1AolUzl88FUN3F/7QKDJ K25+0W5/NnT9T25uowshkzrGysAH/CbstLW2VsAf2VsVzGLkCzbznmAendixsZ0TiFaH zt3UO+PVxFcMzucuP4Db8YHx3kH36SMe87+mVeHKvfGsKRrd5r4fWf2uYLDchODkFDda 81Sg== X-Gm-Message-State: AOJu0Yz1NyKC1+SkmLc6vuZ8+u1psoXTHQiLQ8BeL55Gsy/I6eFvZrap E62uJ5Uhu51RlHuabSeKZvNusKkkZPaNsBXrlpSYcPKstG/4yivQKg4+yP4L4ZjOlYpGVKAS+Js n X-Received: by 2002:a5d:408b:0:b0:33a:fafa:8cdc with SMTP id o11-20020a5d408b000000b0033afafa8cdcmr3540983wrp.32.1708081409620; Fri, 16 Feb 2024 03:03:29 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id ay3-20020a5d6f03000000b0033d1b760125sm1780146wrb.92.2024.02.16.03.03.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:03:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH 02/21] hw/i386/pc_sysfw: Use qdev_is_realized() instead of QOM API Date: Fri, 16 Feb 2024 12:02:53 +0100 Message-ID: <20240216110313.17039-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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=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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- hw/i386/pc_sysfw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index c8d9e71b88..3efabbbab2 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -107,17 +107,15 @@ void pc_system_flash_cleanup_unused(PCMachineState *pcms) { char *prop_name; int i; - Object *dev_obj; assert(PC_MACHINE_GET_CLASS(pcms)->pci_enabled); for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) { - dev_obj = OBJECT(pcms->flash[i]); - if (!object_property_get_bool(dev_obj, "realized", &error_abort)) { + if (!qdev_is_realized(DEVICE(pcms->flash[i]))) { prop_name = g_strdup_printf("pflash%d", i); object_property_del(OBJECT(pcms), prop_name); g_free(prop_name); - object_unparent(dev_obj); + object_unparent(OBJECT(pcms->flash[i])); pcms->flash[i] = NULL; } }