[PATCH] docs/devel/qom.rst: Correct code style

Philippe Mathieu-Daudé posted 1 patch 2 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230622101717.70468-1-philmd@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>
docs/devel/qom.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] docs/devel/qom.rst: Correct code style
Posted by Philippe Mathieu-Daudé 2 years, 6 months ago
Per commit 067109a11c ("docs/devel: mention the spacing requirement
for QOM"):

  For a storage structure the first declaration should always be
  called “parent_obj” and for a class structure the first member
  should always be called “parent_class”

Adapt the QOM rST document accordingly.

Reported-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 docs/devel/qom.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
index c9237950d0..2828843058 100644
--- a/docs/devel/qom.rst
+++ b/docs/devel/qom.rst
@@ -26,7 +26,7 @@ features:
    typedef DeviceClass MyDeviceClass;
    typedef struct MyDevice
    {
-       DeviceState parent;
+       DeviceState parent_obj;
 
        int reg0, reg1, reg2;
    } MyDevice;
@@ -147,7 +147,7 @@ will also have a wrapper function to call it easily:
 
    typedef struct MyDeviceClass
    {
-       DeviceClass parent;
+       DeviceClass parent_class;
 
        void (*frobnicate) (MyDevice *obj);
    } MyDeviceClass;
-- 
2.38.1


Re: [PATCH] docs/devel/qom.rst: Correct code style
Posted by Alex Bennée 2 years, 5 months ago
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> Per commit 067109a11c ("docs/devel: mention the spacing requirement
> for QOM"):
>
>   For a storage structure the first declaration should always be
>   called “parent_obj” and for a class structure the first member
>   should always be called “parent_class”
>
> Adapt the QOM rST document accordingly.
>
> Reported-by: BALATON Zoltan <balaton@eik.bme.hu>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Queued to docs/more-qom-docs, thanks.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro