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 X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32627C2BB48 for ; Tue, 15 Dec 2020 14:40:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1E862251E for ; Tue, 15 Dec 2020 14:40:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1E862251E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpBUm-0002jK-PO for qemu-devel@archiver.kernel.org; Tue, 15 Dec 2020 09:40:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpBFk-0000kD-Mp for qemu-devel@nongnu.org; Tue, 15 Dec 2020 09:24:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kpBFh-0002Zk-DV for qemu-devel@nongnu.org; Tue, 15 Dec 2020 09:24:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608042271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z+cQ0iEhkWfsQjRdH/t6R2th3kreynHohts1awCUh9o=; b=Ko4wtxjkfEZQpR7fbZDpPvPaHZKGNS7DdCcQ1zBCUGsboRiTqMDm3kSJPzpKxVjD+iVsT6 ilgZaOCwUpUMPZKnLTDEto4zipOU/7xFKL0JasYgZSFzmu98KoqkbYA6ivoC4FhE748PGU fsE5WURd0IVmspMqw9Fv6BV8A8B7VYA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-FIzfC_48MYiPhrV1QHKixw-1; Tue, 15 Dec 2020 09:24:28 -0500 X-MC-Unique: FIzfC_48MYiPhrV1QHKixw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D39810054FF; Tue, 15 Dec 2020 14:24:26 +0000 (UTC) Received: from localhost (ovpn-113-127.ams2.redhat.com [10.36.113.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id A633A179B3; Tue, 15 Dec 2020 14:24:20 +0000 (UTC) Date: Tue, 15 Dec 2020 15:24:18 +0100 From: Igor Mammedov To: Eduardo Habkost Subject: Re: [PATCH v4 23/32] qdev: Move dev->realized check to qdev_property_set() Message-ID: <20201215152418.0e8dff6b@redhat.com> In-Reply-To: <20201214172418.GK1289986@habkost.net> References: <20201211220529.2290218-1-ehabkost@redhat.com> <20201211220529.2290218-24-ehabkost@redhat.com> <20201214155530.55f80cd6@redhat.com> <20201214172418.GK1289986@habkost.net> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, 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, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthew Rosato , Paul Durrant , Mark Cave-Ayland , qemu-devel@nongnu.org, Stefano Stabellini , qemu-block@nongnu.org, Stefan Berger , David Hildenbrand , Markus Armbruster , Halil Pasic , Christian Borntraeger , Anthony Perard , =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau , Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= , Artyom Tarasenko , Thomas Huth , Alex Williamson , xen-devel@lists.xenproject.org, John Snow , Richard Henderson , Kevin Wolf , "Daniel P. Berrange" , Cornelia Huck , qemu-s390x@nongnu.org, Max Reitz , Paolo Bonzini , Stefan Berger Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, 14 Dec 2020 12:24:18 -0500 Eduardo Habkost wrote: > On Mon, Dec 14, 2020 at 03:55:30PM +0100, Igor Mammedov wrote: > > On Fri, 11 Dec 2020 17:05:20 -0500 > > Eduardo Habkost wrote: > > > > > Every single qdev property setter function manually checks > > > dev->realized. We can just check dev->realized inside > > > qdev_property_set() instead. > > > > > > The check is being added as a separate function > > > (qdev_prop_allow_set()) because it will become a callback later. > > > > is callback added within this series? > > and I'd add here what's the purpose of it. > > It will be added in part 2 of the series. See v3: > https://lore.kernel.org/qemu-devel/20201112214350.872250-35-ehabkost@redhat.com/ > > I don't know what else I could say about its purpose, in addition > to what I wrote above, and the comment below[1]. > > If you are just curious about the callback and confused because > it is not anywhere in this series, I can just remove the > paragraph above from the commit message. Would that be enough? lets remove it for now to avoid confusion Reviewed-by: Igor Mammedov > > > > [...] > > > +/* returns: true if property is allowed to be set, false otherwise */ > > [1] ^^^ > > > > +static bool qdev_prop_allow_set(Object *obj, const char *name, > > > + Error **errp) > > > +{ > > > + DeviceState *dev = DEVICE(obj); > > > + > > > + if (dev->realized) { > > > + qdev_prop_set_after_realize(dev, name, errp); > > > + return false; > > > + } > > > + return true; > > > +} > > > + > 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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27AD1C4361B for ; Tue, 15 Dec 2020 14:24:42 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF72522518 for ; Tue, 15 Dec 2020 14:24:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF72522518 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.54282.94242 (Exim 4.92) (envelope-from ) id 1kpBFh-0005ih-29; Tue, 15 Dec 2020 14:24:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 54282.94242; Tue, 15 Dec 2020 14:24:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kpBFg-0005ia-V8; Tue, 15 Dec 2020 14:24:32 +0000 Received: by outflank-mailman (input) for mailman id 54282; Tue, 15 Dec 2020 14:24:32 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kpBFg-0005iV-G8 for xen-devel@lists.xenproject.org; Tue, 15 Dec 2020 14:24:32 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [216.205.24.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id e633bffd-4d2e-4982-b50c-96d9494dc207; Tue, 15 Dec 2020 14:24:30 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-FIzfC_48MYiPhrV1QHKixw-1; Tue, 15 Dec 2020 09:24:28 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D39810054FF; Tue, 15 Dec 2020 14:24:26 +0000 (UTC) Received: from localhost (ovpn-113-127.ams2.redhat.com [10.36.113.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id A633A179B3; Tue, 15 Dec 2020 14:24:20 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e633bffd-4d2e-4982-b50c-96d9494dc207 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608042270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z+cQ0iEhkWfsQjRdH/t6R2th3kreynHohts1awCUh9o=; b=LllXFXE7rrTc8cS3G7F6KkdNKMl58YSExNmZTQznDQuVDErKoK8CkArKgggYCDljAhR1eR ikdmBAyC5iawQ7KM4wq+3JYLbPsKenNuKClgX7+MgiLe8UssolBQ9PCk+eZbwyhNZQbK1K GLvh/7XDFeSl1kF6UEZc2I1zEx6ATyY= X-MC-Unique: FIzfC_48MYiPhrV1QHKixw-1 Date: Tue, 15 Dec 2020 15:24:18 +0100 From: Igor Mammedov To: Eduardo Habkost Cc: qemu-devel@nongnu.org, Markus Armbruster , Stefan Berger , =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau , "Daniel P. Berrange" , Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= , John Snow , Kevin Wolf , Eric Blake , Paolo Bonzini , Stefan Berger , Stefano Stabellini , Anthony Perard , Paul Durrant , Max Reitz , Cornelia Huck , Halil Pasic , Christian Borntraeger , Richard Henderson , David Hildenbrand , Thomas Huth , Matthew Rosato , Alex Williamson , Mark Cave-Ayland , Artyom Tarasenko , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org Subject: Re: [PATCH v4 23/32] qdev: Move dev->realized check to qdev_property_set() Message-ID: <20201215152418.0e8dff6b@redhat.com> In-Reply-To: <20201214172418.GK1289986@habkost.net> References: <20201211220529.2290218-1-ehabkost@redhat.com> <20201211220529.2290218-24-ehabkost@redhat.com> <20201214155530.55f80cd6@redhat.com> <20201214172418.GK1289986@habkost.net> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 14 Dec 2020 12:24:18 -0500 Eduardo Habkost wrote: > On Mon, Dec 14, 2020 at 03:55:30PM +0100, Igor Mammedov wrote: > > On Fri, 11 Dec 2020 17:05:20 -0500 > > Eduardo Habkost wrote: > > > > > Every single qdev property setter function manually checks > > > dev->realized. We can just check dev->realized inside > > > qdev_property_set() instead. > > > > > > The check is being added as a separate function > > > (qdev_prop_allow_set()) because it will become a callback later. > > > > is callback added within this series? > > and I'd add here what's the purpose of it. > > It will be added in part 2 of the series. See v3: > https://lore.kernel.org/qemu-devel/20201112214350.872250-35-ehabkost@redhat.com/ > > I don't know what else I could say about its purpose, in addition > to what I wrote above, and the comment below[1]. > > If you are just curious about the callback and confused because > it is not anywhere in this series, I can just remove the > paragraph above from the commit message. Would that be enough? lets remove it for now to avoid confusion Reviewed-by: Igor Mammedov > > > > [...] > > > +/* returns: true if property is allowed to be set, false otherwise */ > > [1] ^^^ > > > > +static bool qdev_prop_allow_set(Object *obj, const char *name, > > > + Error **errp) > > > +{ > > > + DeviceState *dev = DEVICE(obj); > > > + > > > + if (dev->realized) { > > > + qdev_prop_set_after_realize(dev, name, errp); > > > + return false; > > > + } > > > + return true; > > > +} > > > + >