qdev: Introduce DEFINE_PROP_LINK
cover qdev: Introduce DEFINE_PROP_LINK
Link properties of devices created with object_property_add_link() are not reflected in HMP "info qtree". For example, whether a virtio-blk device has an iothread (i.e. has enabled data plane) can not be introspected easily.
Introduce a new type of qdev property to fix that.
Because QOM is not my most familiar area, only virtio devices are converted in this version. If the new API is okay, other devices can be worked on either in v2 or in a follow up series.
Fam Zheng (7):
qom: Make link property API public
qom: Handle property lookup failure in object_resolve_link
qom: Save type name in LinkProperty
qdev: Introduce DEFINE_PROP_LINK
virtio-blk: Use DEFINE_PROP_LINK
virtio-scsi: Use DEFINE_PROP_LINK
virtio-rng: Use DEFINE_PROP_LINK
hw/block/dataplane/virtio-blk.c | 2 +- hw/block/virtio-blk.c | 7 ++-- hw/core/qdev-properties.c | 81 +++++++++++++++++++++++++++++++++++++++++ hw/scsi/virtio-scsi-dataplane.c | 2 +- hw/scsi/virtio-scsi.c | 15 ++------ hw/virtio/virtio-pci.c | 6 --- hw/virtio/virtio-rng.c | 16 ++------ include/hw/qdev-core.h | 3 ++ include/hw/qdev-properties.h | 11 ++++++ include/hw/virtio/virtio-blk.h | 2 +- include/hw/virtio/virtio-rng.h | 2 +- include/hw/virtio/virtio-scsi.h | 2 +- include/qom/object.h | 14 +++++++ qom/object.c | 24 ++++++------ 14 files changed, 136 insertions(+), 51 deletions(-)
Signature · 1 line
2.9.4
PATCH 1/7 qom: Make link property API public
The get/set pair and the struct will be reused by qdev link prop, make them public.
--- include/qom/object.h | 13 +++++++++++++ qom/object.c | 18 ++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-)
include/qom/object.h +13 -0
@@ -1613,4 +1613,17 @@ Object *container_get(Object *root, const char *path);* Returns the instance_size of the given @typename. */ size_t object_type_get_instance_size (const char *typename); + +typedef struct { +Object **child; +void (*check)(Object *,const char *,Object *,Error **); +ObjectPropertyLinkFlags flags; +}LinkProperty ; + +void object_get_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp); +void object_set_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp);#endif
qom/object.c +6 -12
@@ -1434,15 +1434,9 @@ void object_property_allow_set_link(Object *obj, const char *name,/* Allow the link to be set, always */ } -typedef struct { -Object **child; -void (*check)(Object *,const char *,Object *,Error **); -ObjectPropertyLinkFlags flags; -}LinkProperty ; - -static void object_get_link_property (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +void object_get_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp) {LinkProperty *lprop = opaque;Object **child = lprop->child;
@@ -1498,9 +1492,9 @@ static Object *object_resolve_link(Object *obj, const char *name,return target; } -static void object_set_link_property (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +void object_set_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp) {Error *local_err =NULL ;LinkProperty *prop = opaque;
Signature · 1 line
2.9.4
Re: [Qemu-devel] [PATCH 1/7] qom: Make link property API public
Quoted 4 lines · Fam Zheng
The get/set pair and the struct will be reused by qdev link prop, make them public.
Signed-off-by Fam Zheng <[email protected]>
Maybe it's better to make it a separate header file. No other objections.
Paolo
Quoted 64 lines
--- include/qom/object.h | 13 +++++++++++++ qom/object.c | 18 ++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-)include/qom/object.h +13
-0@@ -1613,4 +1613,17 @@ Object *container_get(Object *root, const char *path);* Returns the instance_size of the given @typename. */ size_t object_type_get_instance_size (const char *typename); + +typedef struct { +Object **child; +void (*check)(Object *,const char *,Object *,Error **); +ObjectPropertyLinkFlags flags; +}LinkProperty ; + +void object_get_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp); +void object_set_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp);#endif qom/object.c +6
-12@@ -1434,15 +1434,9 @@ void object_property_allow_set_link(Object *obj, const char *name,/* Allow the link to be set, always */ } -typedef struct { -Object **child; -void (*check)(Object *,const char *,Object *,Error **); -ObjectPropertyLinkFlags flags; -}LinkProperty ; - -static void object_get_link_property (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +void object_get_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp) {LinkProperty *lprop = opaque;Object **child = lprop->child;@@ -1498,9 +1492,9 @@ static Object *object_resolve_link(Object *obj, const char *name,return target; } -static void object_set_link_property (Object *obj,Visitor *v, -const char *name,void *opaque, -Error **errp) +void object_set_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp) {Error *local_err =NULL ;LinkProperty *prop = opaque;
Re: [Qemu-devel] [PATCH 1/7] qom: Make link property API public
Am 28.06.2017 um 15:32 schrieb Paolo Bonzini:
Quoted 7 lines · Fam Zheng
Quoted 4 lines
The get/set pair and the struct will be reused by qdev link prop, make them public.
Signed-off-by Fam Zheng <[email protected]>Maybe it's better to make it a separate header file. No other objections.
So you think it should be added?
The alternative would be moving info qom-tree forward and finally deprecating info qtree. There was a patch of mine to make it list properties with -v or so, but there were StringOutputVisitor dependencies where it got stuck in review.
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)
Re: [Qemu-devel] [PATCH 1/7] qom: Make link property API public
Quoted 4 lines · Andreas Färber
The alternative would be moving info qom-tree forward and finally deprecating info qtree. There was a patch of mine to make it list properties with -v or so, but there were StringOutputVisitor dependencies where it got stuck in review.
No objection to enhancing info qom-tree, but also no idea how to help. :)
BTW, will it print much more information than "info qtree"? If so deprecating it sounds like a bad idea for me. "info qtree" output is already lengthy. As HMP is for human, it would be nice if the output is easy to extract interesting information with eyeball, rather than dumping everything.
Fam
PATCH 2/7 qom: Handle property lookup failure in object_resolve_link
In reply to Fam ZhengSince we have made object_set_link_property a public function, it is possible that it will be called with a nonexistent property name. Let's survive this error case and report error to avoid segfault in the future.
--- qom/object.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
qom/object.c +4 -1
@@ -1470,7 +1470,10 @@ static Object *object_resolve_link(Object *obj, const char *name,Object *target;/* Go from link<FOO> to FOO. */ - type =object_property_get_type (obj, name,NULL ); + type =object_property_get_type (obj, name, errp); +if (!type) { +return NULL ; + } target_type =g_strndup (&type[5 ],strlen (type) -6 ); target =object_resolve_path_type (path, target_type, &ambiguous);
Signature · 1 line
2.9.4
PATCH 3/7 qom: Save type name in LinkProperty
In reply to Fam Zheng--- include/qom/object.h | 1 + qom/object.c | 1 + 2 files changed, 2 insertions(+)
include/qom/object.h +1 -0
@@ -1618,6 +1618,7 @@ typedef struct {Object **child;void (*check)(Object *,const char *,Object *,Error **);ObjectPropertyLinkFlags flags; +const char *type; } LinkProperty; void object_get_link_property(Object *obj, Visitor *v,
qom/object.c +1 -0
@@ -1562,6 +1562,7 @@ void object_property_add_link(Object *obj, const char *name, prop->child = child; prop->check = check; prop->flags = flags; + prop->type = type; full_type =g_strdup_printf ("link<%s>" , type);
Signature · 1 line
2.9.4
PATCH 4/7 qdev: Introduce DEFINE_PROP_LINK
In reply to Fam ZhengThis property can be used to replace the object_property_add_link in device code, to add a link to other objects.
It's implemented by creating a wrapper property that basically forwards operations to a QOM "link-FOO" property, which handles the check callback and flags. The feature that is missing from QOM is the dynamic child pointer which is done in the added code with the usual "offset" approach.
--- hw/core/qdev-properties.c | 81 ++++++++++++++++++++++++++++++++++++++++++++ include/hw/qdev-core.h | 3 ++ include/hw/qdev-properties.h | 11 ++++++ 3 files changed, 95 insertions(+)
hw/core/qdev-properties.c +81 -0
@@ -1192,3 +1192,84 @@ PropertyInfo qdev_prop_size = { .set = set_size, .set_default_value = set_default_value_uint, }; + +/* --- object link property --- */ + +static ObjectProperty *link_property_get_or_create (Object *obj,Property *prop, +Error **errp) +{ +Error *local_err =NULL ; +Object **child =qdev_get_prop_ptr (DEVICE (obj), prop); +char *link_prop_name =g_strdup_printf ("link-%s" , prop->name); +ObjectProperty *op =object_property_find (obj, link_prop_name,NULL ); + +if (op) { + goto out; + } +object_property_add_link (obj, link_prop_name, prop->link.type, + child, prop->link.check, + prop->link.flags, &local_err); + +if (local_err) { +error_propagate (errp, local_err); + goto out; + } + op =object_property_find (obj, link_prop_name, errp); +out: +g_free (link_prop_name); +return op; +} + +static void get_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp) +{ +Property *prop = opaque; +ObjectProperty *op =link_property_get_or_create (obj, prop,NULL ); +char *link_prop_name; + +if (!op) { +return ; + } + link_prop_name =g_strdup_printf ("link-%s" , name); +object_get_link_property (obj, v, link_prop_name, op->opaque, errp); +g_free (link_prop_name); +} + +static void set_link_property (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp) +{ +Object *target; +Property *prop = opaque; +Object **link_ptr =qdev_get_prop_ptr (DEVICE (obj), prop); +ObjectProperty *op =link_property_get_or_create (obj, prop, errp); +char *link_prop_name; +Error *local_err =NULL ; + +if (!op) { +return ; + } + + link_prop_name =g_strdup_printf ("link-%s" , name); +object_set_link_property (obj, v, link_prop_name, op->opaque, &local_err); +if (local_err) { +error_propagate (errp, local_err); + goto out; + } + target =object_property_get_link (obj, link_prop_name, &local_err); +if (local_err) { +error_propagate (errp, local_err); + goto out; + } + *link_ptr = target; + +out: +g_free (link_prop_name); +} + +PropertyInfo qdev_prop_link = { + .name ="link" , + .get = get_link_property, + .set = set_link_property, +};
include/hw/qdev-core.h +3 -0
@@ -233,6 +233,9 @@ struct Property {int arrayoffset;PropertyInfo *arrayinfo;int arrayfieldsize; +/* Only @check and @flags are used; @child is unuseful because we need a +* dynamic pointer in @obj as derived from @offset. */ +LinkProperty link; };struct PropertyInfo {
include/hw/qdev-properties.h +11 -0
@@ -30,6 +30,7 @@ extern PropertyInfo qdev_prop_pci_devfn;extern PropertyInfo qdev_prop_blocksize;extern PropertyInfo qdev_prop_pci_host_devaddr;extern PropertyInfo qdev_prop_arraylen; +extern PropertyInfo qdev_prop_link;#define DEFINE_PROP (_name, _state, _field, _prop, _type) { \ .name = (_name), \
@@ -117,6 +118,16 @@ extern PropertyInfo qdev_prop_arraylen; .arrayoffset = offsetof(_state, _arrayfield), \ } +#define DEFINE_PROP_LINK (_name, _state, _field, _type, _check, _flags) {\ + .name = (_name), \ + .info = &(qdev_prop_link), \ + .offset = offsetof(_state, _field) \ + + type_check(Object *, typeof_field(_state, _field)), \ + .link.check = _check, \ + .link.flags = _flags, \ + .link.type = _type, \ + } +#define DEFINE_PROP_UINT8 (_n, _s, _f, _d) \ DEFINE_PROP_UNSIGNED(_n, _s, _f, _d, qdev_prop_uint8, uint8_t)#define DEFINE_PROP_UINT16 (_n, _s, _f, _d) \
Signature · 1 line
2.9.4
Quoted 6 lines · Fam Zheng
It's implemented by creating a wrapper property that basically forwards operations to a QOM "link-FOO" property, which handles the check callback and flags. The feature that is missing from QOM is the dynamic child pointer which is done in the added code with the usual "offset" approach.
Would it be possible to add a ".create" field to PropertyInfo? Then there's no need to introduce the wrapper.
Also, I think _check and _flags can be always qdev_prop_allow_set_link_before_realize and OBJ_PROP_LINK_UNREF_ON_RELEASE for DEFINE_PROP_LINK.
Paolo
Quoted 4 lines · Paolo Bonzini
Quoted 1 line · Fam Zheng
Quoted 8 lines
Quoted 5 lines
It's implemented by creating a wrapper property that basically forwards operations to a QOM "link-FOO" property, which handles the check callback and flags. The feature that is missing from QOM is the dynamic child pointer which is done in the added code with the usual "offset" approach.
Would it be possible to add a ".create" field to PropertyInfo? Then there's no need to introduce the wrapper.
QOM setter/getter want a LinkProperty opaque pointer, but qdev uses a Property pointer. I don't see a way to adapt that with .create(). Can you elaborate?
Quoted 4 lines
Also, I think
_checkand_flagscan be alwaysqdev_prop_allow_set_link_before_realizeandOBJ_PROP_LINK_UNREF_ON_RELEASEforDEFINE_PROP_LINK.
A quick grep gave me some object_property_add_link() callers using different parameters, but I don't know if they should use DEFINE_PROP_LINK.
Fam
Quoted 9 lines · Fam Zheng
Quoted 7 lines
Quoted 5 lines
It's implemented by creating a wrapper property that basically forwards operations to a QOM "link-FOO" property, which handles the check callback and flags. The feature that is missing from QOM is the dynamic child pointer which is done in the added code with the usual "offset" approach.
Would it be possible to add a ".create" field to PropertyInfo? Then there's no need to introduce the wrapper.
QOM setter/getter want a LinkProperty opaque pointer, but qdev uses a Property pointer. I don't see a way to adapt that with .create(). Can you elaborate?
The .create() callback would call object_property_add_link directly. There would be no change in the properties at the QOM level, but the PropertyInfo lets "info qtree" show the property.
Paolo
Quoted 8 lines · Paolo Bonzini
Quoted 5 lines · Fam Zheng
Quoted 5 lines
Quoted 5 lines
It's implemented by creating a wrapper property that basically forwards operations to a QOM "link-FOO" property, which handles the check callback and flags. The feature that is missing from QOM is the dynamic child pointer which is done in the added code with the usual "offset" approach.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Would it be possible to add a ".create" field to PropertyInfo? Then there's no need to introduce the wrapper.
QOM setter/getter want a LinkProperty opaque pointer, but qdev uses a Property pointer. I don't see a way to adapt that with .create(). Can you elaborate?
The .create() callback would call
object_property_add_linkdirectly. There would be no change in the properties at the QOM level, but the PropertyInfo lets "info qtree" show the property.
Thanks, I see, I'll try it in v2 if Andreas agrees on the general idea.
Fam
PATCH 5/7 virtio-blk: Use DEFINE_PROP_LINK
In reply to Fam Zheng--- hw/block/dataplane/virtio-blk.c | 2 +- hw/block/virtio-blk.c | 7 +++---- hw/virtio/virtio-pci.c | 2 -- include/hw/virtio/virtio-blk.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-)
hw/block/dataplane/virtio-blk.c +1 -1
@@ -116,7 +116,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, s->conf = conf;if (conf->iothread) { - s->iothread = conf->iothread; + s->iothread =IOTHREAD (conf->iothread);object_ref (OBJECT (s->iothread)); s->ctx =iothread_get_aio_context (s->iothread); }else {
hw/block/virtio-blk.c +3 -4
@@ -981,10 +981,6 @@ static void virtio_blk_instance_init(Object *obj) {VirtIOBlock *s =VIRTIO_BLK (obj); -object_property_add_link (obj,"iothread" ,TYPE_IOTHREAD , - (Object **)&s->conf.iothread, - qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_UNREF_ON_RELEASE ,NULL );device_add_bootindex_property (obj, &s->conf.conf.bootindex,"bootindex" ,"/disk@0,0" ,DEVICE (obj),NULL );
@@ -1012,6 +1008,9 @@ static Property virtio_blk_properties[] = {DEFINE_PROP_BIT ("request-merging" , VirtIOBlock, conf.request_merging,0 , true),DEFINE_PROP_UINT16 ("num-queues" , VirtIOBlock, conf.num_queues,1 ), +DEFINE_PROP_LINK ("iothread" , VirtIOBlock, conf.iothread,TYPE_IOTHREAD , + qdev_prop_allow_set_link_before_realize, +OBJ_PROP_LINK_UNREF_ON_RELEASE ), DEFINE_PROP_END_OF_LIST(), };
hw/virtio/virtio-pci.c +0 -2
@@ -1996,8 +1996,6 @@ static void virtio_blk_pci_instance_init(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VIRTIO_BLK ); -object_property_add_alias (obj,"iothread" ,OBJECT (&dev->vdev),"iothread" , - &error_abort);object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev),"bootindex" , &error_abort); }
include/hw/virtio/virtio-blk.h +1 -1
@@ -33,7 +33,7 @@ struct virtio_blk_inhdrstruct VirtIOBlkConf {BlockConf conf; -IOThread *iothread; +Object *iothread;char *serial;uint32_t scsi;uint32_t config_wce;
Signature · 1 line
2.9.4
PATCH 6/7 virtio-scsi: Use DEFINE_PROP_LINK
In reply to Fam Zheng--- hw/scsi/virtio-scsi-dataplane.c | 2 +- hw/scsi/virtio-scsi.c | 15 ++++----------- hw/virtio/virtio-pci.c | 2 -- include/hw/virtio/virtio-scsi.h | 2 +- 4 files changed, 6 insertions(+), 15 deletions(-)
hw/scsi/virtio-scsi-dataplane.c +1 -1
@@ -40,7 +40,7 @@ void virtio_scsi_dataplane_setup(VirtIOSCSI *s, Error **errp)error_setg (errp,"ioeventfd is required for iothread" );return ; } - s->ctx =iothread_get_aio_context (vs->conf.iothread); + s->ctx =iothread_get_aio_context (IOTHREAD (vs->conf.iothread)); }else {if (!virtio_device_ioeventfd_enabled (vdev)) {return ;
hw/scsi/virtio-scsi.c +4 -11
@@ -897,16 +897,6 @@ static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)virtio_scsi_dataplane_setup (s, errp); } -static void virtio_scsi_instance_init (Object *obj) -{ -VirtIOSCSICommon *vs =VIRTIO_SCSI_COMMON (obj); - -object_property_add_link (obj,"iothread" ,TYPE_IOTHREAD , - (Object **)&vs->conf.iothread, - qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_UNREF_ON_RELEASE , &error_abort); -} -void virtio_scsi_common_unrealize (DeviceState *dev,Error **errp) {VirtIODevice *vdev =VIRTIO_DEVICE (dev);
@@ -934,6 +924,10 @@ static Property virtio_scsi_properties[] = { VIRTIO_SCSI_F_HOTPLUG, true),DEFINE_PROP_BIT ("param_change" , VirtIOSCSI, host_features,VIRTIO_SCSI_F_CHANGE , true), +DEFINE_PROP_LINK ("iothread" , VirtIOSCSI, parent_obj.conf.iothread, +TYPE_IOTHREAD , + qdev_prop_allow_set_link_before_realize, +OBJ_PROP_LINK_UNREF_ON_RELEASE ), DEFINE_PROP_END_OF_LIST(), };
@@ -988,7 +982,6 @@ static const TypeInfo virtio_scsi_info = { .name = TYPE_VIRTIO_SCSI, .parent = TYPE_VIRTIO_SCSI_COMMON, .instance_size = sizeof(VirtIOSCSI), - .instance_init = virtio_scsi_instance_init, .class_init = virtio_scsi_class_init, .interfaces = (InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER },
hw/virtio/virtio-pci.c +0 -2
@@ -2065,8 +2065,6 @@ static void virtio_scsi_pci_instance_init(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VIRTIO_SCSI ); -object_property_add_alias (obj,"iothread" ,OBJECT (&dev->vdev),"iothread" , - &error_abort); }static const TypeInfo virtio_scsi_pci_info = {
include/hw/virtio/virtio-scsi.h +1 -1
@@ -56,7 +56,7 @@ struct VirtIOSCSIConf {#endif CharBackend chardev;uint32_t boot_tpgt; -IOThread *iothread; +Object *iothread; };struct VirtIOSCSI ;
Signature · 1 line
2.9.4
PATCH 7/7 virtio-rng: Use DEFINE_PROP_LINK
In reply to Fam Zheng--- hw/virtio/virtio-pci.c | 2 -- hw/virtio/virtio-rng.c | 16 ++++------------ include/hw/virtio/virtio-rng.h | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-)
hw/virtio/virtio-pci.c +0 -2
@@ -2459,8 +2459,6 @@ static void virtio_rng_initfn(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VIRTIO_RNG ); -object_property_add_alias (obj,"rng" ,OBJECT (&dev->vdev),"rng" , - &error_abort); }static const TypeInfo virtio_rng_pci_info = {
hw/virtio/virtio-rng.c +4 -12
@@ -199,7 +199,7 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp) "rng", NULL); } - vrng->rng = vrng->conf.rng; + vrng->rng =RNG_BACKEND (vrng->conf.rng);if (vrng->rng ==NULL ) {error_setg (errp,"'rng' parameter expects a valid object" );return ;
@@ -246,6 +246,9 @@ static Property virtio_rng_properties[] = {*/ DEFINE_PROP_UINT64 ("max-bytes" , VirtIORNG, conf.max_bytes,INT64_MAX ),DEFINE_PROP_UINT32 ("period" , VirtIORNG, conf.period_ms,1 <<16 ), +DEFINE_PROP_LINK ("rng" , VirtIORNG, conf.rng,TYPE_RNG_BACKEND , + qdev_prop_allow_set_link_before_realize, +OBJ_PROP_LINK_UNREF_ON_RELEASE ), DEFINE_PROP_END_OF_LIST(), };
@@ -262,21 +265,10 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data) vdc->get_features = get_features; } -static void virtio_rng_initfn (Object *obj) -{ -VirtIORNG *vrng =VIRTIO_RNG (obj); - -object_property_add_link (obj,"rng" ,TYPE_RNG_BACKEND , - (Object **)&vrng->conf.rng, - qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_UNREF_ON_RELEASE ,NULL ); -} -static const TypeInfo virtio_rng_info = { .name =TYPE_VIRTIO_RNG , .parent =TYPE_VIRTIO_DEVICE , .instance_size =sizeof (VirtIORNG), - .instance_init = virtio_rng_initfn, .class_init = virtio_rng_class_init, };
include/hw/virtio/virtio-rng.h +1 -1
@@ -23,7 +23,7 @@ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_RNG)struct VirtIORNGConf { -RngBackend *rng; +Object *rng;uint64_t max_bytes;uint32_t period_ms;RngRandom *default_backend;
Signature · 1 line
2.9.4