From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03916CD98CC for ; Thu, 11 Jun 2026 14:17:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wXgDx-0000v7-Tb; Thu, 11 Jun 2026 10:17:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wXgDt-0000uF-Nj for qemu-rust@nongnu.org; Thu, 11 Jun 2026 10:17:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wXgDm-000832-6M for qemu-rust@nongnu.org; Thu, 11 Jun 2026 10:17:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781187444; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=5/lsoCh7xZymOLMg2olV5WjcynVfc1hleiPKtSDeibc=; b=hDNNjvuDNfamCuEP849bIc+qlRNAhuzDu24VZec3qM+0BbhIdeZFhsYQWqqIDKsUny6Ipx Zju+JCcbcmfYg8ASh4eQDHPmiS0lQ+uMyV/3hXu6WhzdfBmawMgI8CNCW1z9lvGYcpGxop /8ZD8Mcl/HZdGRLrjvt6yFUzekfHdzQ= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-127-eZLiFdaxNym9QTr-AEPeVQ-1; Thu, 11 Jun 2026 10:17:19 -0400 X-MC-Unique: eZLiFdaxNym9QTr-AEPeVQ-1 X-Mimecast-MFC-AGG-ID: eZLiFdaxNym9QTr-AEPeVQ_1781187437 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7495E1977034; Thu, 11 Jun 2026 14:17:16 +0000 (UTC) Received: from redhat.com (unknown [10.44.50.8]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DFEDA3008B38; Thu, 11 Jun 2026 14:17:09 +0000 (UTC) Date: Thu, 11 Jun 2026 15:17:06 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Mark Cave-Ayland Cc: Peter Xu , qemu-devel@nongnu.org, qemu-arm@nongnu.org, =?utf-8?Q?C=C3=A9dric?= Le Goater , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Fabiano Rosas , Vladimir Sementsov-Ogievskiy , Peter Maydell , "Dr . David Alan Gilbert" , Eric Blake , Akihiko Odaki , Paolo Bonzini , Kevin Wolf , Sana Sharma , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Juraj Marcin , qemu-rust@nongnu.org, Markus Armbruster Subject: Re: [PATCH v2 09/10] qom: Allow default values for instance properties Message-ID: References: <20260609172514.2037645-1-peterx@redhat.com> <20260609172514.2037645-10-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.3.2 (2026-04-26) X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: aNwISdUqFJ6EawpJl3xMUzsfuaYnZHQZbMpYfqbGENE_1781187437 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-rust@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: QEMU Rust-related patches and discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Errors-To: qemu-rust-bounces+qemu-rust=archiver.kernel.org@nongnu.org Sender: qemu-rust-bounces+qemu-rust=archiver.kernel.org@nongnu.org On Thu, Jun 11, 2026 at 03:08:41PM +0100, Mark Cave-Ayland wrote: > On 09/06/2026 18:25, Peter Xu wrote: > > > ObjectProperty allows default value settings via proper setup of > > prop->init() and prop->defval. It currently is only supported in class > > properties, not instance properties. > > > > However, since QOM allows class and instance properties, it should also > > allow instance to add properties during instance_init() and allow the > > default values to be applied properly for this instance only. > > Thinking back to the earlier patches, a question that has come up before is > whether we should require all properties to be class properties? Ideally yes, but we have the classic QEMU problem of a big pile of technical debt that would need converting and always more interesting things to work on. Most is a boring mechanical task, but there are some awkward edge cases around dynamically added properties. > IIRC one of > the motivations for this move was to allow schema introspection, but I don't > immediately have a reference to the original discussion. Better supporting introspection was the original key goal, but also reducing memory footprint for classes which have 100s or 1000s of instances registering the same props over & over. Introspection against the class means we trivially avoid risk of side-effects from instantiating objects and not completing their realization. With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|