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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2F17DCDB47E for ; Wed, 18 Oct 2023 10:36:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt3uf-0001PX-Qw; Wed, 18 Oct 2023 06:36:30 -0400 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 1qt3uV-00018e-Js for qemu-devel@nongnu.org; Wed, 18 Oct 2023 06:36:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt3uT-0004fC-Gl for qemu-devel@nongnu.org; Wed, 18 Oct 2023 06:36:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697625377; 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: in-reply-to:in-reply-to:references:references; bh=iRAoJ/UQGSfOC20mwkXtROWM4Ehq8lF8yUT4p97bEag=; b=C+ZhZkbIW0Iw5Oxbvj7qp+i8zYpsZVLBBulcEpi65kkBAmWpooafzI7CG1ug9w9Kandjdi x4aQncYAqfqCISiQvtDDYmmcfyv0TD5OSJpux6hxH1/dNVpOjLdLBdlclXNrc/VadX/QEz p2+lh593Uny5oY3sIhW2Vd8Yf/GzBWI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-522-Fi5veOdlOweESd_mX4aoPg-1; Wed, 18 Oct 2023 06:36:12 -0400 X-MC-Unique: Fi5veOdlOweESd_mX4aoPg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44101185A7B3; Wed, 18 Oct 2023 10:36:12 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C55DC40C6CA0; Wed, 18 Oct 2023 10:36:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CD80021E6A1F; Wed, 18 Oct 2023 12:36:10 +0200 (CEST) From: Markus Armbruster To: Vladimir Sementsov-Ogievskiy Cc: Markus Armbruster , qemu-block@nongnu.org, qemu-devel@nongnu.org, eblake@redhat.com, dave@treblig.org, eduardo@habkost.net, berrange@redhat.com, pbonzini@redhat.com, hreitz@redhat.com, kwolf@redhat.com, raphael.norwitz@nutanix.com, mst@redhat.com, yc-core@yandex-team.ru, den-plotnikov@yandex-team.ru, daniil.tatianin@yandex.ru Subject: Re: [PATCH 4/4] qapi: introduce CONFIG_READ event References: <20231006202045.1161543-1-vsementsov@yandex-team.ru> <20231006202045.1161543-5-vsementsov@yandex-team.ru> <87sf692t0i.fsf@pond.sub.org> <877cnkzasr.fsf@pond.sub.org> Date: Wed, 18 Oct 2023 12:36:10 +0200 In-Reply-To: (Vladimir Sementsov-Ogievskiy's message of "Wed, 18 Oct 2023 11:51:31 +0300") Message-ID: <878r80tdyd.fsf@pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Vladimir Sementsov-Ogievskiy writes: > On 18.10.23 09:47, Markus Armbruster wrote: >> Vladimir Sementsov-Ogievskiy writes: >> >>> On 17.10.23 18:00, Markus Armbruster wrote: >>>> Vladimir Sementsov-Ogievskiy writes: >>>> >>>>> Send a new event when guest reads virtio-pci config after >>>>> virtio_notify_config() call. >>>>> >>>>> That's useful to check that guest fetched modified config, for example >>>>> after resizing disk backend. >>>>> >>>>> Signed-off-by: Vladimir Sementsov-Ogievskiy >> [...] >> >>>>> diff --git a/qapi/qdev.json b/qapi/qdev.json >>>>> index 2468f8bddf..37a8785b81 100644 >>>>> --- a/qapi/qdev.json >>>>> +++ b/qapi/qdev.json >>>>> @@ -329,3 +329,25 @@ >>>>> # Since: 8.2 >>>>> ## >>>>> { 'command': 'x-device-sync-config', 'data': {'id': 'str'} } >>>>> + >>>>> +## >>>>> +# @X_CONFIG_READ: >>>>> +# >>>>> +# Emitted whenever guest reads virtio device config after config change. >>>>> +# >>>>> +# @device: device name >>>>> +# >>>>> +# @path: device path >>>>> +# >>>>> +# Since: 5.0.1-24 >>>>> +# >>>>> +# Example: >>>>> +# >>>>> +# <- { "event": "X_CONFIG_READ", >>>>> +# "data": { "device": "virtio-net-pci-0", >>>>> +# "path": "/machine/peripheral/virtio-net-pci-0" }, >>>>> +# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } >>>>> +# >>>>> +## >>>>> +{ 'event': 'X_CONFIG_READ', >>>>> + 'data': { '*device': 'str', 'path': 'str' } } >>>> >>>> The commit message talks about event CONFIG_READ, but you actually name >>>> it x-device-sync-config. >>> >>> will fix >>> >>>> I figure you use x- to signify "unstable". Please use feature flag >>>> 'unstable' for that. See docs/devel/qapi-code-gen.rst section >>>> "Features", in particular "Special features", and also the note on x- in >>>> section "Naming rules and reserved names". >>> >>> OK, will do. >>> >>> Hmm, it say >>> >>> Names beginning with ``x-`` used to signify "experimental". This >>> convention has been replaced by special feature "unstable". >>> >>> "replaced".. So, I should use "unstable" flag without "x-" prefix? Can't find an example. Seems "unstable" always used together with "x-". >> >> True. >> >> The "x-" prefix originated with qdev properties. First use might be >> commit f0c07c7c7b4. The convention wasn't documented then, but QOM/qdev >> properties have always been a documentation wasteland. It then spread >> to other places, and eventually to the QAPI schema. Where we try pretty >> hard to document things properly. We documented the "x-" prefix in >> commit e790e666518: >> >> Any name (command, event, type, field, or enum value) beginning with >> "x-" is marked experimental, and may be withdrawn or changed >> incompatibly in a future release. >> >> Minor pain point: when things grow up from experimental to stable, we >> have to rename. >> >> The convention didn't stop us from naming non-experimental things x-FOO, >> e.g. QOM property "x-origin" in commit 6105683da35. Made it to the QAPI >> schema in commit 8825587b53c. Point is: the prefix isn't a reliable >> marker for "unstable". >> >> Since I needed a reliable marker for my "set policy for unstable >> interfaces" feature (see CLI option -compat), I created special feature >> flag "unstable", and dropped the "x-" convention for the QAPI schema. >> >> Renaming existing "x-" names felt like pointless churn, so I didn't. >> >> I'm not objecting to new names starting with "x-". Nor am I objecting >> to feature 'unstable' on names that don't start with "x-". >> >> I guess "x-" remains just fine for things we don't intend to make stable >> at some point. The "x-" can remind humans "this is unstable" better >> than a feature flag can (for machines, it's the other way round). >> >> For things we do intend (hope?) to make stable, I wouldn't bother with >> the "x-". >> >> Clearer now? > > Yes, thanks. > > x- seems safer for management tool that doesn't know about "unstable" properties.. Easy, traditional, and unreliable :) > But on the other hand, changing from x- to no-prefix is already done when the feature is stable, and thouse who use it already use the latest version of interface, so, removing the prefix is just extra work. Exactly. > So, I think, I'd go without prefix. Makes sense. >>> Also, nothing said about events. Is using "X_" wrong idea? Should it be x-SOME_EVENT instead? >> >> Since this is the first unstable event, there is no precedent. Let's >> use no prefix, and move on. >> >>>> The name CONFIG_READ feels overly generic for something that makes sense >>>> only with virtio devices. >>> >>> Hmm, right.. I think, we can say same thing about DEVICE_UNPLUG_GUEST_ERROR. >> >> That one came to be as a generalization of existing MEM_UNPLUG_ERROR and >> a concrete need to signal CPU unplug errors. Demonstrates "unplug guest >> errors" can happen for different kinds of devices. So we went with a >> generic event we can use for all of them. >> This doesn't seem to be the case for this patch's event. Thoughts? > > Right.. VIRTIO_CONFIG_READ maybe? Works for me. [...]