qom: Few trivial patches
v2 cover qom: Few trivial patches
Some QOM patches worth salvaging while doing housekeeping.
Since v1:
- Fixed test build failure (patchew)
Philippe Mathieu-Daudé (3):
qom/object: Move Object typedef to 'qemu/typedefs.h' io/task: Move 'qom/object.h' header to source qom/object: Make reparenting error more verbose
include/io/task.h | 2 -- include/qemu/typedefs.h | 1 + include/qom/object.h | 2 -- include/qom/qom-qobject.h | 2 -- include/sysemu/sysemu.h | 1 - io/task.c | 1 + qom/object.c | 7 ++++++- tests/test-io-task.c | 1 + 8 files changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.21.3
PATCH v2 1/3 qom/object: Move Object typedef to 'qemu/typedefs.h'
We use the Object type all over the place.
Forward declare it in "qemu/typedefs.h".
--- include/qemu/typedefs.h | 1 + include/qom/object.h | 2 -- include/qom/qom-qobject.h | 2 -- include/sysemu/sysemu.h | 1 - 4 files changed, 1 insertion(+), 5 deletions(-)
include/qemu/typedefs.h +1 -0
@@ -75,6 +75,7 @@ typedef struct NetFilterState NetFilterState;typedef struct NICInfo NICInfo ;typedef struct NodeInfo NodeInfo ;typedef struct NumaNodeMem NumaNodeMem ; +typedef struct Object Object ;typedef struct ObjectClass ObjectClass ;typedef struct PCIBridge PCIBridge ;typedef struct PCIBus PCIBus ;
include/qom/object.h +0 -2
@@ -20,8 +20,6 @@struct TypeImpl ;typedef struct TypeImpl *Type ; -typedef struct Object Object ; -typedef struct TypeInfo TypeInfo ;typedef struct InterfaceClass InterfaceClass ;
include/qom/qom-qobject.h +0 -2
@@ -13,8 +13,6 @@#ifndef QEMU_QOM_QOBJECT_H #define QEMU_QOM_QOBJECT_H -#include "qom/object.h" -/* * object_property_get_qobject: * @obj: the object
include/sysemu/sysemu.h +0 -1
@@ -5,7 +5,6 @@#include "qemu/timer.h" #include "qemu/notify.h" #include "qemu/uuid.h" -#include "qom/object.h" /* vl.c */
Signature · 1 line
2.21.3
Re: [PATCH v2 1/3] qom/object: Move Object typedef to 'qemu/typedefs.h'
Quoted 54 lines · Philippe Mathieu-Daudé
We use the Object type all over the place.
Forward declare it in "qemu/typedefs.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/qemu/typedefs.h | 1 + include/qom/object.h | 2 -- include/qom/qom-qobject.h | 2 -- include/sysemu/sysemu.h | 1 - 4 files changed, 1 insertion(+), 5 deletions(-)include/qemu/typedefs.h +1
-0@@ -75,6 +75,7 @@ typedef struct NetFilterState NetFilterState;typedef struct NICInfo NICInfo ;typedef struct NodeInfo NodeInfo ;typedef struct NumaNodeMem NumaNodeMem ; +typedef struct Object Object ;typedef struct ObjectClass ObjectClass ;typedef struct PCIBridge PCIBridge ;typedef struct PCIBus PCIBus ;include/qom/object.h +0
-2@@ -20,8 +20,6 @@struct TypeImpl ;typedef struct TypeImpl *Type ; -typedef struct Object Object ; -typedef struct TypeInfo TypeInfo ;typedef struct InterfaceClass InterfaceClass ;include/qom/qom-qobject.h +0
-2@@ -13,8 +13,6 @@#ifndef QEMU_QOM_QOBJECT_H #define QEMU_QOM_QOBJECT_H -#include "qom/object.h" -/* * object_property_get_qobject: * @obj: the object include/sysemu/sysemu.h +0
-0
include/sysemu/sysemu.h line 9
Quoted 6 lines
include/sysemu/sysemu.h +0
-1@@ -5,7 +5,6 @@#include "qemu/timer.h" #include "qemu/notify.h" #include "qemu/uuid.h" -#include "qom/object.h" /* vl.c */
How did you identify the inclusions to drop?
Re: [PATCH v2 1/3] qom/object: Move Object typedef to 'qemu/typedefs.h'
Quoted 62 lines · Markus Armbruster
Quoted 59 lines · Philippe Mathieu-Daudé
We use the Object type all over the place.
Forward declare it in "qemu/typedefs.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/qemu/typedefs.h | 1 + include/qom/object.h | 2 -- include/qom/qom-qobject.h | 2 -- include/sysemu/sysemu.h | 1 - 4 files changed, 1 insertion(+), 5 deletions(-)include/qemu/typedefs.h +1
-0@@ -75,6 +75,7 @@ typedef struct NetFilterState NetFilterState;typedef struct NICInfo NICInfo ;typedef struct NodeInfo NodeInfo ;typedef struct NumaNodeMem NumaNodeMem ; +typedef struct Object Object ;typedef struct ObjectClass ObjectClass ;typedef struct PCIBridge PCIBridge ;typedef struct PCIBus PCIBus ;include/qom/object.h +0
-2@@ -20,8 +20,6 @@struct TypeImpl ;typedef struct TypeImpl *Type ; -typedef struct Object Object ; -typedef struct TypeInfo TypeInfo ;typedef struct InterfaceClass InterfaceClass ;include/qom/qom-qobject.h +0
-2@@ -13,8 +13,6 @@#ifndef QEMU_QOM_QOBJECT_H #define QEMU_QOM_QOBJECT_H -#include "qom/object.h" -/* * object_property_get_qobject: * @obj: the object include/sysemu/sysemu.h +0
-1@@ -5,7 +5,6 @@#include "qemu/timer.h" #include "qemu/notify.h" #include "qemu/uuid.h" -#include "qom/object.h"
Quoted 3 lines
include/sysemu/sysemu.h line 9
Quoted 1 line
include/sysemu/sysemu.h +0
-0/* vl.c */ How did you identify the inclusions to drop?
Nothing very strict I'm afraid. I suppose I had the files opened in my editor.
The output of
$ git grep -L -E '(OBJECT_|INTERFACE_)' $(git grep -l qom/object include) suggests I missed those:
-- >8 --
include/hw/display/edid.h +0 -2
@@ -1,8 +1,6 @@ #ifndef EDID_H #define EDID_H -#include "qom/object.h" - typedef struct qemu_edid_info { const char *vendor; /* http://www.uefi.org/pnp_id_list */ const char *name;
include/io/task.h +0 -2
@@ -21,8 +21,6 @@#ifndef QIO_TASK_H #define QIO_TASK_H -#include "qom/object.h" -typedef struct QIOTask QIOTask ; typedef void (*QIOTaskFunc)(QIOTask *task,
---
Re: [PATCH v2 1/3] qom/object: Move Object typedef to 'qemu/typedefs.h'
Quoted 63 lines · Philippe Mathieu-Daudé
Quoted 62 lines · Markus Armbruster
Quoted 59 lines · Philippe Mathieu-Daudé
We use the Object type all over the place.
Forward declare it in "qemu/typedefs.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/qemu/typedefs.h | 1 + include/qom/object.h | 2 -- include/qom/qom-qobject.h | 2 -- include/sysemu/sysemu.h | 1 - 4 files changed, 1 insertion(+), 5 deletions(-)include/qemu/typedefs.h +1
-0@@ -75,6 +75,7 @@ typedef struct NetFilterState NetFilterState;typedef struct NICInfo NICInfo ;typedef struct NodeInfo NodeInfo ;typedef struct NumaNodeMem NumaNodeMem ; +typedef struct Object Object ;typedef struct ObjectClass ObjectClass ;typedef struct PCIBridge PCIBridge ;typedef struct PCIBus PCIBus ;include/qom/object.h +0
-2@@ -20,8 +20,6 @@struct TypeImpl ;typedef struct TypeImpl *Type ; -typedef struct Object Object ; -typedef struct TypeInfo TypeInfo ;typedef struct InterfaceClass InterfaceClass ;include/qom/qom-qobject.h +0
-2@@ -13,8 +13,6 @@#ifndef QEMU_QOM_QOBJECT_H #define QEMU_QOM_QOBJECT_H -#include "qom/object.h" -/* * object_property_get_qobject: * @obj: the object include/sysemu/sysemu.h +0
-1@@ -5,7 +5,6 @@#include "qemu/timer.h" #include "qemu/notify.h" #include "qemu/uuid.h" -#include "qom/object.h"
Quoted 8 lines
Quoted 3 lines
include/sysemu/sysemu.h line 9
Quoted 1 line
include/sysemu/sysemu.h +0
-0/* vl.c */ How did you identify the inclusions to drop?
Nothing very strict I'm afraid. I suppose I had the files opened in my editor.
The output of
$ git grep -L -E '(OBJECT_|INTERFACE_)' $(git grep -l qom/object include)
Why limit to include, and not check '*.h', or even '*.[ch]'?
Quoted 30 lines
suggests I missed those:
-- >8 --
include/hw/display/edid.h +0
-2@@ -1,8 +1,6 @@ #ifndef EDID_H #define EDID_H -#include "qom/object.h" - typedef struct qemu_edid_info { const char *vendor; /* http://www.uefi.org/pnp_id_list */ const char *name;include/io/task.h +0
-3@@ -21,8 +21,6 @@#ifndef QIO_TASK_H #define QIO_TASK_H -#include "qom/object.h" -typedef struct QIOTask QIOTask ; typedef void (*QIOTaskFunc)(QIOTask *task, ---
Re: [PATCH v2 1/3] qom/object: Move Object typedef to 'qemu/typedefs.h'
In reply to Philippe Mathieu-DaudéQuoted 63 lines · Philippe Mathieu-Daudé
Quoted 62 lines · Markus Armbruster
Quoted 59 lines · Philippe Mathieu-Daudé
We use the Object type all over the place.
Forward declare it in "qemu/typedefs.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/qemu/typedefs.h | 1 + include/qom/object.h | 2 -- include/qom/qom-qobject.h | 2 -- include/sysemu/sysemu.h | 1 - 4 files changed, 1 insertion(+), 5 deletions(-)include/qemu/typedefs.h +1
-0@@ -75,6 +75,7 @@ typedef struct NetFilterState NetFilterState;typedef struct NICInfo NICInfo ;typedef struct NodeInfo NodeInfo ;typedef struct NumaNodeMem NumaNodeMem ; +typedef struct Object Object ;typedef struct ObjectClass ObjectClass ;typedef struct PCIBridge PCIBridge ;typedef struct PCIBus PCIBus ;include/qom/object.h +0
-2@@ -20,8 +20,6 @@struct TypeImpl ;typedef struct TypeImpl *Type ; -typedef struct Object Object ; -typedef struct TypeInfo TypeInfo ;typedef struct InterfaceClass InterfaceClass ;include/qom/qom-qobject.h +0
-2@@ -13,8 +13,6 @@#ifndef QEMU_QOM_QOBJECT_H #define QEMU_QOM_QOBJECT_H -#include "qom/object.h" -/* * object_property_get_qobject: * @obj: the object include/sysemu/sysemu.h +0
-1@@ -5,7 +5,6 @@#include "qemu/timer.h" #include "qemu/notify.h" #include "qemu/uuid.h" -#include "qom/object.h"
Quoted 5 lines
Quoted 3 lines
include/sysemu/sysemu.h line 9
Quoted 1 line
include/sysemu/sysemu.h +0
-0/* vl.c */ How did you identify the inclusions to drop?
Nothing very strict I'm afraid. I suppose I had the files opened in my editor.
Looks like all of these are affected:
accel/accel.c | 1 - block/throttle-groups.c | 1 - hw/audio/soundhw.c | 1 - hw/block/vhost-user-blk.c | 1 - hw/pci-host/pam.c | 1 - hw/ppc/spapr_drc.c | 1 - hw/scsi/vhost-user-scsi.c | 1 - include/hw/display/edid.h | 1 - include/hw/misc/pvpanic.h | 1 - include/hw/timer/hpet.h | 1 - io/task.c | 1 - memory.c | 1 - stubs/qmp_memory_device.c | 1 - target/arm/kvm.c | 1 - tests/test-io-task.c | 1 -
Patch 3 doesn't apply anymore, I queued the first two.
Paolo
PATCH v2 2/3 io/task: Move 'qom/object.h' header to source
In reply to Philippe Mathieu-DaudéWe need "qom/object.h" to call object_ref()/object_unref(), and to test the TYPE_DUMMY.
---
v2: Add missing header in tests/test-io-task.c (patchew)
--- include/io/task.h | 2 -- io/task.c | 1 + tests/test-io-task.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)
include/io/task.h +0 -2
@@ -21,8 +21,6 @@#ifndef QIO_TASK_H #define QIO_TASK_H -#include "qom/object.h" -typedef struct QIOTask QIOTask ; typedef void (*QIOTaskFunc)(QIOTask *task,
io/task.c +1 -0
@@ -22,6 +22,7 @@#include "io/task.h" #include "qapi/error.h" #include "qemu/thread.h" +#include "qom/object.h" #include "trace.h" struct QIOTaskThreadData {
tests/test-io-task.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" +#include "qom/object.h" #include "io/task.h" #include "qapi/error.h" #include "qemu/module.h"
Signature · 1 line
2.21.3
PATCH v2 3/3 qom/object: Make reparenting error more verbose
In reply to Philippe Mathieu-DaudéDisplay child and parent names when reparenting occurs.
--- qom/object.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
qom/object.c +6 -1
@@ -1683,7 +1683,12 @@ void object_property_add_child(Object *obj, const char *name,ObjectProperty *op;if (child->parent !=NULL ) { -error_setg (errp,"child object is already parented" ); +error_setg (errp,"child object '%s' is already parented (parent: '%s') " +"can not be children '%s' of '%s'" , +object_get_typename (child), +object_get_typename (child->parent), + name, +object_get_typename (obj));return ; }
Signature · 1 line
2.21.3
ping?
Quoted 20 lines · Philippe Mathieu-Daudé
Some QOM patches worth salvaging while doing housekeeping.
Since v1:
- Fixed test build failure (patchew)Philippe Mathieu-Daudé (3):
qom/object: Move Object typedef to 'qemu/typedefs.h' io/task: Move 'qom/object.h' header to source qom/object: Make reparenting error more verboseinclude/io/task.h | 2 -- include/qemu/typedefs.h | 1 + include/qom/object.h | 2 -- include/qom/qom-qobject.h | 2 -- include/sysemu/sysemu.h | 1 - io/task.c | 1 + qom/object.c | 7 ++++++- tests/test-io-task.c | 1 + 8 files changed, 9 insertions(+), 8 deletions(-)