mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
Generalize QOM publishing of date and time from mc146818rtc.c
The mc146818rtc driver exposes the current RTC date and time via the "date" property in QOM (which is also aliased to the machine's "rtc-time" property). Currently it uses a custom visitor function rtc_get_date to do this. This patch introduces new helpers to the QOM core to expose struct tm valued properties via a getter function, so that this functionality can be more easily duplicated in other RTC implementations. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
b194df478a
commit
8e099d14f5
3 changed files with 96 additions and 41 deletions
|
@ -1203,6 +1203,20 @@ void object_property_add_bool(Object *obj, const char *name,
|
|||
void (*set)(Object *, bool, Error **),
|
||||
Error **errp);
|
||||
|
||||
/**
|
||||
* object_property_add_tm:
|
||||
* @obj: the object to add a property to
|
||||
* @name: the name of the property
|
||||
* @get: the getter or NULL if the property is write-only.
|
||||
* @errp: if an error occurs, a pointer to an area to store the error
|
||||
*
|
||||
* Add a read-only struct tm valued property using a getter function.
|
||||
* This function will add a property of type 'struct tm'.
|
||||
*/
|
||||
void object_property_add_tm(Object *obj, const char *name,
|
||||
void (*get)(Object *, struct tm *, Error **),
|
||||
Error **errp);
|
||||
|
||||
/**
|
||||
* object_property_add_uint8_ptr:
|
||||
* @obj: the object to add a property to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue