From patchwork Sat Jan 25 16:58:53 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: 859808 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp1336142wrq; Sat, 25 Jan 2025 08:59:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWiY4sSEuXgFNMSLCfT84N6Qbn+ylzzzek/Km+XbPWtL+ArBXfm2Cbu0JHWci0e3+obqz5sYQ==@linaro.org X-Google-Smtp-Source: AGHT+IFthNc4FuBVjoV91Ajy6nxQqjXqq507iGXXJOmIcDNqLpw30MUTtj+G3siFuNz4XabvVJcL X-Received: by 2002:a05:620a:2906:b0:7b6:d3b3:5757 with SMTP id af79cd13be357-7be631f2f94mr6016376085a.13.1737824393528; Sat, 25 Jan 2025 08:59:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737824393; cv=none; d=google.com; s=arc-20240605; b=KnB4tlZHBn1LOI7oiEW8e5UHFvsdmRlvS8pI9CoD1eRRprPr1E0Uy8P6A55KIGuy3M 3PV9ChsbdgEIydLib2PGhAndOvZ4O3yJ34ofneaO/f9c0XhUxk7rEYcNehYwSaK6QL/L i1POR7lgJJJBMSELCPwBUHnyttntBfzjb1JiCq2wX6zfKl/mej9zJZ5bGZ5HJTTnSuQr I8E1bsm683El7KnRZRHIRewoPPc0vMtu53h/I2cFYmpbeC2UylCD3lSHhEyvk0IIv7ii tU8V8Rt37WrGLGWIK+CG7pcOUyeIdO1mYm2uncaIYszGZV3ldId5d8QBTGNy3fVKjKqV qK4A== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=vl8eHc07qy9w4iSjn1hsKOzQrxEbvrS/cmwezgpPirA=; fh=/963wIjWycp8sFcKZrvejwXhSgrsSsdFE7NUZmqvDE0=; b=jMKvDxETvVuvtlwmjV8VKtxtcxxBRbArsMXMXOyoAKlnBbD0OWQcqFf/9ey+C+frnE SJC37Ef4WsxyrAv2PIldO6qLnuSFUSxHEn9T3CIJzB9TWU6nQmQBgNOvjOCMzzM6lCw5 8jMcQ6ai4zY44hOzcno+yvpTt72viIalACBxB156js2O/t8L3uezYXpJWoU0mOBs9hA5 cEjYOsbt81au8PQW8kBdBBkHOJWkq9dvCcErs9AmEFZm5EYLIbElLh+f9R8jEaYK/ujx KvHi/BqExijZ+5kEDZlwjYORY2tajc4FWXaXWtYtcBe5BHfd3xH6YZAf8yg5QWEk2AeY 9Z1Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HENe/ZT4"; 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-7be9af11a94si520131785a.506.2025.01.25.08.59.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Jan 2025 08:59: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="HENe/ZT4"; 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 1tbjUu-0003wn-16; Sat, 25 Jan 2025 11:59:04 -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 1tbjUr-0003wC-LD for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:59:02 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjUq-0008No-74 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:59:01 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43626213fffso26480605e9.1 for ; Sat, 25 Jan 2025 08:58:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824337; x=1738429137; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vl8eHc07qy9w4iSjn1hsKOzQrxEbvrS/cmwezgpPirA=; b=HENe/ZT4HhAQ2JqJnAxYKmTyzHItT2iBPjsuTdPzp6OYGyBueJGISM/RBSZcEDNioP /pGanoVQrdvqJ8DW3cAEOfjfqSXnWc1bCSEAX5iPWd/bQdOB1dirB7ppSc+HUtjUGOJ7 SR3AMg6V90z9QpKUrLCgYy1wD132hURh3QxpkE8JtnS11aOi/vGpJlxIadYgvB2w+L0P bkoiRadog4rT14ScyrD+83pOzGbHPOeIZs1dLwcFJZwge8wRkiKpACyMQpUpbiUn7lQ5 uL31B8f5htXuvxJuuSDLcfNEquduh4xt3zq2yjW71cBKc3qIfiX3GWCul789u4wDHSdo XNZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824337; x=1738429137; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vl8eHc07qy9w4iSjn1hsKOzQrxEbvrS/cmwezgpPirA=; b=KnKbCa4fZprLYWLDWdinspLgFZXlVyh3fTGhd6ZYNc6YRmW9CoUswwJcyIKgg3UWdb /6roVusPzRVlGp029xN3jT7V0MEwXkgbx6IHcE7Gr/16UQ2MuVnkmaCaXaexhirJmW2M XWgko05KKmq6pjmmtycA82I+MjO9fd+bYlzzFH0IexTXWt4HhOhl9W3+wF40OZGeINGx TcxSRebSypFhKkJI7T1GEPz36g5tnYr5vJKooOvOtYlZTFfELtq1GewFAggrLSZV1QPB bPF2RQ+75mNgfaHMrMxUkqFnK/Xft9a1WaqyGb3DVf5dfuzrwevWTNkjYEh036THsO9I FLjw== X-Gm-Message-State: AOJu0YxmzYC8/KxP82+HXud9WFRpKdR2vWyrkqli59ibHDkdkcSQ5g+8 CYES80/K+XKazbuOXUOBFo3WFAfLpmkz2uR3wIpSMlZIb9YryPPnLgpFgBAPxUc3hN1be6jT6UC B01s= X-Gm-Gg: ASbGncuPlbIZAWYl0TMevMNcX1N7Nv7Ime+Kmb5CM1lCwQSX7DzaPVgIC2f7M/9kuSA 1pzIGSGdSIX7reKjCCAD0ij0ZlslA45fW7fqdmuCzAp1ZautduNnCHgajwnPyOghfD5731l43K2 GV1HyYDyQ2GDx/Rm27CwW+SIIAj8O+ik/vY9e9IiN8ixya8aLqu+OF8Li/DOfJYUrf3rzaNE3UL iHOV/dtIavH+PE+K3qdTIUZwBwZyj3jc0BASpE/eSnfF+KFpOUhztR9EVNwG7k9evbs+uB9kSM6 PKbxM5QgEaIXk9Zyw6RgV7f37+T385F9vscdxDdALrl93b+cqL3/ciA= X-Received: by 2002:a05:600c:21d8:b0:434:ea1a:e30c with SMTP id 5b1f17b1804b1-438bd0bca9amr74777855e9.13.1737824337360; Sat, 25 Jan 2025 08:58:57 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a188a77sm6148916f8f.51.2025.01.25.08.58.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:58:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-rust@nongnu.org, Eduardo Habkost , Manos Pitsidianakis , Paolo Bonzini , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 0/2] qom: Introduce class_post_init() handler Date: Sat, 25 Jan 2025 17:58:53 +0100 Message-ID: <20250125165855.32168-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 Add a class_post_init() handler to be called by parents *after* child class_init() handler is called. This is necessary to have parent class check children properly set some values or mandatory handlers. Philippe Mathieu-Daudé (2): qom: Declare class_base_init() before class_init() qom: Introduce class_post_init() handler include/qom/object.h | 17 ++++++++++------- qom/object.c | 14 ++++++++++++-- rust/qemu-api/src/qom.rs | 8 +++++++- 3 files changed, 29 insertions(+), 10 deletions(-) Reviewed-by: Richard Henderson Acked-by: Paolo Bonzini