Skip to contentSkip to conversation

docs/devel/qom.rst: Correct code style

PATCH Applied Philippe Mathieu-Daudé 2 participants 2 messages Jun 22, 2023 – Jun 23, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/devel/qom.rst: Correct code style

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.

---
 docs/devel/qom.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
docs/devel/qom.rst +2 -2
index c9237950d0..2828843058 100644
@@ -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;
Signature · 1 line
2.38.1
Applied
#1 lore raw
Quoted 11 lines · Philippe Mathieu-Daudé

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.

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

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro