Kevin Wolf
2021-Oct-26 07:37 UTC
[Libguestfs] [PATCH 1/9] qapi: New special feature flag "unstable"
Am 25.10.2021 um 07:25 hat Markus Armbruster geschrieben:> By convention, names starting with "x-" are experimental. The parts > of external interfaces so named may be withdrawn or changed > incompatibly in future releases. > > Drawback: promoting something from experimental to stable involves a > name change. Client code needs to be updated. > > Moreover, the convention is not universally observed: > > * QOM type "input-barrier" has properties "x-origin", "y-origin". > Looks accidental, but it's ABI since 4.2. > > * QOM types "memory-backend-file", "memory-backend-memfd", > "memory-backend-ram", and "memory-backend-epc" have a property > "x-use-canonical-path-for-ramblock-id" that is documented to be > stable despite its name. > > We could document these exceptions, but documentation helps only > humans. We want to recognize "unstable" in code, like "deprecated". > > Replace the convention by a new special feature flag "unstable". It > will be recognized by the QAPI generator, like the existing feature > flag "deprecated", and unlike regular feature flags. > > This commit updates documentation and prepares tests. The next commit > updates the QAPI schema. The remaining patches update the QAPI > generator and wire up -compat policy checking. > > Signed-off-by: Markus Armbruster <armbru at redhat.com>Obviously, replacing the old convention gets rid of the old drawbacks, but adds a new one: While using x- makes it very obvious for a human user that this is an unstable feature, a feature flag in the schema will almost certainly go unnoticed in manual use. Kevin
Kashyap Chamarthy
2021-Oct-26 08:36 UTC
[Libguestfs] [PATCH 1/9] qapi: New special feature flag "unstable"
On Tue, Oct 26, 2021 at 09:37:29AM +0200, Kevin Wolf wrote:> Am 25.10.2021 um 07:25 hat Markus Armbruster geschrieben:[...]> > This commit updates documentation and prepares tests. The next commit > > updates the QAPI schema. The remaining patches update the QAPI > > generator and wire up -compat policy checking. > > > > Signed-off-by: Markus Armbruster <armbru at redhat.com> > > Obviously, replacing the old convention gets rid of the old drawbacks, > but adds a new one: While using x- makes it very obvious for a human > user that this is an unstable feature, a feature flag in the schema will > almost certainly go unnoticed in manual use.FWIW, I wondered about it too, as I like the visual reminder of the "x-" prefix. Then I thought, "how many people besides QEMU and related tooling developers -- who would read QAPI docs anyway :) -- launch experimental QEMU commands manually?" Maybe that's too big of a leap. -- /kashyap
Dr. David Alan Gilbert
2021-Oct-26 09:22 UTC
[Libguestfs] [PATCH 1/9] qapi: New special feature flag "unstable"
* Kevin Wolf (kwolf at redhat.com) wrote:> Am 25.10.2021 um 07:25 hat Markus Armbruster geschrieben: > > By convention, names starting with "x-" are experimental. The parts > > of external interfaces so named may be withdrawn or changed > > incompatibly in future releases. > > > > Drawback: promoting something from experimental to stable involves a > > name change. Client code needs to be updated. > > > > Moreover, the convention is not universally observed: > > > > * QOM type "input-barrier" has properties "x-origin", "y-origin". > > Looks accidental, but it's ABI since 4.2. > > > > * QOM types "memory-backend-file", "memory-backend-memfd", > > "memory-backend-ram", and "memory-backend-epc" have a property > > "x-use-canonical-path-for-ramblock-id" that is documented to be > > stable despite its name. > > > > We could document these exceptions, but documentation helps only > > humans. We want to recognize "unstable" in code, like "deprecated". > > > > Replace the convention by a new special feature flag "unstable". It > > will be recognized by the QAPI generator, like the existing feature > > flag "deprecated", and unlike regular feature flags. > > > > This commit updates documentation and prepares tests. The next commit > > updates the QAPI schema. The remaining patches update the QAPI > > generator and wire up -compat policy checking. > > > > Signed-off-by: Markus Armbruster <armbru at redhat.com> > > Obviously, replacing the old convention gets rid of the old drawbacks, > but adds a new one: While using x- makes it very obvious for a human > user that this is an unstable feature, a feature flag in the schema will > almost certainly go unnoticed in manual use.Agreed, I'd keep the x- as well. Having said that, the x- represents a few different things (that we don't currently distinguish): - experimental - for internal use - for debugging/human use Dave> Kevin >-- Dr. David Alan Gilbert / dgilbert at redhat.com / Manchester, UK
Daniel P. Berrangé
2021-Oct-26 09:28 UTC
[Libguestfs] [PATCH 1/9] qapi: New special feature flag "unstable"
On Tue, Oct 26, 2021 at 10:22:15AM +0100, Dr. David Alan Gilbert wrote:> * Kevin Wolf (kwolf at redhat.com) wrote: > > Am 25.10.2021 um 07:25 hat Markus Armbruster geschrieben: > > > By convention, names starting with "x-" are experimental. The parts > > > of external interfaces so named may be withdrawn or changed > > > incompatibly in future releases. > > > > > > Drawback: promoting something from experimental to stable involves a > > > name change. Client code needs to be updated. > > > > > > Moreover, the convention is not universally observed: > > > > > > * QOM type "input-barrier" has properties "x-origin", "y-origin". > > > Looks accidental, but it's ABI since 4.2. > > > > > > * QOM types "memory-backend-file", "memory-backend-memfd", > > > "memory-backend-ram", and "memory-backend-epc" have a property > > > "x-use-canonical-path-for-ramblock-id" that is documented to be > > > stable despite its name. > > > > > > We could document these exceptions, but documentation helps only > > > humans. We want to recognize "unstable" in code, like "deprecated". > > > > > > Replace the convention by a new special feature flag "unstable". It > > > will be recognized by the QAPI generator, like the existing feature > > > flag "deprecated", and unlike regular feature flags. > > > > > > This commit updates documentation and prepares tests. The next commit > > > updates the QAPI schema. The remaining patches update the QAPI > > > generator and wire up -compat policy checking. > > > > > > Signed-off-by: Markus Armbruster <armbru at redhat.com> > > > > Obviously, replacing the old convention gets rid of the old drawbacks, > > but adds a new one: While using x- makes it very obvious for a human > > user that this is an unstable feature, a feature flag in the schema will > > almost certainly go unnoticed in manual use. > > Agreed, I'd keep the x- as well. > > Having said that, the x- represents a few different things (that we > don't currently distinguish): > - experimental > - for internal use > - for debugging/human useAll of those usage scenarios have the same implication though: Command/data format is liable to change in incompatible ways, or be deleted, with no prior warning. I don't think we need to distinguish the use cases - some commands may belong to two or three of those use cases. All that matters is that they're considered "unstable" from an API compat POV. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Markus Armbruster
2021-Oct-26 09:37 UTC
[Libguestfs] [PATCH 1/9] qapi: New special feature flag "unstable"
Kevin Wolf <kwolf at redhat.com> writes:> Am 25.10.2021 um 07:25 hat Markus Armbruster geschrieben: >> By convention, names starting with "x-" are experimental. The parts >> of external interfaces so named may be withdrawn or changed >> incompatibly in future releases. >> >> Drawback: promoting something from experimental to stable involves a >> name change. Client code needs to be updated. >> >> Moreover, the convention is not universally observed: >> >> * QOM type "input-barrier" has properties "x-origin", "y-origin". >> Looks accidental, but it's ABI since 4.2. >> >> * QOM types "memory-backend-file", "memory-backend-memfd", >> "memory-backend-ram", and "memory-backend-epc" have a property >> "x-use-canonical-path-for-ramblock-id" that is documented to be >> stable despite its name. >> >> We could document these exceptions, but documentation helps only >> humans. We want to recognize "unstable" in code, like "deprecated". >> >> Replace the convention by a new special feature flag "unstable". It >> will be recognized by the QAPI generator, like the existing feature >> flag "deprecated", and unlike regular feature flags. >> >> This commit updates documentation and prepares tests. The next commit >> updates the QAPI schema. The remaining patches update the QAPI >> generator and wire up -compat policy checking. >> >> Signed-off-by: Markus Armbruster <armbru at redhat.com> > > Obviously, replacing the old convention gets rid of the old drawbacks, > but adds a new one: While using x- makes it very obvious for a human > user that this is an unstable feature, a feature flag in the schema will > almost certainly go unnoticed in manual use.I thought about this, but neglected to put it in writing. My bad. Manual use of unstable interfaces is mostly fine. Human users can adapt to changing interfaces. HMP works that way. Management applications are better off with a feature flag than with a naming convention we sometimes ignore. The most potential for trouble is in between: programs that aren't full-fledged management applications. If we want to keep "unstable" obvious to the humans who write such programs, we can continue to require "x-", in addition to the feature flag. We pay for it with renames, and the risk of forgetting to rename in time (which is what got us the awkward stable "x-use-canonical-path-for-ramblock-id"). Tradeoff. I chose not to, but if y'all think we should... What we can't do, at least not easily, is to use *only* the "x-" convention: it is not reliable. We'd have to add a way to say 'this is stable even though the name starts with "x-"'.