Hi,
I am newbie to qemu. Recently, I am reading the code and found one question.
I can see some property function is added to the object. But I wonder
when these
property functions are called or triggered. When I try to trace them,
only the initialization
is found. I found some unclear lines in the doc, I can not figure out
the details.
*"Device properties in QOM are bound to devices and are implemented by
closures provided by the device.
***
*A Visitor is passed to the closure which effectively allows properties
to be set/get through native C types.***
*Mapping to any other type of representation (string or otherwise) is
done by a Visitor with no knowledge of the device or property.***
"
I also found this property function has something to do with the
*Visitor*, and I trace the function *x86_cpu_get_crash_info_qom* along with
Visitor. And I found that these crash information is finally read out to
log file along with this visitor. *But **still I have no idea when this **
**x86_cpu_get_crash_info_qom is triggered.
*
But as I found that the cpu class is initialized with an another
function *cc->get_crash_info = x86_cpu_get_crash_info*
And with this function, the crash information will also be put out to
log file. And this function will return a crash information struct to
*qemu_system_**guest**_panicked*, which will then print the crash info
to log file too.
*I wonder what is the difference between them? And when the property
function is called?
*
*
*
*Any clue will be very appreciated. Thanks in advance.
*
Thanks in advance.
--
Best regards.
Wang Dong